Kaydet (Commit) 7a7a8e1b authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add possibility to request a compatibility context

Change-Id: I0135e81f925fda19c06144d21d2f2b0efc9e57be
üst a72a10a3
......@@ -149,6 +149,8 @@ public:
OpenGLContext();
~OpenGLContext();
void requestLegacyContext();
bool init(Window* pParent = 0);
bool init(SystemChildWindow* pChildWindow);
......@@ -186,6 +188,7 @@ private:
SystemChildWindow* m_pChildWindow;
boost::scoped_ptr<SystemChildWindow> m_pChildWindowGC;
bool mbInitialized;
bool mbRequestLegacyContext;
};
#endif
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment