Hi, I've recently noticed that I don't get much more than 1700fps when rendering to a window even if the rendering really does nothing. Here is the test program I've been using:
#include <GL/glew.h>
#include <SFML/System/Clock.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <cstdio>
int main() {
sf::ContextSettings cs(0, 0, 0, 3, 2); /* Request OpenGL 3.2 */
sf::Window *mainWindow = new sf::Window(sf::VideoMode(1200, 600, 32),
"SFML Test", sf::Style::Default, cs);
mainWindow->setVerticalSyncEnabled(false);
sf::Clock calcClock;
int frames = 0;
while(mainWindow->isOpen()) {
glClear( GL_COLOR_BUFFER_BIT );
mainWindow->display();
frames++;
if(frames >= 1000) {
int calcTicks = calcClock.getElapsedTime().asMilliseconds();
printf("FPS: %f Frames: %i Ticks: %i\n", frames/(calcTicks / 1000.0f),
frames, calcTicks);
frames = 0;
calcClock.restart();
}
}
return 0;
}
Any idea why I'm being limited to this? I can get things a bit faster if I fullscreen it, but I'm still not getting anything close to 10,000fps like I would expect when I'm doing so little. I'm not sure if this is because of overhead in SFML or something else. Anyone care to enlighten me?