mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 04:53:27 +02:00
init on screen center on first startup
This commit is contained in:
@@ -52,6 +52,9 @@ namespace Platform
|
||||
int getWindowHeight();
|
||||
bool isWindowMaximized();
|
||||
|
||||
int getDisplayHeight();
|
||||
int getDisplayWidth();
|
||||
|
||||
/// Get GL extension function address
|
||||
void *getExtensionProcAddress(const char *ext);
|
||||
/// Check if GL extension is supported
|
||||
|
@@ -350,8 +350,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
RECT *rect = (RECT*)lParam;
|
||||
win32.x = rect->left;
|
||||
win32.y = rect->top;
|
||||
win32.width = rect->right - rect->left;
|
||||
win32.height = rect->bottom - rect->top;
|
||||
break;
|
||||
}
|
||||
case WM_SIZE:
|
||||
@@ -366,6 +364,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
}
|
||||
|
||||
win32.width = LOWORD(lParam);
|
||||
win32.height = HIWORD(lParam);
|
||||
g_engine.onResize(LOWORD(lParam), HIWORD(lParam));
|
||||
break;
|
||||
}
|
||||
|
@@ -772,6 +772,16 @@ int Platform::getWindowHeight()
|
||||
return x11.height;
|
||||
}
|
||||
|
||||
int Platform::getDisplayWidth()
|
||||
{
|
||||
return XDisplayWidth(x11.display, DefaultScreen(x11.display));
|
||||
}
|
||||
|
||||
int Platform::getDisplayHeight()
|
||||
{
|
||||
return XDisplayHeight(x11.display, DefaultScreen(x11.display));
|
||||
}
|
||||
|
||||
bool Platform::isWindowMaximized()
|
||||
{
|
||||
bool ret = false;
|
||||
|
Reference in New Issue
Block a user