Skip to content
Snippets Groups Projects
Commit 0f049f72 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Fix another bizarre SDL behavior with setting backing surface color...

parent 03a7501b
No related branches found
No related tags found
No related merge requests found
...@@ -424,6 +424,19 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B ...@@ -424,6 +424,19 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
// Setup default window flags // Setup default window flags
mSDLFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE; mSDLFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE;
// Setup default backing colors
GLint redBits{8}, greenBits{8}, blueBits{8}, alphaBits{8};
GLint depthBits{24}, stencilBits{8};
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, redBits);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, greenBits);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, blueBits);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, alphaBits);
SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 32);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, depthBits);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, stencilBits);
if (mWindow == nullptr) if (mWindow == nullptr)
{ {
if (width == 0) if (width == 0)
...@@ -560,18 +573,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B ...@@ -560,18 +573,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
} }
} }
GLint redBits{8}, greenBits{8}, blueBits{8}, alphaBits{(bits <= 16) ? 1 : 8};
GLint depthBits{(bits <= 16) ? 16 : 24}, stencilBits{8};
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, redBits);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, greenBits);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, blueBits);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, depthBits);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, stencilBits);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, alphaBits);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
if (mFSAASamples > 0) if (mFSAASamples > 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment