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: ...@@ -149,6 +149,8 @@ public:
OpenGLContext(); OpenGLContext();
~OpenGLContext(); ~OpenGLContext();
void requestLegacyContext();
bool init(Window* pParent = 0); bool init(Window* pParent = 0);
bool init(SystemChildWindow* pChildWindow); bool init(SystemChildWindow* pChildWindow);
...@@ -186,6 +188,7 @@ private: ...@@ -186,6 +188,7 @@ private:
SystemChildWindow* m_pChildWindow; SystemChildWindow* m_pChildWindow;
boost::scoped_ptr<SystemChildWindow> m_pChildWindowGC; boost::scoped_ptr<SystemChildWindow> m_pChildWindowGC;
bool mbInitialized; bool mbInitialized;
bool mbRequestLegacyContext;
}; };
#endif #endif
......
...@@ -29,7 +29,8 @@ GLWindow::~GLWindow() ...@@ -29,7 +29,8 @@ GLWindow::~GLWindow()
OpenGLContext::OpenGLContext(): OpenGLContext::OpenGLContext():
mpWindow(NULL), mpWindow(NULL),
m_pChildWindow(NULL), m_pChildWindow(NULL),
mbInitialized(false) mbInitialized(false),
mbRequestLegacyContext(false)
{ {
} }
...@@ -60,6 +61,11 @@ OpenGLContext::~OpenGLContext() ...@@ -60,6 +61,11 @@ OpenGLContext::~OpenGLContext()
#endif #endif
} }
void OpenGLContext::requestLegacyContext()
{
mbRequestLegacyContext = true;
}
#if defined( _WIN32 ) #if defined( _WIN32 )
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
...@@ -491,6 +497,9 @@ bool OpenGLContext::ImplInit() ...@@ -491,6 +497,9 @@ bool OpenGLContext::ImplInit()
(CGLPixelFormatAttribute) 0 (CGLPixelFormatAttribute) 0
}; };
if (mbRequestLegacyContext)
pixelFormatAttributes[1] = (CGLPixelFormatAttribute) kCGLOGLPVersion_Legacy;
CGLPixelFormatObj pixelFormat; CGLPixelFormatObj pixelFormat;
GLint numberOfPixels; GLint numberOfPixels;
CGLChoosePixelFormat(pixelFormatAttributes, &pixelFormat, &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