1
Window / Any analog to SDL's expose event?
« on: October 10, 2012, 07:21:31 pm »
My game library is implementing a display list structure to only refresh the screen (and specifically, the dirty rectangles) when things move.
For instance, in a tile-based 2D engine, if enemies are walking around, one won't have to do the (potentially, based on the speed of the underlying graphics implementation) expensive operation of redrawing the tile matrix every single frame. The display list will keep track of only the rectangles needing updating and rendering what's necessary.
The problem I'm having is that if I let my app do this, and for instance grab the window and move it offscreen and back, or if another window is dragged over my window, there is no event to let me know that due to something outside of the scope of my application, I need to redraw some or all of the window contents.
SDL has SDL_ExposeEvent, is there an analog for SFML?
EDIT: That page really showcases how lame SDL docs are in places The relevant part is:
For instance, in a tile-based 2D engine, if enemies are walking around, one won't have to do the (potentially, based on the speed of the underlying graphics implementation) expensive operation of redrawing the tile matrix every single frame. The display list will keep track of only the rectangles needing updating and rendering what's necessary.
The problem I'm having is that if I let my app do this, and for instance grab the window and move it offscreen and back, or if another window is dragged over my window, there is no event to let me know that due to something outside of the scope of my application, I need to redraw some or all of the window contents.
SDL has SDL_ExposeEvent, is there an analog for SFML?
EDIT: That page really showcases how lame SDL docs are in places The relevant part is:
Quote from: SDL docs
SDL_ExposeEvent is a member of the SDL_Event union and is used whan an event of type SDL_VIDEOEXPOSE is reported.
A VIDEOEXPOSE event is triggered when the screen has been modified outside of the application, usually by the window manager and needs to be redrawn.