Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Window
»
Prevent window repaint
Print
Pages: [
1
]
Author
Topic: Prevent window repaint (Read 2116 times)
0 Members and 1 Guest are viewing this topic.
trishtren
Newbie
Posts: 1
Prevent window repaint
«
on:
May 14, 2011, 12:14:23 pm »
Hey, i just started using SFML from java 2d and im trying to convert some code over.
Im developing a small 2d map layout tool and i dont want the window to refresh itself as it only needs to when an object is moved or dragged etc. Mainly im looking to increase the performance by stopping it repainting every frame.
Does anyone know what function i could call to stop refreshing/repaint?
Logged
Fred_FS
Newbie
Posts: 48
Prevent window repaint
«
Reply #1 on:
May 14, 2011, 12:53:09 pm »
The usual way is to draw the scene again and again.
but if you don't want to, just don't call RenderWindow::Clear() and RenderWindow::Draw().
But you have to implement your own draw-function, which is only called if there is movement in your scene.
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Prevent window repaint
«
Reply #2 on:
May 14, 2011, 03:41:09 pm »
SFML is not made for this. If you want to do "static" drawing you should rather use a pure windowing library and override the paint event.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Window
»
Prevent window repaint
anything