From 0fc380db2d258090c0b6a99dac773009c2cca8d4 Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 20 Nov 2018 16:03:39 +0000 Subject: [PATCH] GLCtrl: Fixes git-svn-id: svn://ultimatepp.org/upp/trunk@12560 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/GLCtrl/GLCtrl.cpp | 11 +++++++++++ uppsrc/GLCtrl/Win32GLCtrl.cpp | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/uppsrc/GLCtrl/GLCtrl.cpp b/uppsrc/GLCtrl/GLCtrl.cpp index 04e91da4c..379e874fa 100644 --- a/uppsrc/GLCtrl/GLCtrl.cpp +++ b/uppsrc/GLCtrl/GLCtrl.cpp @@ -62,4 +62,15 @@ void GLCtrl::StdView() glLoadIdentity(); } +#ifndef GUI_GTK + +Image GLCtrl::GLPane::MouseEvent(int event, Point p, int zdelta, dword keyflags) +{ + p = p - GetScreenView().TopLeft() + ctrl->GetScreenView().TopLeft(); + return ctrl->MouseEvent(event, p, zdelta, keyflags); +} + +#endif + + } diff --git a/uppsrc/GLCtrl/Win32GLCtrl.cpp b/uppsrc/GLCtrl/Win32GLCtrl.cpp index 62655d43b..7018c780e 100644 --- a/uppsrc/GLCtrl/Win32GLCtrl.cpp +++ b/uppsrc/GLCtrl/Win32GLCtrl.cpp @@ -11,7 +11,7 @@ static HGLRC s_openGLContext; // we only have single OpenGL cont static PIXELFORMATDESCRIPTOR s_pfd; static int s_pixelFormatID; -void MakeGLContext(int depthBits, int stencilBits, int samples) +void MakeWGLContext(int depthBits, int stencilBits, int samples) { ONCELOCK { for(int pass = 0; pass < 2; pass++) { @@ -83,7 +83,7 @@ void MakeGLContext(int depthBits, int stencilBits, int samples) void GLCtrl::CreateContext() { - MakeGLContext(depthSize, stencilSize, numberOfSamples); + MakeWGLContext(depthSize, stencilSize, numberOfSamples); } void GLCtrl::GLPane::State(int reason) @@ -109,7 +109,7 @@ LRESULT GLCtrl::GLPane::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) BeginPaint(hwnd, &ps); HDC hDC = ps.hdc; wglMakeCurrent(hDC, s_openGLContext); - DoPaint(); + ctrl->DoGLPaint(); if(ctrl->doubleBuffering) SwapBuffers(hDC); else