X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glws_wgl.cpp;h=4b5870ef75c97378967ebeb02f22c6245849b2bd;hb=e935ee1015d5162e02d90be7b52267194231e038;hp=adc99578e3b7aa9cd885c2de41458301856dec52;hpb=9a0ed9ce37a521e78fdfdfe3fa6042dcb6c08d39;p=apitrace diff --git a/glws_wgl.cpp b/glws_wgl.cpp index adc9957..4b5870e 100644 --- a/glws_wgl.cpp +++ b/glws_wgl.cpp @@ -136,21 +136,28 @@ public: 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) { @@ -203,8 +210,12 @@ createDrawable(const Visual *visual, int width, int height) } Context * -createContext(const Visual *visual, Context *shareContext) +createContext(const Visual *visual, Context *shareContext, Profile profile) { + if (profile != PROFILE_COMPAT) { + return NULL; + } + return new WglContext(visual, dynamic_cast(shareContext)); }