why this code cause glerror invalid enumerant?

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

this causes an invalid enumerant error code why?

Who’s to say that any of that code caused the error? It could have been caused by any code before this. OpenGL retains errors until you glGetError them.

Does vertex_buffer a pointer?
If it is, you are trying to write a value in a NULL pointer, which can generate this error. BTW, if vertex_buffer is a pointer, how glGenBuffers do not generate any compiler errors?

yes you are correct

the error is being caused at the SDL initialization, sadly since that code isnt mine I really have no idea whats going on

It could be SDL or Glew init routines :S

Cross-posting is easy to control inside a single forum, but it is much harder across several different sites. :slight_smile:

As I’ve already said, debug_output is so far the best solution to locate the problem.

the error is being caused at the SDL initialization, sadly since that code isnt mine I really have no idea whats going on

Just ignore it. Call glGetError after SDL initialization until it comes up with GL_NO_ERROR.