Sign in to follow this  
dpadam450

VBO's, what lib/header needed?(Solved)

Recommended Posts

smitty1276    560
If you simply include the wglext.h header, though, you will have to use the wgl functions to load the extensions "manually". I imagine you could search on "wgl load extensions" to get a few samples, if you don't know how already.

Or you could use glew for a quick crossplatform version that doesn't require messing with function pointers.

Share this post


Link to post
Share on other sites
_neutrin0_    241
Quote:
Original post by dpadam450
Ok I have glew.h included. I keep getting linker errors.

My linker:
glew32.lib
glew32s.lib


wtf.


Including libs only will not solve your problem. The fact is (if you are using windows) the default opengl32.lib will export all OpenGL functions upto version 1.1. For all other extensions ( 1.1 and above and that includes VBO extensions) you will either have to use glext or GLee.

Both will work. I just prefer GLee thats all and also because it involves including just 2 files in your project. It provides a mechanism to test if a particular extension is supported. This allows my engine to use the extension if supported else fall back on something else. For example, if VBOs are not supported (by older hardware) the engine falls back on Vertex Arrays.

Share this post


Link to post
Share on other sites
_neutrin0_    241
Quote:
Original post by dpadam450
Identical functionality?

*tried it and im still getting weird linker errors

wglGetProcAddress
wglGetCurrentDC

these are popping up in my linker


Include opengl32.lib in your project.

Share this post


Link to post
Share on other sites
dpadam450    2357
Ok I'm just sayin F it to GLee cuz it is the same problem.

Right now I include everything, but when I call glGenBuffers() or any other extensions, i get a linker error saying it cannot find that function.

I have included <gl/glew.h> <gl/glut.h> in that order.

My linker

-glew32.lib

Share this post


Link to post
Share on other sites
_neutrin0_    241
Quote:
Original post by dpadam450
Ok I'm just sayin F it to GLee cuz it is the same problem.

Right now I include everything, but when I call glGenBuffers() or any other extensions, i get a linker error saying it cannot find that function.

I have included <gl/glew.h> <gl/glut.h> in that order.

My linker

-glew32.lib


That is because no lib including opengl32.lib glu32.lib glut32.lib (I don't know about glew32.lib) has glGenBuffers() function exported. For that function and other extension functions to work, you will have to dynamically load those functions. You can do this yourself by GetProcAddress() or wglGetProcAddress(), but the OpenGL specification has 100s of extensions. That means you will have to do the same thing 100s of times for each extension that you plan to use. GLee and glext do all this for you. That is all that they do. They are not libraries (.lib files). Since you are getting linker errors, you are most likely you are missing some other library like kernel32.lib or user32.lib or maybe there is some other problem besides the linker one.

Share this post


Link to post
Share on other sites
GamerSg    378
If it is a compile error, your glext.h is outdated and does not have the function defined.
If it is a linker error, you are not including opengl32.lib.

Do not blame the libraries if you are not setting up your project correctly. I dont know if glext.h is provided by Glew or GLee, if it is make sure you are using the one they provide. Better still overwrite the older glext.h with the ones these libraries provide.

Share this post


Link to post
Share on other sites
smitty1276    560
Glew or GLee will load any or all extensions you need.

You have to include glew.h first.

You have to call glewInit() before using any extensions... this initializes function pointers for the extensions (I think... never really looked).

You have to link to glew32.lib (or glew32d.lib if you want debug stuff). You also need to link to glut32.lib and the GL libs (glut.h, however, has a few pragmas that should link to it in VS).

And I think that glew DOES have all of the extensions defined in glew.h, so you probably don't need glext.h, but it can't hurt to have it.

EDIT: Sorry, just saw the "Solved" tag on the topic title. What did you do to get it working, out of curiosity?

Share this post


Link to post
Share on other sites

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