From 68c6add8ccd9aa32eb799a433aa8a3b05ec84a57 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Thu, 5 Jul 2007 12:23:54 +0000 Subject: (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model. --- src/video/win32_v.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/video/win32_v.cpp') diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index 7fa306ff3..a1a987565 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -751,8 +751,9 @@ static void FindResolutions() SortResolutions(_num_resolutions); } +static FVideoDriver_Win32 iFVideoDriver_Win32; -static const char *Win32GdiStart(const char * const *parm) +const char *VideoDriver_Win32::Start(const char * const *parm) { memset(&_wnd, 0, sizeof(_wnd)); @@ -774,7 +775,7 @@ static const char *Win32GdiStart(const char * const *parm) return NULL; } -static void Win32GdiStop() +void VideoDriver_Win32::Stop() { DeleteObject(_wnd.gdi_palette); DeleteObject(_wnd.dib_sect); @@ -786,7 +787,7 @@ static void Win32GdiStop() MyShowCursor(true); } -static void Win32GdiMakeDirty(int left, int top, int width, int height) +void VideoDriver_Win32::MakeDirty(int left, int top, int width, int height) { RECT r = { left, top, left + width, top + height }; @@ -800,7 +801,7 @@ static void CheckPaletteAnim() InvalidateRect(_wnd.main_wnd, NULL, FALSE); } -static void Win32GdiMainLoop() +void VideoDriver_Win32::MainLoop() { MSG mesg; uint32 cur_ticks = GetTickCount(); @@ -873,7 +874,7 @@ static void Win32GdiMainLoop() } } -static bool Win32GdiChangeRes(int w, int h) +bool VideoDriver_Win32::ChangeResolution(int w, int h) { _wnd.width = _wnd.width_org = w; _wnd.height = _wnd.height_org = h; @@ -883,16 +884,7 @@ static bool Win32GdiChangeRes(int w, int h) return true; } -static void Win32GdiFullScreen(bool full_screen) +void VideoDriver_Win32::ToggleFullscreen(bool full_screen) { MakeWindow(full_screen); } - -const HalVideoDriver _win32_video_driver = { - Win32GdiStart, - Win32GdiStop, - Win32GdiMakeDirty, - Win32GdiMainLoop, - Win32GdiChangeRes, - Win32GdiFullScreen, -}; -- cgit v1.2.3-54-g00ecf