diff --git a/src/gl/scene/gl_skydome.cpp b/src/gl/scene/gl_skydome.cpp index 0f5e862844..1a8794c58f 100644 --- a/src/gl/scene/gl_skydome.cpp +++ b/src/gl/scene/gl_skydome.cpp @@ -229,6 +229,7 @@ void FSkyVertexBuffer::RenderDome(FMaterial *tex, int mode) { int rc = mRows + 1; + // The caps only get drawn for the main layer but not for the overlay. if (mode == SKYMODE_MAINLAYER && tex != NULL) { // if there's no shader we cannot use the default color from the buffer because the object color is part of the preset vertex attribute. @@ -239,7 +240,7 @@ void FSkyVertexBuffer::RenderDome(FMaterial *tex, int mode) gl_RenderState.Apply(); RenderRow(GL_TRIANGLE_FAN, 0); - PalEntry pe = tex->tex->GetSkyCapColor(true); + pe = tex->tex->GetSkyCapColor(true); gl_RenderState.SetObjectColor(pe); gl_RenderState.Apply(); RenderRow(GL_TRIANGLE_FAN, rc); diff --git a/src/gl/system/gl_interface.cpp b/src/gl/system/gl_interface.cpp index e0d363446e..ac34bd2c18 100644 --- a/src/gl/system/gl_interface.cpp +++ b/src/gl/system/gl_interface.cpp @@ -132,6 +132,9 @@ void gl_LoadExtensions() { I_FatalError("Unsupported OpenGL version.\nAt least GL 2.0 is required to run " GAMENAME ".\n"); } + gl.version = strtod(version, NULL); + gl.glslversion = strtod((char*)glGetString(GL_SHADING_LANGUAGE_VERSION), NULL); + if (gl.version < 3.f) gl.glslversion = 0.f; // This loads any function pointers and flags that require a vaild render context to // initialize properly @@ -140,11 +143,7 @@ void gl_LoadExtensions() if (CheckExtension("GL_ARB_texture_compression")) gl.flags|=RFL_TEXTURE_COMPRESSION; if (CheckExtension("GL_EXT_texture_compression_s3tc")) gl.flags|=RFL_TEXTURE_COMPRESSION_S3TC; - if (CheckExtension("GL_ARB_buffer_storage")) gl.flags |= RFL_BUFFER_STORAGE; - - gl.version = strtod(version, NULL); - gl.glslversion = strtod((char*)glGetString(GL_SHADING_LANGUAGE_VERSION), NULL); - if (gl.version < 3.f) gl.glslversion = 0.f; + if (gl.version >= 4.f && CheckExtension("GL_ARB_buffer_storage")) gl.flags |= RFL_BUFFER_STORAGE; glGetIntegerv(GL_MAX_TEXTURE_SIZE,&gl.max_texturesize); glPixelStorei(GL_UNPACK_ALIGNMENT, 1);