why this triggers glGetError()?

Started by
5 comments, last by V-man 12 years, 11 months ago


// Vertex data
if ( vertex_buffer == NULL )
{
// Create vertex buffer
glGenBuffers(1, &vertex_buffer);
glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);

// Copy data
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_DYNAMIC_DRAW);

GLenum _error_check_value = glGetError();
if ( _error_check_value != GL_NO_ERROR )
{
ShowMessage("Quad::Load() Error! %s", gluErrorString(_error_check_value));
}
}


just by doing this I trigger an invalid enumerator error , why is this?
Advertisement
Which function is producing the error, and on which opengl version?
how can I check that?

ogl 40
nevermind this error is getting triggered way before this piece of code

but it would be useful to know how to pinpoint the function that is causing this log entry, currently Im just placing glgeterror() all over the place and I think this error is getting triggered in my SDL initialization
but it would be useful to know how to pinpoint the function that is causing this log entry, currently Im just placing glgeterror() all over the place and I think this error is getting triggered in my SDL initialization


There is a helpful extension - debug_output, but you'll need to upgrade your drivers to GL 4.1.


Define debug callback function, activate synchronous output and add a breakpoint inside callback function. Whenever an error occurs you'll have a function caused it in the call-stack.


[quote name='EvilNando' timestamp='1306780725' post='4817609']but it would be useful to know how to pinpoint the function that is causing this log entry, currently Im just placing glgeterror() all over the place and I think this error is getting triggered in my SDL initialization


There is a helpful extension - debug_output, but you'll need to upgrade your drivers to GL 4.1.


Define debug callback function, activate synchronous output and add a breakpoint inside callback function. Whenever an error occurs you'll have a function caused it in the call-stack.


[/quote]

thank you
http://www.opengl.org/wiki/Extension_Loading_Library

You might still get GL_INVALID_ENUM (depending on the version of GLEW you use), but at least GLEW ignores glGetString(GL_EXTENSIONS) and gets all function pointers.[/quote]
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);

This topic is closed to new replies.

Advertisement