MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / opengl_GetDLLFunctions

Function opengl_GetDLLFunctions

renderer/HardwareOpenGL.cpp:189–227  ·  view source on GitHub ↗

Sets up multi-texturing using ARB extensions

Source from the content-addressed store, hash-verified

187
188// Sets up multi-texturing using ARB extensions
189void opengl_GetDLLFunctions(void) {
190#if defined(WIN32)
191 oglActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)dwglGetProcAddress("glActiveTextureARB");
192 if (!oglActiveTextureARB)
193 goto dll_error;
194
195 oglClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)dwglGetProcAddress("glClientActiveTextureARB");
196 if (!oglClientActiveTextureARB)
197 goto dll_error;
198
199 oglMultiTexCoord4f = (PFNGLMULTITEXCOORD4FARBPROC)dwglGetProcAddress("glMultiTexCoord4f");
200 if (!oglMultiTexCoord4f)
201 goto dll_error;
202#else
203#define mod_GetSymbol(x, funcStr, y) __SDL_mod_GetSymbol(funcStr)
204
205 oglActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)mod_GetSymbol(OpenGLDLLHandle, "glActiveTextureARB", 255);
206 oglClientActiveTextureARB =
207 (PFNGLCLIENTACTIVETEXTUREARBPROC)mod_GetSymbol(OpenGLDLLHandle, "glClientActiveTextureARB", 255);
208 oglMultiTexCoord4f = (PFNGLMULTITEXCOORD4FARBPROC)mod_GetSymbol(OpenGLDLLHandle, "glMultiTexCoord4f", 255);
209 if (!oglMultiTexCoord4f) {
210 oglMultiTexCoord4f = (PFNGLMULTITEXCOORD4FARBPROC)mod_GetSymbol(OpenGLDLLHandle, "glMultiTexCoord4fARB", 255);
211 }
212 if (oglActiveTextureARB == NULL || oglClientActiveTextureARB == NULL || oglMultiTexCoord4f == NULL) {
213 goto dll_error;
214 }
215
216#undef mod_GetSymbol
217#endif
218
219 UseMultitexture = true;
220 return;
221
222dll_error:
223 oglActiveTextureARB = NULL;
224 oglClientActiveTextureARB = NULL;
225 oglMultiTexCoord4f = NULL;
226 UseMultitexture = false;
227}
228
229// returns true if the passed in extension name is supported
230bool opengl_CheckExtension(const char *extName) {

Callers 1

opengl_InitFunction · 0.70

Calls 1

mod_GetSymbolFunction · 0.85

Tested by

no test coverage detected