Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define glGenBuffers ((PFNGLGENBUFFERSPROC)(glFP[0]))
- #define glBindBuffer ((PFNGLBINDBUFFERPROC)(glFP[1]))
- #define glBufferData ((PFNGLBUFFERDATAPROC)(glFP[2]))
- #define glCreateShader ((PFNGLCREATESHADERPROC)(glFP[3]))
- #define glShaderSource ((PFNGLSHADERSOURCEPROC)(glFP[4]))
- #define glCompileShader ((PFNGLCOMPILESHADERPROC)(glFP[5]))
- #define glAttachShader ((PFNGLATTACHSHADERPROC)(glFP[6]))
- #define glLinkProgram ((PFNGLLINKPROGRAMPROC)(glFP[7]))
- #define glUseProgram ((PFNGLUSEPROGRAMPROC)(glFP[8]))
- #define glCreateProgram ((PFNGLCREATEPROGRAMPROC)(glFP[9]))
- typedef void (*GenFP)(void); // any function ptr type would do
- GenFP glFP[10];
- const char* glnames[]={
- "glGenBuffers","glBindBuffer", "glBufferData",
- "glCreateShader","glShaderSource","glCompileShader",
- "glAttachShader","glLinkProgram","glUseProgram","glCreateProgram"
- };
- void create_ext() {
- int i;
- for (i=0; i<10; i++) glFP[i] = (GenFP)wglGetProcAddress(glnames[i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement