]> git.pld-linux.org Git - packages/warzone2100.git/blob - glew-1.12.patch
- fix building with glew 1.12
[packages/warzone2100.git] / glew-1.12.patch
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:
5
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.
8
9 See ticket:4300 reported by pabs
10
11 (cherry picked from commit d512d1dc9857e3c2bbfa0a7b5856bdf420412b8f)
12
13 Conflicts:
14         lib/ivis_opengl/screen.cpp
15 ---
16  lib/ivis_opengl/screen.cpp | 61 ----------------------------------------------
17  lib/ivis_opengl/screen.h   |  1 -
18  src/init.cpp               |  3 ---
19  3 files changed, 65 deletions(-)
20
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()
26  
27         if (canRunShaders)
28         {
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())
31                 {
32                         pie_SetShaderAvailability(true);
33 @@ -207,66 +206,6 @@ void screenShutDown(void)
34         return GLEW_VERSION_1_5 || GLEW_ARB_vertex_buffer_object;
35  }
36  
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()
39 -{
40 -       if (!GLEW_VERSION_1_3 && GLEW_ARB_multitexture)
41 -       {
42 -               debug(LOG_WARNING, "Pre-OpenGL 1.3: Fixing ARB_multitexture extension function names.");
43 -
44 -               __glewActiveTexture = __glewActiveTextureARB;
45 -               __glewMultiTexCoord2fv = __glewMultiTexCoord2fvARB;
46 -       }
47 -
48 -       if (!GLEW_VERSION_1_5 && GLEW_ARB_vertex_buffer_object)
49 -       {
50 -               debug(LOG_WARNING, "Pre-OpenGL 1.5: Fixing ARB_vertex_buffer_object extension function names.");
51 -
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;
63 -       }
64 -
65 -       if (!GLEW_VERSION_2_0 && GLEW_ARB_shader_objects)
66 -       {
67 -               debug(LOG_WARNING, "Pre-OpenGL 2.0: Fixing ARB_shader_objects extension function names.");
68 -
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;
84 -       }
85 -
86 -       if ((GLEW_ARB_imaging || GLEW_EXT_blend_color) && __glewBlendColor == NULL)
87 -       {
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)
90 -               {
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;
93 -               }
94 -       }
95 -}
96 -
97  void screen_SetBackDropFromFile(const char* filename)
98  {
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();
109  
110  struct OPENGL_DATA
111  {
112 diff --git a/src/init.cpp b/src/init.cpp
113 index aaf7003..3f42313 100644
114 --- a/src/init.cpp
115 +++ b/src/init.cpp
116 @@ -716,9 +716,6 @@ bool systemInitialise(void)
117         // Initialize the iVis text rendering module
118         iV_TextInit();
119  
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();
122 -
123         iV_Reset();                                                             // Reset the IV library.
124         readAIs();
125  
This page took 0.075892 seconds and 3 git commands to generate.