I writing a OpenGL game using SFML.
I'm using the push/pop function to combine OpenGL with SFML like the tutorial SFML+OpenGL but, when I added textures to my model, the SFML text rendering appears broken and wrong rendered.
The simplified loop I used is:
while( true ){
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
mydraw();
window->pushGLStates();
window->draw( text );
window->popGLStates();
window->display();
}
Using this simple mydraw function causes the SFML text not drawing:
glUseProgram( myprogram );
glEnableVertexAttribArray( 0 );
glBindBuffer( GL_ARRAY_BUFFER, verts_buffer );
glVertexAttribPointer( 0, 3, GL_FLOAT, GL_FALSE, 0, nullptr );
If I commented out the mydraw call, the text is visible again.