1
Graphics / Drawing with resetGLstates
« on: September 30, 2014, 05:48:51 am »
I'm using in my project SFGUI. And for drawing I'm using following code:
glDrawArrays(GL_POINTS, 0, 2); - is drawed nothing
Why? What can I do for correct it?
void render()
{
glDisableClientState(GL_COLOR_ARRAY);
m_rWindow->pushGLStates();
glTranslatef(m_pos.x, m_pos.y, 0.0f);
glPointSize(1.0f);
glColor3f(0.7f, 0.7f, 1.0f);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
float vertData[] = {20.0f, 20.0f, 50.0f, 50.0f };
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, vertData);
glDrawArrays(GL_POINTS, 0, 2);
glDisableClientState(GL_VERTEX_ARRAY);
m_rWindow->popGLStates();
m_rWindow->resetGLStates();
m_sfgui.Display(*m_rWindow);
}
{
glDisableClientState(GL_COLOR_ARRAY);
m_rWindow->pushGLStates();
glTranslatef(m_pos.x, m_pos.y, 0.0f);
glPointSize(1.0f);
glColor3f(0.7f, 0.7f, 1.0f);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
float vertData[] = {20.0f, 20.0f, 50.0f, 50.0f };
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, vertData);
glDrawArrays(GL_POINTS, 0, 2);
glDisableClientState(GL_VERTEX_ARRAY);
m_rWindow->popGLStates();
m_rWindow->resetGLStates();
m_sfgui.Display(*m_rWindow);
}
glDrawArrays(GL_POINTS, 0, 2); - is drawed nothing
Why? What can I do for correct it?