Sign in to follow this  
Jacob Jingle

New Nvidia Driver = New OpenGL Errors

Recommended Posts

Jacob Jingle    226
Under Nvidia driver 275.33 this code works fine. Under the new drivers 280.26 and 280.28(international) both glVertexAttribPointer and glDrawArrays generate GL_INVALID_OPERATION. Are these errors because of a buggy driver or bad code and a new driver finally catching my mistakes?

[code]// Setup Code
GLuint m_vboID;
GLuint m_vaoID;

GLuint m_programID;
GLuint m_MVPMatrixID;
std::vector<GLfloat> m_vert;

m_vert.assign(6, 0.0f);
m_vert.at(1) = 100.0f;
m_vert.at(2) = 100.0f;
m_vert.at(3) = 100.0f;

glGenVertexArrays(1, &m_vaoID);
glBindVertexArray(m_vaoID);

glGenBuffers(1, &m_vboID);
glBindBuffer(GL_ARRAY_BUFFER, m_vboID);
glBufferData(GL_ARRAY_BUFFER, m_vert.size() * sizeof(std::vector<GLfloat>::size_type), &m_vert.front(), GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER,0);

// Draw Code
glBindBuffer(GL_ARRAY_BUFFER, m_vboID);
glEnableVertexAttribArray(0);
glVertexAttribPointer((GLuint)0, 2, GL_FLOAT, GL_FALSE, 0, 0);

HDC hDC = GetDC(m_hWnd);
//--------------------------------
glClear(GL_COLOR_BUFFER_BIT);
glDrawArrays(GL_TRIANGLES, 0, m_vert.size() / 2);
glDisableVertexAttribArray(0);
//--------------------------------
glFlush();
SwapBuffers(hDC);[/code]

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