Sign in to follow this  
AverageJoeSSU

Glew, Glext, and VBOs --SOLVED

Recommended Posts

Ok so.... my lighting model uses Glew and my friends terrain engine uses VBOs and glext.... i am merging our code and am having a bit of trouble merging... he is doing this.... //initialize VBO extensions g_fVBOSupported = IsExtensionSupported( "GL_ARB_vertex_buffer_object" ); if( g_fVBOSupported ) { // Get Pointers To The GL Functions glGenBuffersARB = (PFNGLGENBUFFERSARBPROC) wglGetProcAddress("glGenBuffersARB"); glBindBufferARB = (PFNGLBINDBUFFERARBPROC) wglGetProcAddress("glBindBufferARB"); glBufferDataARB = (PFNGLBUFFERDATAARBPROC) wglGetProcAddress("glBufferDataARB"); glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC) wglGetProcAddress("glDeleteBuffersARB"); } and i am calling init glew right before like this...... if (glewInit() != GLEW_OK) { cout << "error initializing glew" << endl; } //initialize VBO extensions g_fVBOSupported = IsExtensionSupported( "GL_ARB_vertex_buffer_object" ); if( g_fVBOSupported ) { // Get Pointers To The GL Functions glGenBuffersARB = (PFNGLGENBUFFERSARBPROC) wglGetProcAddress("glGenBuffersARB"); glBindBufferARB = (PFNGLBINDBUFFERARBPROC) wglGetProcAddress("glBindBufferARB"); glBufferDataARB = (PFNGLBUFFERDATAARBPROC) wglGetProcAddress("glBufferDataARB"); glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC) wglGetProcAddress("glDeleteBuffersARB"); } im getting these compiler warnings.... warning C4273: '__glewGenBuffersARB' : inconsistent dll linkage 1> c:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\glew.h(9506) : see previous definition of '__glewGenBuffersARB' etc.... i think i know what they mean... that glew already defines those functions... but i dont know what i need to do about it... any help? cheers! [Edited by - AverageJoeSSU on August 18, 2008 6:22:20 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by AverageJoeSSU
i think i know what they mean... that glew already defines those functions... but i dont know what i need to do about it... any help? cheers!


Yes, glew defines them. You delete your own function pointer code.


//initialize VBO extensions
g_fVBOSupported = IsExtensionSupported( "GL_ARB_vertex_buffer_object" );
if( g_fVBOSupported )
{
// Get Pointers To The GL Functions
glGenBuffersARB = (PFNGLGENBUFFERSARBPROC) wglGetProcAddress("glGenBuffersARB");
glBindBufferARB = (PFNGLBINDBUFFERARBPROC) wglGetProcAddress("glBindBufferARB");
glBufferDataARB = (PFNGLBUFFERDATAARBPROC) wglGetProcAddress("glBufferDataARB");
glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC) wglGetProcAddress("glDeleteBuffersARB");
}



I also recommend that you move over to using core functions like glGenBuffers, glBindBuffer, etc. and make sure GL version is 1.5

Share this post


Link to post
Share on other sites
Thanks, Thats exactly what was wrong.....

Actually... when i moved to glew and used the glgenbuffersARB or whatev... it didnt work at all... just errored out.

But when i changed it to the regular glgenbuffers it worked like a charm...

I'll throw up some screenshots in a month of so of this engine... my team is merging our versions together as we just got CVS last week and have been working on the project for over 6 months now.

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