Glew, Glext, and VBOs --SOLVED

Started by
1 comment, last by AverageJoeSSU 15 years, 8 months ago
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]

------------------------------

redwoodpixel.com

Advertisement
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
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
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.

------------------------------

redwoodpixel.com

This topic is closed to new replies.

Advertisement