1 From 6a6c611ca3d9d6745e5343f2ee041892772ccae6 Mon Sep 17 00:00:00 2001
2 From: vexed <vexed@wz2100.net>
3 Date: Thu, 16 Jul 2015 22:45:14 -0400
4 Subject: [PATCH] Resync/backport the code base:
6 3.1: Remove hack to support some pre-OpenGL-2.0 systems that made
7 assumptions about internals in GLEW that breaks with GLEW 1.12.
9 See ticket:4300 reported by pabs
11 (cherry picked from commit d512d1dc9857e3c2bbfa0a7b5856bdf420412b8f)
14 lib/ivis_opengl/screen.cpp
16 lib/ivis_opengl/screen.cpp | 61 ----------------------------------------------
17 lib/ivis_opengl/screen.h | 1 -
19 3 files changed, 65 deletions(-)
21 diff --git a/lib/ivis_opengl/screen.cpp b/lib/ivis_opengl/screen.cpp
22 index b0aa0f5..b957227 100644
23 --- a/lib/ivis_opengl/screen.cpp
24 +++ b/lib/ivis_opengl/screen.cpp
25 @@ -175,7 +175,6 @@ bool screenInitialise()
29 - screen_EnableMissingFunctions(); // We need to do this before pie_LoadShaders(), but the effect of this call will be undone later by iV_TextInit(), so we will need to call it again.
30 if (pie_LoadShaders())
32 pie_SetShaderAvailability(true);
33 @@ -207,66 +206,6 @@ void screenShutDown(void)
34 return GLEW_VERSION_1_5 || GLEW_ARB_vertex_buffer_object;
37 -// Make OpenGL's VBO functions available under the core names for drivers that support OpenGL 1.4 only but have the VBO extension
38 -void screen_EnableMissingFunctions()
40 - if (!GLEW_VERSION_1_3 && GLEW_ARB_multitexture)
42 - debug(LOG_WARNING, "Pre-OpenGL 1.3: Fixing ARB_multitexture extension function names.");
44 - __glewActiveTexture = __glewActiveTextureARB;
45 - __glewMultiTexCoord2fv = __glewMultiTexCoord2fvARB;
48 - if (!GLEW_VERSION_1_5 && GLEW_ARB_vertex_buffer_object)
50 - debug(LOG_WARNING, "Pre-OpenGL 1.5: Fixing ARB_vertex_buffer_object extension function names.");
52 - __glewBindBuffer = __glewBindBufferARB;
53 - __glewBufferData = __glewBufferDataARB;
54 - __glewBufferSubData = __glewBufferSubDataARB;
55 - __glewDeleteBuffers = __glewDeleteBuffersARB;
56 - __glewGenBuffers = __glewGenBuffersARB;
57 - __glewGetBufferParameteriv = __glewGetBufferParameterivARB;
58 - __glewGetBufferPointerv = __glewGetBufferPointervARB;
59 - __glewGetBufferSubData = __glewGetBufferSubDataARB;
60 - __glewIsBuffer = __glewIsBufferARB;
61 - __glewMapBuffer = __glewMapBufferARB;
62 - __glewUnmapBuffer = __glewUnmapBufferARB;
65 - if (!GLEW_VERSION_2_0 && GLEW_ARB_shader_objects)
67 - debug(LOG_WARNING, "Pre-OpenGL 2.0: Fixing ARB_shader_objects extension function names.");
69 - __glewGetUniformLocation = __glewGetUniformLocationARB;
70 - __glewAttachShader = __glewAttachObjectARB;
71 - __glewCompileShader = __glewCompileShaderARB;
72 - __glewCreateProgram = __glewCreateProgramObjectARB;
73 - __glewCreateShader = __glewCreateShaderObjectARB;
74 - __glewGetProgramInfoLog = __glewGetInfoLogARB;
75 - __glewGetShaderInfoLog = __glewGetInfoLogARB; // Same as previous.
76 - __glewGetProgramiv = __glewGetObjectParameterivARB;
77 - __glewUseProgram = __glewUseProgramObjectARB;
78 - __glewGetShaderiv = __glewGetObjectParameterivARB;
79 - __glewLinkProgram = __glewLinkProgramARB;
80 - __glewShaderSource = __glewShaderSourceARB;
81 - __glewUniform1f = __glewUniform1fARB;
82 - __glewUniform1i = __glewUniform1iARB;
83 - __glewUniform4fv = __glewUniform4fvARB;
86 - if ((GLEW_ARB_imaging || GLEW_EXT_blend_color) && __glewBlendColor == NULL)
88 - __glewBlendColor = __glewBlendColorEXT; // Shouldn't be needed if GLEW_ARB_imaging is true, but apparently is needed even in that case, with some drivers..?
89 - if (__glewBlendColor == NULL)
91 - debug(LOG_ERROR, "Your graphics driver is broken, and claims to support ARB_imaging or EXT_blend_color without exporting glBlendColor[EXT].");
92 - __GLEW_ARB_imaging = __GLEW_EXT_blend_color = 0;
97 void screen_SetBackDropFromFile(const char* filename)
99 // HACK : We should use a resource handler here!
100 diff --git a/lib/ivis_opengl/screen.h b/lib/ivis_opengl/screen.h
101 index 7cfc819..09235f4 100644
102 --- a/lib/ivis_opengl/screen.h
103 +++ b/lib/ivis_opengl/screen.h
104 @@ -62,7 +62,6 @@ extern void screenDoDumpToDiskIfRequired(void);
105 void screen_enableMapPreview(char *name, int width, int height, Vector2i *playerpositions);
106 void screen_disableMapPreview(void);
107 bool screen_getMapPreview(void);
108 -void screen_EnableMissingFunctions();
112 diff --git a/src/init.cpp b/src/init.cpp
113 index aaf7003..3f42313 100644
116 @@ -716,9 +716,6 @@ bool systemInitialise(void)
117 // Initialize the iVis text rendering module
120 - // Fix badly named OpenGL functions. Must be done after iV_TextInit, to avoid the renames being clobbered by an extra glewInit() call.
121 - screen_EnableMissingFunctions();
123 iV_Reset(); // Reset the IV library.