Hi,
so we changed it from RenderWindow to Window, but unfortunately without any improvment.
Maybe someone can name us here a good profiler, because we tried gDebugger but couldn't get really along with it.
We are both using XP because we knew there would be trouble with vista and OpenGL drivers, etc...
here is the init part:
sf::Window App(sf::VideoMode(800, 600, 32), "SFML OpenGL", sf::Style::Fullscreen);
// Enable Z-buffer read and write
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glClearDepth(1.f);
glClearColor(0.f, 0.f, 0.f, 0.f);
// Setup a perspective projection
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90.f, 1.f, 1.f, 500.f);
glColor4f(1.f, 1.f, 1.f, 1.f);
and the while loop:
while (App.IsOpened())
{
if(cullFaceActive)
glEnable(GL_CULL_FACE);
else
glDisable(GL_CULL_FACE);
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();
if ((Event.Type == sf::Event::KeyPressed) ) {
switch(Event.Key.Code){
case sf::Key::F2:
displayListActive = !displayListActive;
if(displayListActive)
printf("DRAW with DisplayList: TRUE \n");
else
printf("DRAW with DisplayList: FALSE \n");
break;
case sf::Key::Escape:
App.Close();
break;
default:
break;
}
}
}
// Clear depth buffer
glClear(GL_COLOR_BUFFER_BIT |GL_DEPTH_BUFFER_BIT);
// Apply some transformations
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
if (drawActive) {
actualGameTime = (float)timeClass->getElapsedGameTime();
glTranslatef(0.f, 0.f, -200.f);
glRotatef(actualGameTime * 50, 1.f, 0.f, 0.f);
glRotatef(actualGameTime * 30, 0.f, 1.f, 0.f);
glRotatef(actualGameTime * 90, 0.f, 0.f, 1.f);
draw();
}
// Finally, display the rendered frame on screen
App.Display();
fps = (float)timeClass->getFPS(&avgFPS, &avgCounter);
}
-tno