Linux; Move SDL_GL_CreateContext right after SDL_CreateImage.
Putting it before SDL_GetWindowSurface seems to fix the problems with the NVidia driver.meow-7.2.2
parent
759c43cbb3
commit
ea7526eecf
|
|
@ -546,8 +546,20 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
|||
mWindow = SDL_CreateWindow( mWindowTitle.c_str(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, mSDLFlags );
|
||||
|
||||
if( mWindow )
|
||||
{
|
||||
mContext = SDL_GL_CreateContext( mWindow );
|
||||
|
||||
if( mContext == 0 )
|
||||
{
|
||||
LL_WARNS() << "Cannot create GL context " << SDL_GetError() << LL_ENDL;
|
||||
setupFailure("GL Context creation error creation error", "Error", OSMB_OK);
|
||||
return FALSE;
|
||||
}
|
||||
// SDL_GL_SetSwapInterval(1);
|
||||
mSurface = SDL_GetWindowSurface( mWindow );
|
||||
|
||||
}
|
||||
|
||||
|
||||
if( mFullscreen )
|
||||
{
|
||||
if (mSurface)
|
||||
|
|
@ -599,20 +611,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
|
|||
bmpsurface = NULL;
|
||||
}
|
||||
|
||||
char const *pEnv = getenv("FS_NO_SDL_CREATE_CONTEXT" );
|
||||
if( pEnv == nullptr || std::string( pEnv ) == "1" )
|
||||
{
|
||||
mContext = SDL_GL_CreateContext( mWindow );
|
||||
|
||||
if( mContext == 0 )
|
||||
{
|
||||
LL_WARNS() << "Cannot create GL context " << SDL_GetError() << LL_ENDL;
|
||||
raise(SIGTRAP);
|
||||
return FALSE;
|
||||
}
|
||||
// SDL_GL_SetSwapInterval(1);
|
||||
}
|
||||
|
||||
// Detect video memory size.
|
||||
# if LL_X11
|
||||
gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024;
|
||||
|
|
|
|||
Loading…
Reference in New Issue