@@ -80,31 +80,30 @@ static inline irr::video::E_DRIVER_TYPE getDefaultDriver(irr::E_DEVICE_TYPE devi
80
80
irr::IrrlichtDevice* GUIUtils::CreateDevice (GameConfig* configs) {
81
81
irr::SIrrlichtCreationParameters params{};
82
82
params.AntiAlias = configs->antialias ;
83
- #if EDOPRO_LINUX && (IRRLICHT_VERSION_MAJOR==1 && IRRLICHT_VERSION_MINOR==9)
83
+ params.Vsync = configs->vsync ;
84
+ #if (IRRLICHT_VERSION_MAJOR==1 && IRRLICHT_VERSION_MINOR==9)
85
+ // This correspond to the program's class name, used by window managers and
86
+ // desktop environments to group multiple instances with their desktop file
87
+ params.ClassName = EPRO_TEXT (" edopro" );
88
+ params.WindowCaption = EPRO_TEXT (" Project Ignis: EDOPro" );
89
+ params.OGLES2ShaderPath = EPRO_TEXT (" BUNDLED" );
90
+ params.WindowResizable = true ;
91
+ #if EDOPRO_WINDOWS
92
+ params.WindowIcon = MAKEINTRESOURCE (1 );
93
+ #endif
94
+ #if EDOPRO_LINUX
84
95
if (configs->useWayland == 2 ) {
85
96
if (!try_guess_wayland ())
86
97
configs->useWayland = 0 ;
87
98
} else if (configs->useWayland == 1 && try_guess_wayland ()) {
88
99
params.DeviceType = irr::E_DEVICE_TYPE::EIDT_WAYLAND;
89
100
epro::print (" You're using the wayland device backend.\n "
90
- " Keep in mind that it's still experimental and might be unstable.\n "
91
- " If you are getting any major issues, or the game doesn't start,\n "
92
- " you can manually disable this option from the system.conf file by toggling the useWayland option.\n "
93
- " Feel free to report any issues you encounter.\n " );
101
+ " Keep in mind that it's still experimental and might be unstable.\n "
102
+ " If you are getting any major issues, or the game doesn't start,\n "
103
+ " you can manually disable this option from the system.conf file by toggling the useWayland option.\n "
104
+ " Feel free to report any issues you encounter.\n " );
94
105
}
95
- // This correspond to the program's class name, used by window managers and
96
- // desktop environments to group multiple instances with their desktop file
97
- char class_name[] = " edopro" ;
98
- params.PrivateData = class_name;
99
106
#endif
100
- params.Vsync = configs->vsync ;
101
- if (configs->driver_type == irr::video::EDT_COUNT)
102
- params.DriverType = getDefaultDriver (params.DeviceType );
103
- else
104
- params.DriverType = configs->driver_type ;
105
- #if (IRRLICHT_VERSION_MAJOR==1 && IRRLICHT_VERSION_MINOR==9)
106
- params.OGLES2ShaderPath = EPRO_TEXT (" BUNDLED" );
107
- params.WindowResizable = true ;
108
107
#if EDOPRO_MACOS
109
108
params.UseIntegratedGPU = configs->useIntegratedGpu > 0 ;
110
109
#endif
@@ -118,6 +117,10 @@ irr::IrrlichtDevice* GUIUtils::CreateDevice(GameConfig* configs) {
118
117
params.AntiAlias = 0 ;
119
118
params.WindowSize = {};
120
119
#endif
120
+ if (configs->driver_type == irr::video::EDT_COUNT)
121
+ params.DriverType = getDefaultDriver (params.DeviceType );
122
+ else
123
+ params.DriverType = configs->driver_type ;
121
124
irr::IrrlichtDevice* device = irr::createDeviceEx (params);
122
125
if (!device)
123
126
throw std::runtime_error (" Failed to create Irrlicht Engine device!" );
@@ -144,24 +147,30 @@ irr::IrrlichtDevice* GUIUtils::CreateDevice(GameConfig* configs) {
144
147
#endif
145
148
driver->setTextureCreationFlag (irr::video::ETCF_CREATE_MIP_MAPS, false );
146
149
driver->setTextureCreationFlag (irr::video::ETCF_OPTIMIZED_FOR_QUALITY, true );
147
- device->setWindowCaption (L" Project Ignis: EDOPro" );
148
150
#if !(IRRLICHT_VERSION_MAJOR==1 && IRRLICHT_VERSION_MINOR==9)
151
+ device->setWindowCaption (L" Project Ignis: EDOPro" );
149
152
device->setResizable (true );
150
- #endif
151
153
#if EDOPRO_WINDOWS
152
154
auto hInstance = static_cast <HINSTANCE>(GetModuleHandle (nullptr ));
153
155
auto hSmallIcon = static_cast <HICON>(LoadImage (hInstance, MAKEINTRESOURCE (1 ), IMAGE_ICON, GetSystemMetrics (SM_CXSMICON), GetSystemMetrics (SM_CXSMICON), LR_DEFAULTCOLOR));
154
156
auto hBigIcon = static_cast <HICON>(LoadImage (hInstance, MAKEINTRESOURCE (1 ), IMAGE_ICON, GetSystemMetrics (SM_CXICON), GetSystemMetrics (SM_CYICON), LR_DEFAULTCOLOR));
155
- auto hWnd = GetWindowHandle (driver);
156
- SendMessage (hWnd, WM_SETICON, ICON_SMALL, reinterpret_cast <LPARAM>(hSmallIcon));
157
- SendMessage (hWnd, WM_SETICON, ICON_BIG, reinterpret_cast <LPARAM>(hBigIcon));
157
+ {
158
+ auto hWnd = GetWindowHandle (driver);
159
+ SendMessage (hWnd, WM_SETICON, ICON_SMALL, reinterpret_cast <LPARAM>(hSmallIcon));
160
+ SendMessage (hWnd, WM_SETICON, ICON_BIG, reinterpret_cast <LPARAM>(hBigIcon));
161
+ }
162
+ #endif
163
+ #endif
164
+ #if EDOPRO_WINDOWS
158
165
if (gGameConfig ->windowStruct .size ()) {
159
166
auto winstruct = base64_decode (gGameConfig ->windowStruct );
160
167
if (winstruct.size () == sizeof (WINDOWPLACEMENT)) {
161
168
WINDOWPLACEMENT wp;
162
169
memcpy (&wp, winstruct.data (), sizeof (WINDOWPLACEMENT));
163
- if (wp.length == sizeof (WINDOWPLACEMENT))
170
+ if (wp.length == sizeof (WINDOWPLACEMENT)) {
171
+ auto hWnd = GetWindowHandle (driver);
164
172
SetWindowPlacement (hWnd, &wp);
173
+ }
165
174
}
166
175
}
167
176
#elif EDOPRO_MACOS
0 commit comments