This is new wiki software and old wiki content. It's a work in progress!
Here's the explanation.
Be gentle, report bugs, leave feedback on pages, or just edit them yourself! Thanks!

SDL Wiki

SDL_GL_GetProcAddress

Get an OpenGL function by name.

Syntax

void* SDL_GL_GetProcAddress(const char *proc);

Function Parameters

proc

the name of an OpenGL function

Return Value

Returns a pointer to the named OpenGL function. The returned pointer should be cast to the appropriate function signature.

Remarks

If the GL library is loaded at runtime with SDL_GL_LoadLibrary(), then all GL functions must be retrieved this way. Usually this is used to retrieve function pointers to OpenGL extensions.

There are some quirks to looking up OpenGL functions that require some extra care from the application. If you code carefully, you can handle these quirks without any platform-specific code, though:

Code Examples

typedef void (APIENTRY * GL_ActiveTextureARB_Func)(unsigned int);
GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0;

/* Get function pointer */
glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB");

/* It was your responsibility to make sure this was a valid function to call! */
glActiveTextureARB_ptr(GL_TEXTURE0_ARB);
SDL_GL_ExtensionSupported
SDL_GL_LoadLibrary
SDL_GL_UnloadLibrary

CategoryAPI, CategoryVideo


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.