Skip to main content
GameDev.net gamedev.net
🔒 Locked

Class doesnt know GLEW function

Started by DaysShadow Aug 13, 2011 at 12:18 PM 1 replies 650+ views
Original Post
DaysShadow
DaysShadow
Hi,

i have a problem with loaded glew functions.
I had been trying some vbo code in main function only, i had loaded functions like glBindBuffer there aswell.
Now i wanted to use those functions in a included class but the class doesnt know them.

It's like:

// Include stuff

main function
{
initializing
load glew functions like glBindBuffer, glGenBuffers and so on
create renderwindow
call class method using glGenBuffers -> crash caused by glGenBuffers being NULL, why?
}


I load those functions like this: PFNGLGENBUFFERSPROC glGenBuffers = (PFNGLGENBUFFERSPROC) glfwGetProcAddress("glGenBuffers");

Now i dont know why the class can't call the function although it is loaded, i used those function before directly in main function for trying.

What is my fault?

Thanks!
Brother Bob
Brother Bob
You must load the functions after creating the rendering context.
DaysShadow
DaysShadow
Yea thanks...now it works.

Why must it always be a that simple thing i have to ask for

Many thanks, now i can go on...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.