SFML community forums
Help => Graphics => Topic started by: troopson on July 17, 2011, 10:24:32 pm
-
I wrote that code.
sf::RenderWindow w(sf::VideoMode(800,600,32),"a");
w.Clear(sf::Color(255,0,0));
w.SetFramerateLimit(100);
while(true){
w.Display();
cout<<"after disp: "<<endl;
sf::Sleep(1.0f);
}
On my PC everything works fine.
On my Notebook window once displays the red screen(good) and once the OLD BUFFER(which is totally mess). I really need help with that. I can't redraw everything each frame(the program is kinda bigger but its the minimal code).
-
SFML is double buffered, and you cleared only one buffer so it's normal that you see the other (uncleared) buffer every two Display().
You must redraw everything every frame. That's how SFML works.
-
Nooooooooooooooooooooooooo......
I need to draw many,many lines. The solution is OpenGL or sfml 2.0 with drawing to an image, right?
-
Before you make your life more complicated than necessary, you should test if the normal draw approach is really too slow. Test in Release mode with enabled optimizations.
-
Before you make your life more complicated than necessary, you should test if the normal draw approach is really too slow. Test in Release mode with enabled optimizations.
i think 1000+ glbegin() per frame is extremally slow.
I used glOrtho, and then drawing with glBegin(GL_LINES)