From 7af28a6adfe34945d600fc431e7b9f4aa55cd027 Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 29 Oct 2015 17:56:50 +0000 Subject: [PATCH] GLCtrl fixed for mingw (thanks koldo) git-svn-id: svn://ultimatepp.org/upp/trunk@9112 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/GLCtrl/Win32GLCtrl.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/uppsrc/GLCtrl/Win32GLCtrl.cpp b/uppsrc/GLCtrl/Win32GLCtrl.cpp index 6e7524b45..9b58c8d5d 100644 --- a/uppsrc/GLCtrl/Win32GLCtrl.cpp +++ b/uppsrc/GLCtrl/Win32GLCtrl.cpp @@ -87,13 +87,16 @@ void GLCtrl::GLPane::State(int reason) LRESULT GLCtrl::GLPane::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { - if((message == WM_PAINT || message == WM_SIZE || message == WM_ERASEBKGND) && hDC && hRC) + if((message == WM_PAINT || message == WM_SIZE || message == WM_ERASEBKGND) && hDC && hRC) { PAINTSTRUCT ps; BeginPaint(GetHWND(), &ps); ActivateContext(); ctrl->GLPaint(); - ctrl->doubleBuffering ? SwapBuffers(hDC) : glFlush(); + if(ctrl->doubleBuffering) + SwapBuffers(hDC); + else + glFlush(); EndPaint(GetHWND(), &ps); return 0; }