From 32f08adaf366a30d9bd091139211fc72555c11b3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 Sep 2014 23:01:57 +0200 Subject: [PATCH] - moved some code to better places. - allow GL version 3.0 in Windows, too. --- src/gl/system/gl_framebuffer.cpp | 8 -------- src/gl/system/gl_interface.cpp | 8 ++++++++ src/gl/textures/gl_texture.cpp | 2 +- src/win32/win32gliface.cpp | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index 2ddbf3439..d9f05bea6 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -127,14 +127,6 @@ void OpenGLFrameBuffer::InitializeState() gl_LoadExtensions(); Super::InitializeState(); - int v; - glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &v); - gl.maxuniforms = v; - glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &v); - gl.maxuniformblock = v; - glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &v); - gl.uniformblockalignment = v; - if (first) { first=false; diff --git a/src/gl/system/gl_interface.cpp b/src/gl/system/gl_interface.cpp index 5d4e8efeb..be0beaf4e 100644 --- a/src/gl/system/gl_interface.cpp +++ b/src/gl/system/gl_interface.cpp @@ -137,6 +137,14 @@ void gl_LoadExtensions() if (CheckExtension("GL_ARB_buffer_storage")) gl.flags |= RFL_BUFFER_STORAGE; } + int v; + glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &v); + gl.maxuniforms = v; + glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &v); + gl.maxuniformblock = v; + glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &v); + gl.uniformblockalignment = v; + glGetIntegerv(GL_MAX_TEXTURE_SIZE,&gl.max_texturesize); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); } diff --git a/src/gl/textures/gl_texture.cpp b/src/gl/textures/gl_texture.cpp index 838510bcd..53a07d437 100644 --- a/src/gl/textures/gl_texture.cpp +++ b/src/gl/textures/gl_texture.cpp @@ -814,7 +814,7 @@ CCMD(textureinfo) if (tex->gl_info.SystemTexture[0] || tex->gl_info.SystemTexture[1] || tex->gl_info.Material[0] || tex->gl_info.Material[1]) { int lump = tex->GetSourceLump(); - Printf(PRINT_LOG, "Texture '%s' (Index %d, Lump %d, Name '%s'):\n", (const char*)(tex->Name), i, lump, Wads.GetLumpFullName(lump)); + Printf(PRINT_LOG, "Texture '%s' (Index %d, Lump %d, Name '%s'):\n", tex->Name.GetChars(), i, lump, Wads.GetLumpFullName(lump)); if (tex->gl_info.Material[0]) { Printf(PRINT_LOG, "in use (normal)\n"); diff --git a/src/win32/win32gliface.cpp b/src/win32/win32gliface.cpp index 81b1d9418..59ce1e65e 100644 --- a/src/win32/win32gliface.cpp +++ b/src/win32/win32gliface.cpp @@ -775,8 +775,8 @@ bool Win32GLVideo::InitHardware (HWND Window, int multisample) if (myWglCreateContextAttribsARB != NULL) { // let's try to get the best version possible. Some drivers only give us the version we request - // which breaks all version checks for feature support. The highest used features we use are from version 4.4, and 3.3 is a requirement. - static int versions[] = { 45, 44, 43, 42, 41, 40, 33, -1 }; + // which breaks all version checks for feature support. The highest used features we use are from version 4.4, and 3.0 is a requirement. + static int versions[] = { 45, 44, 43, 42, 41, 40, 33, 32, 31, 30, -1 }; for (int i = 0; versions[i] > 0; i++) {