Glew, Glext, and VBOs --SOLVED
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]
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 extensionsg_fVBOSupported = IsExtensionSupported( "GL_ARB_vertex_buffer_object" );if( g_fVBOSupported ){// Get Pointers To The GL FunctionsglGenBuffersARB = (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
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement