mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-20 15:13:45 +00:00
GL fix for Epoxy and creating a 3.2 core context with win32 api.
This commit is contained in:
parent
f1c8286c2f
commit
8056a4bfa9
1 changed files with 9 additions and 0 deletions
|
|
@ -272,6 +272,11 @@ void GFXGLDevice::init( const GFXVideoMode &mode, PlatformWindow *window )
|
|||
int debugFlag = 0;
|
||||
#endif
|
||||
|
||||
// Create a temp rendering context, needed a current context to use wglCreateContextAttribsARB
|
||||
HGLRC tempGLRC = wglCreateContext(hdcGL);
|
||||
if (!wglMakeCurrent(hdcGL, tempGLRC))
|
||||
AssertFatal(false, "Couldn't make temp GL context.");
|
||||
|
||||
if( gglHasWExtension(hdcGL, ARB_create_context) )
|
||||
{
|
||||
int const create_attribs[] = {
|
||||
|
|
@ -292,6 +297,10 @@ void GFXGLDevice::init( const GFXVideoMode &mode, PlatformWindow *window )
|
|||
else
|
||||
mContext = wglCreateContext( hdcGL );
|
||||
|
||||
// Delete temp rendering context
|
||||
wglMakeCurrent(NULL, NULL);
|
||||
wglDeleteContext(tempGLRC);
|
||||
|
||||
if( !wglMakeCurrent( hdcGL, (HGLRC)mContext ) )
|
||||
AssertFatal( false , "GFXGLDevice::init - cannot make our context current. Or maybe we can't create it." );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue