diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-08-16 05:36:30 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-09-02 01:08:45 +0200 |
commit | 7a7a8e1b3251232c08f568ad9d14004f01210b68 (patch) | |
tree | 049c345422e535a5adcfd3254989d7ea611f3a28 /vcl/source/opengl | |
parent | a72a10a32b1922462d43170a2a77a95c49d4fda2 (diff) |
add possibility to request a compatibility context
Change-Id: I0135e81f925fda19c06144d21d2f2b0efc9e57be
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 98042db34511..e8ab18e15543 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -29,7 +29,8 @@ GLWindow::~GLWindow() OpenGLContext::OpenGLContext(): mpWindow(NULL), m_pChildWindow(NULL), - mbInitialized(false) + mbInitialized(false), + mbRequestLegacyContext(false) { } @@ -60,6 +61,11 @@ OpenGLContext::~OpenGLContext() #endif } +void OpenGLContext::requestLegacyContext() +{ + mbRequestLegacyContext = true; +} + #if defined( _WIN32 ) static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { @@ -491,6 +497,9 @@ bool OpenGLContext::ImplInit() (CGLPixelFormatAttribute) 0 }; + if (mbRequestLegacyContext) + pixelFormatAttributes[1] = (CGLPixelFormatAttribute) kCGLOGLPVersion_Legacy; + CGLPixelFormatObj pixelFormat; GLint numberOfPixels; CGLChoosePixelFormat(pixelFormatAttributes, &pixelFormat, &numberOfPixels); |