void
resize(int w, int h) {
- Drawable::resize(w, h);
+ if (w == width && h == height) {
+ return;
+ }
+
RECT rClient, rWindow;
GetClientRect(hWnd, &rClient);
GetWindowRect(hWnd, &rWindow);
w += (rWindow.right - rWindow.left) - rClient.right;
h += (rWindow.bottom - rWindow.top) - rClient.bottom;
SetWindowPos(hWnd, NULL, rWindow.left, rWindow.top, w, h, SWP_NOMOVE);
+
+ Drawable::resize(w, h);
}
void show(void) {
- if (!visible) {
- ShowWindow(hWnd, SW_SHOW);
-
- Drawable::show();
+ if (visible) {
+ return;
}
+
+ ShowWindow(hWnd, SW_SHOW);
+
+ Drawable::show();
}
void swapBuffers(void) {