• Advertisement
Sign in to follow this  

why this triggers glGetError()?

This topic is 2425 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[code]

// 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));
}
}
[/code]

just by doing this I trigger an invalid enumerator error , why is this?

Share this post


Link to post
Share on other sites
Advertisement
Which function is producing the error, and on which opengl version?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
[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[/quote]

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.

Share this post


Link to post
Share on other sites
[quote name='Aks9' timestamp='1306785752' post='4817637']
[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[/quote]

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

Share this post


Link to post
Share on other sites
http://www.opengl.org/wiki/Extension_Loading_Library

[quote]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]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement