Sign in to follow this  
EvilNando

why this triggers glGetError()?

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
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

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