@@ -80,31 +80,34 @@ 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)
84
- if (configs->useWayland == 2 ) {
85
- if (!try_guess_wayland ())
86
- configs->useWayland = 0 ;
87
- } else if (configs->useWayland == 1 && try_guess_wayland ()) {
88
- params.DeviceType = irr::E_DEVICE_TYPE::EIDT_WAYLAND;
89
- 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 " );
94
- }
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
- #endif
100
83
params.Vsync = configs->vsync ;
101
84
if (configs->driver_type == irr::video::EDT_COUNT)
102
85
params.DriverType = getDefaultDriver (params.DeviceType );
103
86
else
104
87
params.DriverType = configs->driver_type ;
105
88
#if (IRRLICHT_VERSION_MAJOR==1 && IRRLICHT_VERSION_MINOR==9)
89
+ // This correspond to the program's class name, used by window managers and
90
+ // desktop environments to group multiple instances with their desktop file
91
+ params.ClassName = EPRO_TEXT (" edopro" );
92
+ params.WindowCaption = EPRO_TEXT (" Project Ignis: EDOPro" );
106
93
params.OGLES2ShaderPath = EPRO_TEXT (" BUNDLED" );
107
94
params.WindowResizable = true ;
95
+ #if EDOPRO_WINDOWS
96
+ params.WindowIcon = MAKEINTRESOURCE (1 );
97
+ #endif
98
+ #if EDOPRO_LINUX
99
+ if (configs->useWayland == 2 ) {
100
+ if (!try_guess_wayland ())
101
+ configs->useWayland = 0 ;
102
+ } else if (configs->useWayland == 1 && try_guess_wayland ()) {
103
+ params.DeviceType = irr::E_DEVICE_TYPE::EIDT_WAYLAND;
104
+ epro::print (" You're using the wayland device backend.\n "
105
+ " Keep in mind that it's still experimental and might be unstable.\n "
106
+ " If you are getting any major issues, or the game doesn't start,\n "
107
+ " you can manually disable this option from the system.conf file by toggling the useWayland option.\n "
108
+ " Feel free to report any issues you encounter.\n " );
109
+ }
110
+ #endif
108
111
#if EDOPRO_MACOS
109
112
params.UseIntegratedGPU = configs->useIntegratedGpu > 0 ;
110
113
#endif
@@ -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