Changeset - r19042:abe79fea164a
[Not reviewed]
master
0 1 0
matthijs - 12 years ago 2012-02-07 10:27:48
matthijs@openttd.org
(svn r23910) -Fix: [SDL] Handle the SDL_VIDEOEXPOSE event.
- It seems this event is never triggered when using 1.2 (it has some
autorefresh feature which seems to have been removed in 1.3), but in theory
this event could also trigger on 1.2.
- Note that this fixes redraw issues when compiling against SDL 1.3, but it
still uses the "compatibility" rendering API using SDL_SetVideoMode and
SDL_UpdateRects. Eventually (when 1.3 is stable and released as 2.0), this
should probably be rewritting to use the new Windows and Renderers
available in SDL 1.3.
1 file changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/video/sdl_v.cpp
Show inline comments
 
@@ -473,6 +473,13 @@ static int PollEvent()
 
			CreateMainSurface(w, h);
 
			break;
 
		}
 
		case SDL_VIDEOEXPOSE: {
 
			/* Force a redraw of the entire screen. Note
 
			 * that SDL 1.2 seems to do this automatically
 
			 * in most cases, but 1.3 / 2.0 does not. */
 
		        _num_dirty_rects = MAX_DIRTY_RECTS + 1;
 
			break;
 
		}
 
	}
 
	return -1;
 
}
0 comments (0 inline, 0 general)