1SDL_GL_GetProcAddress(3)       SDL API Reference      SDL_GL_GetProcAddress(3)
2
3
4

NAME

6       SDL_GL_GetProcAddress - Get the address of a GL function
7

SYNOPSIS

9       #include "SDL.h"
10
11       void *SDL_GL_GetProcAddress(const char* proc);
12

DESCRIPTION

14       Returns the address of the GL function proc, or NULL if the function is
15       not found. If the GL library is loaded at runtime, with  SDL_GL_LoadLi‐
16       brary,  then  all GL functions must be retrieved this way. Usually this
17       is used to retrieve function pointers to OpenGL extensions.
18

EXAMPLE

20       typedef void (*GL_ActiveTextureARB_Func)(unsigned int);
21       GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0;
22       int has_multitexture=1;
23       .
24       .
25       .
26       /* Get function pointer */
27       glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB");
28
29       /* Check for a valid function ptr */
30       if(!glActiveTextureARB_ptr){
31         fprintf(stderr, "Multitexture Extensions not present.
32       ");
33         has_multitexture=0;
34       }
35       .
36       .
37       .
38       .
39       if(has_multitexture){
40         glActiveTextureARB_ptr(GL_TEXTURE0_ARB);
41         .
42         .
43       }
44       else{
45         .
46         .
47       }
48

SEE ALSO

50       SDL_GL_LoadLibrary
51
52
53
54SDL                         Tue 11 Sep 2001, 23:01    SDL_GL_GetProcAddress(3)
Impressum