Thanks for the reply.
Is this OK? Any ideas?
It still DOES NOT rotate when the three SFML lines exist, but DOES when they are commented out.
EDIT:When I use a texture mapped 3D model, the model stays still but the texture rotates in strange ways. As usual, when I get rid of the SFML code all is OK.
int main()
{
sf::RenderWindow window(sf::VideoMode(640, 480), "Test-Project", sf::Style::Default, sf::ContextSettings(32));
window.setVerticalSyncEnabled(true);
window.setKeyRepeatEnabled(true);
sf::Font font;
font.loadFromFile("C:\\WINDOWS\\Fonts\\arial.ttf");
sf::Text text;
text.setFont(font);
text.setCharacterSize(30);
text.setStyle(sf::Text::Bold);
text.setColor(sf::Color::Red);
vector3D screenSize(640.0f,480.0f);
float clip_near = 0.1f, clip_far = 100.0f;
glViewport(0, 0, (GLsizei) screenSize.x, (GLsizei) screenSize.y);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective( 75.0f, screenSize.x / screenSize.y, clip_near, clip_far);
glMatrixMode(GL_MODELVIEW);
float sceneRotation = 0.0f; // degrees
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
glClearColor(0.5f,0.5f,0.5f,1.0f);
glClearDepth(1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glColor3f(1.0f,0.0f,0.0f);
glTranslatef(0.0f,0.0f,-4.0f);
sceneRotation += 3;
glRotatef(sceneRotation,0.0f,1.0f,0.0f);
if (sceneRotation > 360)
sceneRotation = 0;
float radius = 1.0f;
glLineWidth(3.0f);
glBegin(GL_LINES);
glVertex3f(-radius,-radius,-radius);
glVertex3f(radius,-radius,-radius);
glVertex3f(radius,radius,-radius);
glVertex3f(-radius,radius,-radius);
glVertex3f(-radius,-radius,radius);
glVertex3f(radius,-radius,radius);
glVertex3f(radius,radius,radius);
glVertex3f(-radius,radius,radius);
glVertex3f(-radius,-radius,radius);
glVertex3f(-radius,-radius,-radius);
glVertex3f(-radius,radius,-radius);
glVertex3f(-radius,radius,radius);
glVertex3f(-radius,-radius,-radius);
glVertex3f(-radius,-radius,radius);
glVertex3f(-radius,radius,radius);
glVertex3f(-radius,radius,-radius);
glVertex3f(-radius,-radius,-radius);
glVertex3f(-radius,radius,-radius);
glVertex3f(radius,-radius,-radius);
glVertex3f(radius,radius,-radius);
glVertex3f(radius,-radius,radius);
glVertex3f(radius,radius,radius);
glVertex3f(-radius,-radius,radius);
glVertex3f(-radius,radius,radius);
glEnd();
// Start of problem lines
window.pushGLStates();
window.draw(text);
window.popGLStates();
// End of problem lines.
window.display();
}
return 0;
}