Sign in to follow this  

Adding VBO's

This topic is 4359 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im trying to add the vbo functions to my program. it works, but if i try to put it in a linked file i get all kinds of errors. (using vs 8) my first attempt i put typedef void (APIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); in a global.h which holds all my global variables and includes. then i put the definitions PFNGLGENBUFFERSARBPROC glGenBuffers = (PFNGLGENBUFFERSARBPROC) SDL_GL_GetProcAddress("glGenBuffersARB"); in globals.cpp but when i try to use them in another file eg cDrawable.cpp i include the globals.h but it says glBindBuffer identifier is not found. is there any way i can have thse functions as extern so they can be seen throught my whole program? one thing that did work, as i put the typedef's in globals.h, then in the cpp's that im using vbo's in i set the function pointer. it works but i have to change the function name for each file cuz i get redifined errors. thanks

Share this post


Link to post
Share on other sites
The typedef only defines the function. You also need to add an extern declaration in the header:

extern PFNGLBINDBUFFERARBPROC glGenBuffers;

The name is the same as the variable you then define and assign in your globals.cpp file.

Share this post


Link to post
Share on other sites

This topic is 4359 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this