Jump to content
  • Advertisement
Sign in to follow this  
ligh

Adding VBO's

This topic is 4665 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!