Further progress on the new Windows video driver: SDL-1.3
authorSam Lantinga <slouken@libsdl.org>
Tue, 27 Jun 2006 07:46:36 +0000
branchSDL-1.3
changeset 1718ed4d4f1ea201
parent 1717 e3637569ab86
child 1719 5b9f50c957ed
Further progress on the new Windows video driver:
* SDL_SetModuleHandle() is obsolete, I hope.
* SDL 1.3 uses the UNICODE API
* I'm ignoring Windows CE for the moment, we'll reevaluate what needs to be different for Windows CE later.
* Pulled the stdio redirection from WinMain()
include/SDL_compat.h
include/SDL_main.h
src/SDL.c
src/main/win32/SDL_win32_main.c
src/video/win32/SDL_win32events.c
src/video/win32/SDL_win32events.h
src/video/win32/SDL_win32video.c
src/video/win32/SDL_win32video.h
src/video/win32/SDL_win32window.c
src/video/win32/SDL_win32window.h
     1.1 --- a/include/SDL_compat.h	Tue Jun 27 04:59:10 2006 +0000
     1.2 +++ b/include/SDL_compat.h	Tue Jun 27 07:46:36 2006 +0000
     1.3 @@ -117,6 +117,7 @@
     1.4  
     1.5  struct SDL_SysWMinfo;
     1.6  
     1.7 +#define SDL_SetModuleHandle(x)
     1.8  #define SDL_AllocSurface    SDL_CreateRGBSurface
     1.9  
    1.10  extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version(void);
     2.1 --- a/include/SDL_main.h	Tue Jun 27 04:59:10 2006 +0000
     2.2 +++ b/include/SDL_main.h	Tue Jun 27 07:46:36 2006 +0000
     2.3 @@ -63,13 +63,11 @@
     2.4  /* *INDENT-ON* */
     2.5  #endif
     2.6  
     2.7 -/* This should be called from your WinMain() function, if any */
     2.8 -extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
     2.9 -/* This can also be called, but is no longer necessary */
    2.10 +/* This can be called to set the application class at startup */
    2.11  extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
    2.12                                              void *hInst);
    2.13 -/* This can also be called, but is no longer necessary (SDL_Quit calls it) */
    2.14  extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
    2.15 +
    2.16  #ifdef __cplusplus
    2.17  /* *INDENT-OFF* */
    2.18  }
     3.1 --- a/src/SDL.c	Tue Jun 27 04:59:10 2006 +0000
     3.2 +++ b/src/SDL.c	Tue Jun 27 07:46:36 2006 +0000
     3.3 @@ -348,12 +348,6 @@
     3.4  }
     3.5  #endif /* building DLL with Watcom C */
     3.6  
     3.7 -void
     3.8 -SDL_SetModuleHandle(void *hInst)
     3.9 -{
    3.10 -    /* FIXME: Do we still need this? */
    3.11 -}
    3.12 -
    3.13  #endif /* OS/2 elif __WIN32__ */
    3.14  
    3.15  /* vi: set ts=4 sw=4 expandtab: */
     4.1 --- a/src/main/win32/SDL_win32_main.c	Tue Jun 27 04:59:10 2006 +0000
     4.2 +++ b/src/main/win32/SDL_win32_main.c	Tue Jun 27 07:46:36 2006 +0000
     4.3 @@ -10,20 +10,6 @@
     4.4  #define WIN32_LEAN_AND_MEAN
     4.5  #include <windows.h>
     4.6  
     4.7 -#ifdef _WIN32_WCE
     4.8 -# define DIR_SEPERATOR TEXT("\\")
     4.9 -# undef _getcwd
    4.10 -# define _getcwd(str,len)	wcscpy(str,TEXT(""))
    4.11 -# define setbuf(f,b)
    4.12 -# define setvbuf(w,x,y,z)
    4.13 -# define fopen		_wfopen
    4.14 -# define freopen	_wfreopen
    4.15 -# define remove(x)	DeleteFile(x)
    4.16 -#else
    4.17 -# define DIR_SEPERATOR TEXT("/")
    4.18 -# include <direct.h>
    4.19 -#endif
    4.20 -
    4.21  /* Include the SDL main definition header */
    4.22  #include "SDL.h"
    4.23  #include "SDL_main.h"
    4.24 @@ -34,20 +20,6 @@
    4.25  # endif /* _WIN32_WCE_EMULATION */
    4.26  #endif /* main */
    4.27  
    4.28 -/* The standard output files */
    4.29 -#define STDOUT_FILE	TEXT("stdout.txt")
    4.30 -#define STDERR_FILE	TEXT("stderr.txt")
    4.31 -
    4.32 -#ifndef NO_STDIO_REDIRECT
    4.33 -# ifdef _WIN32_WCE
    4.34 -static wchar_t stdoutPath[MAX_PATH];
    4.35 -static wchar_t stderrPath[MAX_PATH];
    4.36 -# else
    4.37 -static char stdoutPath[MAX_PATH];
    4.38 -static char stderrPath[MAX_PATH];
    4.39 -# endif
    4.40 -#endif
    4.41 -
    4.42  #if defined(_WIN32_WCE) && _WIN32_WCE < 300
    4.43  /* seems to be undefined in Win CE although in online help */
    4.44  #define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t'))
    4.45 @@ -124,52 +96,6 @@
    4.46      return FALSE;
    4.47  }
    4.48  
    4.49 -/* SDL_Quit() shouldn't be used with atexit() directly because
    4.50 -   calling conventions may differ... */
    4.51 -static void
    4.52 -cleanup(void)
    4.53 -{
    4.54 -    SDL_Quit();
    4.55 -}
    4.56 -
    4.57 -/* Remove the output files if there was no output written */
    4.58 -static void
    4.59 -cleanup_output(void)
    4.60 -{
    4.61 -#ifndef NO_STDIO_REDIRECT
    4.62 -    FILE *file;
    4.63 -    int empty;
    4.64 -#endif
    4.65 -
    4.66 -    /* Flush the output in case anything is queued */
    4.67 -    fclose(stdout);
    4.68 -    fclose(stderr);
    4.69 -
    4.70 -#ifndef NO_STDIO_REDIRECT
    4.71 -    /* See if the files have any output in them */
    4.72 -    if (stdoutPath[0]) {
    4.73 -        file = fopen(stdoutPath, TEXT("rb"));
    4.74 -        if (file) {
    4.75 -            empty = (fgetc(file) == EOF) ? 1 : 0;
    4.76 -            fclose(file);
    4.77 -            if (empty) {
    4.78 -                remove(stdoutPath);
    4.79 -            }
    4.80 -        }
    4.81 -    }
    4.82 -    if (stderrPath[0]) {
    4.83 -        file = fopen(stderrPath, TEXT("rb"));
    4.84 -        if (file) {
    4.85 -            empty = (fgetc(file) == EOF) ? 1 : 0;
    4.86 -            fclose(file);
    4.87 -            if (empty) {
    4.88 -                remove(stderrPath);
    4.89 -            }
    4.90 -        }
    4.91 -    }
    4.92 -#endif
    4.93 -}
    4.94 -
    4.95  #if defined(_MSC_VER) && !defined(_WIN32_WCE)
    4.96  /* The VC++ compiler needs main defined */
    4.97  #define console_main main
    4.98 @@ -179,45 +105,8 @@
    4.99  int
   4.100  console_main(int argc, char *argv[])
   4.101  {
   4.102 -    size_t n;
   4.103 -    char *bufp, *appname;
   4.104      int status;
   4.105  
   4.106 -    /* Get the class name from argv[0] */
   4.107 -    appname = argv[0];
   4.108 -    if ((bufp = SDL_strrchr(argv[0], '\\')) != NULL) {
   4.109 -        appname = bufp + 1;
   4.110 -    } else if ((bufp = SDL_strrchr(argv[0], '/')) != NULL) {
   4.111 -        appname = bufp + 1;
   4.112 -    }
   4.113 -
   4.114 -    if ((bufp = SDL_strrchr(appname, '.')) == NULL)
   4.115 -        n = SDL_strlen(appname);
   4.116 -    else
   4.117 -        n = (bufp - appname);
   4.118 -
   4.119 -    bufp = SDL_stack_alloc(char, n + 1);
   4.120 -    if (bufp == NULL) {
   4.121 -        return OutOfMemory();
   4.122 -    }
   4.123 -    SDL_strlcpy(bufp, appname, n + 1);
   4.124 -    appname = bufp;
   4.125 -
   4.126 -    /* Load SDL dynamic link library */
   4.127 -    if (SDL_Init(SDL_INIT_NOPARACHUTE) < 0) {
   4.128 -        ShowError("WinMain() error", SDL_GetError());
   4.129 -        return (FALSE);
   4.130 -    }
   4.131 -    atexit(cleanup_output);
   4.132 -    atexit(cleanup);
   4.133 -
   4.134 -    /* Sam:
   4.135 -       We still need to pass in the application handle so that
   4.136 -       DirectInput will initialize properly when SDL_RegisterApp()
   4.137 -       is called later in the video initialization.
   4.138 -     */
   4.139 -    SDL_SetModuleHandle(GetModuleHandle(NULL));
   4.140 -
   4.141      /* Run the application main() code */
   4.142      status = SDL_main(argc, argv);
   4.143  
   4.144 @@ -229,24 +118,12 @@
   4.145  }
   4.146  
   4.147  /* This is where execution begins [windowed apps] */
   4.148 -#ifdef _WIN32_WCE
   4.149  int WINAPI
   4.150 -WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR szCmdLine, int sw)
   4.151 -#else
   4.152 -int WINAPI
   4.153 -WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
   4.154 -#endif
   4.155 +WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int sw)
   4.156  {
   4.157 -    HINSTANCE handle;
   4.158      char **argv;
   4.159      int argc;
   4.160      char *cmdline;
   4.161 -    DWORD pathlen;
   4.162 -#ifdef _WIN32_WCE
   4.163 -    wchar_t path[MAX_PATH];
   4.164 -#else
   4.165 -    char path[MAX_PATH];
   4.166 -#endif
   4.167  #ifdef _WIN32_WCE
   4.168      wchar_t *bufp;
   4.169      int nLen;
   4.170 @@ -254,76 +131,6 @@
   4.171      char *bufp;
   4.172      size_t nLen;
   4.173  #endif
   4.174 -#ifndef NO_STDIO_REDIRECT
   4.175 -    FILE *newfp;
   4.176 -#endif
   4.177 -
   4.178 -    /* Start up DDHELP.EXE before opening any files, so DDHELP doesn't
   4.179 -       keep them open.  This is a hack.. hopefully it will be fixed 
   4.180 -       someday.  DDHELP.EXE starts up the first time DDRAW.DLL is loaded.
   4.181 -     */
   4.182 -    handle = LoadLibrary(TEXT("DDRAW.DLL"));
   4.183 -    if (handle != NULL) {
   4.184 -        FreeLibrary(handle);
   4.185 -    }
   4.186 -#ifndef NO_STDIO_REDIRECT
   4.187 -    pathlen = GetModuleFileName(NULL, path, SDL_arraysize(path));
   4.188 -    while (pathlen > 0 && path[pathlen] != '\\') {
   4.189 -        --pathlen;
   4.190 -    }
   4.191 -    path[pathlen] = '\0';
   4.192 -
   4.193 -#ifdef _WIN32_WCE
   4.194 -    wcsncpy(stdoutPath, path, SDL_arraysize(stdoutPath));
   4.195 -    wcsncat(stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath));
   4.196 -#else
   4.197 -    SDL_strlcpy(stdoutPath, path, SDL_arraysize(stdoutPath));
   4.198 -    SDL_strlcat(stdoutPath, DIR_SEPERATOR STDOUT_FILE,
   4.199 -                SDL_arraysize(stdoutPath));
   4.200 -#endif
   4.201 -
   4.202 -    /* Redirect standard input and standard output */
   4.203 -    newfp = freopen(stdoutPath, TEXT("w"), stdout);
   4.204 -
   4.205 -#ifndef _WIN32_WCE
   4.206 -    if (newfp == NULL) {        /* This happens on NT */
   4.207 -#if !defined(stdout)
   4.208 -        stdout = fopen(stdoutPath, TEXT("w"));
   4.209 -#else
   4.210 -        newfp = fopen(stdoutPath, TEXT("w"));
   4.211 -        if (newfp) {
   4.212 -            *stdout = *newfp;
   4.213 -        }
   4.214 -#endif
   4.215 -    }
   4.216 -#endif /* _WIN32_WCE */
   4.217 -
   4.218 -#ifdef _WIN32_WCE
   4.219 -    wcsncpy(stderrPath, path, SDL_arraysize(stdoutPath));
   4.220 -    wcsncat(stderrPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath));
   4.221 -#else
   4.222 -    SDL_strlcpy(stderrPath, path, SDL_arraysize(stderrPath));
   4.223 -    SDL_strlcat(stderrPath, DIR_SEPERATOR STDERR_FILE,
   4.224 -                SDL_arraysize(stderrPath));
   4.225 -#endif
   4.226 -
   4.227 -    newfp = freopen(stderrPath, TEXT("w"), stderr);
   4.228 -#ifndef _WIN32_WCE
   4.229 -    if (newfp == NULL) {        /* This happens on NT */
   4.230 -#if !defined(stderr)
   4.231 -        stderr = fopen(stderrPath, TEXT("w"));
   4.232 -#else
   4.233 -        newfp = fopen(stderrPath, TEXT("w"));
   4.234 -        if (newfp) {
   4.235 -            *stderr = *newfp;
   4.236 -        }
   4.237 -#endif
   4.238 -    }
   4.239 -#endif /* _WIN32_WCE */
   4.240 -
   4.241 -    setvbuf(stdout, NULL, _IOLBF, BUFSIZ);      /* Line buffered */
   4.242 -    setbuf(stderr, NULL);       /* No buffering */
   4.243 -#endif /* !NO_STDIO_REDIRECT */
   4.244  
   4.245  #ifdef _WIN32_WCE
   4.246      nLen = wcslen(szCmdLine) + 128 + 1;
   4.247 @@ -357,7 +164,7 @@
   4.248      }
   4.249      ParseCommandLine(cmdline, argv);
   4.250  
   4.251 -    /* Run the main program (after a little SDL initialization) */
   4.252 +    /* Run the main program */
   4.253      console_main(argc, argv);
   4.254  
   4.255      /* Hush little compiler, don't you cry... */
     5.1 --- a/src/video/win32/SDL_win32events.c	Tue Jun 27 04:59:10 2006 +0000
     5.2 +++ b/src/video/win32/SDL_win32events.c	Tue Jun 27 07:46:36 2006 +0000
     5.3 @@ -23,9 +23,91 @@
     5.4  
     5.5  #include "SDL_win32video.h"
     5.6  
     5.7 +
     5.8 +static LRESULT CALLBACK
     5.9 +WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    5.10 +{
    5.11 +    return CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam);
    5.12 +}
    5.13 +
    5.14  void
    5.15 -WIN32_PumpEvents(_THIS)
    5.16 +WIN_PumpEvents(_THIS)
    5.17  {
    5.18 +    MSG msg;
    5.19 +    while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
    5.20 +        TranslateMessage(&msg);
    5.21 +        DispatchMessage(&msg);
    5.22 +    }
    5.23 +}
    5.24 +
    5.25 +static int app_registered = 0;
    5.26 +LPTSTR SDL_Appname = NULL;
    5.27 +Uint32 SDL_Appstyle = 0;
    5.28 +HINSTANCE SDL_Instance = NULL;
    5.29 +
    5.30 +/* Register the class for this application */
    5.31 +int
    5.32 +SDL_RegisterApp(char *name, Uint32 style, void *hInst)
    5.33 +{
    5.34 +    WNDCLASS class;
    5.35 +
    5.36 +    /* Only do this once... */
    5.37 +    if (app_registered) {
    5.38 +        ++app_registered;
    5.39 +        return (0);
    5.40 +    }
    5.41 +    if (!name && !SDL_Appname) {
    5.42 +        name = "SDL_app";
    5.43 +        SDL_Appstyle = (CS_BYTEALIGNCLIENT | CS_OWNDC);
    5.44 +        SDL_Instance = hInst ? hInst : GetModuleHandle(NULL);
    5.45 +    }
    5.46 +
    5.47 +    if (name) {
    5.48 +        SDL_Appname = SDL_iconv_utf8_ucs2(name);
    5.49 +        SDL_Appstyle = style;
    5.50 +        SDL_Instance = hInst ? hInst : GetModuleHandle(NULL);
    5.51 +    }
    5.52 +
    5.53 +    /* Register the application class */
    5.54 +    class.hCursor = NULL;
    5.55 +    class.hIcon = LoadImage(SDL_Instance, SDL_Appname,
    5.56 +                            IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
    5.57 +    class.lpszMenuName = NULL;
    5.58 +    class.lpszClassName = SDL_Appname;
    5.59 +    class.hbrBackground = NULL;
    5.60 +    class.hInstance = SDL_Instance;
    5.61 +    class.style = SDL_Appstyle;
    5.62 +    class.lpfnWndProc = WinMessage;
    5.63 +    class.cbWndExtra = 0;
    5.64 +    class.cbClsExtra = 0;
    5.65 +    if (!RegisterClass(&class)) {
    5.66 +        SDL_SetError("Couldn't register application class");
    5.67 +        return (-1);
    5.68 +    }
    5.69 +
    5.70 +    app_registered = 1;
    5.71 +    return (0);
    5.72 +}
    5.73 +
    5.74 +/* Unregisters the windowclass registered in SDL_RegisterApp above. */
    5.75 +void
    5.76 +SDL_UnregisterApp()
    5.77 +{
    5.78 +    WNDCLASS class;
    5.79 +
    5.80 +    /* SDL_RegisterApp might not have been called before */
    5.81 +    if (!app_registered) {
    5.82 +        return;
    5.83 +    }
    5.84 +    --app_registered;
    5.85 +    if (app_registered == 0) {
    5.86 +        /* Check for any registered window classes. */
    5.87 +        if (GetClassInfo(SDL_Instance, SDL_Appname, &class)) {
    5.88 +            UnregisterClass(SDL_Appname, SDL_Instance);
    5.89 +        }
    5.90 +        SDL_free(SDL_Appname);
    5.91 +        SDL_Appname = NULL;
    5.92 +    }
    5.93  }
    5.94  
    5.95  /* vi: set ts=4 sw=4 expandtab: */
     6.1 --- a/src/video/win32/SDL_win32events.h	Tue Jun 27 04:59:10 2006 +0000
     6.2 +++ b/src/video/win32/SDL_win32events.h	Tue Jun 27 07:46:36 2006 +0000
     6.3 @@ -26,7 +26,11 @@
     6.4  
     6.5  #include "../SDL_sysvideo.h"
     6.6  
     6.7 -extern void WIN32_PumpEvents(_THIS);
     6.8 +extern LPTSTR SDL_Appname;
     6.9 +extern Uint32 SDL_Appstyle;
    6.10 +extern HINSTANCE SDL_Instance;
    6.11 +
    6.12 +extern void WIN_PumpEvents(_THIS);
    6.13  
    6.14  #endif /* _SDL_win32events_h */
    6.15  
     7.1 --- a/src/video/win32/SDL_win32video.c	Tue Jun 27 04:59:10 2006 +0000
     7.2 +++ b/src/video/win32/SDL_win32video.c	Tue Jun 27 07:46:36 2006 +0000
     7.3 @@ -31,30 +31,33 @@
     7.4  #include "SDL_win32window.h"
     7.5  
     7.6  /* Initialization/Query functions */
     7.7 -static int WIN32_VideoInit(_THIS);
     7.8 -static int WIN32_SetDisplayMode(_THIS, const SDL_DisplayMode * mode);
     7.9 -static void WIN32_VideoQuit(_THIS);
    7.10 +static int WIN_VideoInit(_THIS);
    7.11 +static int WIN_SetDisplayMode(_THIS, const SDL_DisplayMode * mode);
    7.12 +static void WIN_VideoQuit(_THIS);
    7.13  
    7.14  /* WIN32 driver bootstrap functions */
    7.15  
    7.16  static int
    7.17 -WIN32_Available(void)
    7.18 +WIN_Available(void)
    7.19  {
    7.20      return (1);
    7.21  }
    7.22  
    7.23  static void
    7.24 -WIN32_DeleteDevice(SDL_VideoDevice * device)
    7.25 +WIN_DeleteDevice(SDL_VideoDevice * device)
    7.26  {
    7.27 +    SDL_UnregisterApp();
    7.28      SDL_free(device->hidden);
    7.29      SDL_free(device);
    7.30  }
    7.31  
    7.32  static SDL_VideoDevice *
    7.33 -WIN32_CreateDevice(int devindex)
    7.34 +WIN_CreateDevice(int devindex)
    7.35  {
    7.36      SDL_VideoDevice *device;
    7.37  
    7.38 +    SDL_RegisterApp(NULL, 0, NULL);
    7.39 +
    7.40      /* Initialize all variables that we clean on shutdown */
    7.41      device = (SDL_VideoDevice *) SDL_malloc(sizeof(SDL_VideoDevice));
    7.42      if (device) {
    7.43 @@ -67,50 +70,50 @@
    7.44          if (device) {
    7.45              SDL_free(device);
    7.46          }
    7.47 -        return (0);
    7.48 +        return NULL;
    7.49      }
    7.50      SDL_memset(device->hidden, 0, (sizeof *device->hidden));
    7.51  
    7.52      /* Set the function pointers */
    7.53 -    device->VideoInit = WIN32_VideoInit;
    7.54 -    device->SetDisplayMode = WIN32_SetDisplayMode;
    7.55 -    device->VideoQuit = WIN32_VideoQuit;
    7.56 -    device->PumpEvents = WIN32_PumpEvents;
    7.57 +    device->VideoInit = WIN_VideoInit;
    7.58 +    device->SetDisplayMode = WIN_SetDisplayMode;
    7.59 +    device->VideoQuit = WIN_VideoQuit;
    7.60 +    device->PumpEvents = WIN_PumpEvents;
    7.61  
    7.62  #undef CreateWindow
    7.63 -    device->CreateWindow = WIN32_CreateWindow;
    7.64 -    device->CreateWindowFrom = WIN32_CreateWindowFrom;
    7.65 -    device->SetWindowTitle = WIN32_SetWindowTitle;
    7.66 -    device->SetWindowPosition = WIN32_SetWindowPosition;
    7.67 -    device->SetWindowSize = WIN32_SetWindowSize;
    7.68 -    device->ShowWindow = WIN32_ShowWindow;
    7.69 -    device->HideWindow = WIN32_HideWindow;
    7.70 -    device->RaiseWindow = WIN32_RaiseWindow;
    7.71 -    device->MaximizeWindow = WIN32_MaximizeWindow;
    7.72 -    device->MinimizeWindow = WIN32_MinimizeWindow;
    7.73 -    device->RestoreWindow = WIN32_RestoreWindow;
    7.74 -    device->SetWindowGrab = WIN32_SetWindowGrab;
    7.75 -    device->DestroyWindow = WIN32_DestroyWindow;
    7.76 -    device->GetWindowWMInfo = WIN32_GetWindowWMInfo;
    7.77 +    device->CreateWindow = WIN_CreateWindow;
    7.78 +    device->CreateWindowFrom = WIN_CreateWindowFrom;
    7.79 +    device->SetWindowTitle = WIN_SetWindowTitle;
    7.80 +    device->SetWindowPosition = WIN_SetWindowPosition;
    7.81 +    device->SetWindowSize = WIN_SetWindowSize;
    7.82 +    device->ShowWindow = WIN_ShowWindow;
    7.83 +    device->HideWindow = WIN_HideWindow;
    7.84 +    device->RaiseWindow = WIN_RaiseWindow;
    7.85 +    device->MaximizeWindow = WIN_MaximizeWindow;
    7.86 +    device->MinimizeWindow = WIN_MinimizeWindow;
    7.87 +    device->RestoreWindow = WIN_RestoreWindow;
    7.88 +    device->SetWindowGrab = WIN_SetWindowGrab;
    7.89 +    device->DestroyWindow = WIN_DestroyWindow;
    7.90 +    device->GetWindowWMInfo = WIN_GetWindowWMInfo;
    7.91  
    7.92 -    device->free = WIN32_DeleteDevice;
    7.93 +    device->free = WIN_DeleteDevice;
    7.94  
    7.95      return device;
    7.96  }
    7.97  
    7.98  VideoBootStrap WIN32_bootstrap = {
    7.99      "win32", "SDL Win32/64 video driver",
   7.100 -    WIN32_Available, WIN32_CreateDevice
   7.101 +    WIN_Available, WIN_CreateDevice
   7.102  };
   7.103  
   7.104  
   7.105  int
   7.106 -WIN32_VideoInit(_THIS)
   7.107 +WIN_VideoInit(_THIS)
   7.108  {
   7.109      SDL_DisplayMode mode;
   7.110  
   7.111      SDL_AddBasicVideoDisplay(NULL);
   7.112 -    //SDL_AddRenderDriver(0, &SDL_WIN32_RenderDriver);
   7.113 +    //SDL_AddRenderDriver(0, &SDL_WIN_RenderDriver);
   7.114  
   7.115      SDL_zero(mode);
   7.116      SDL_AddDisplayMode(0, &mode);
   7.117 @@ -120,14 +123,14 @@
   7.118  }
   7.119  
   7.120  static int
   7.121 -WIN32_SetDisplayMode(_THIS, const SDL_DisplayMode * mode)
   7.122 +WIN_SetDisplayMode(_THIS, const SDL_DisplayMode * mode)
   7.123  {
   7.124      SDL_CurrentDisplay.current_mode = *mode;
   7.125      return 0;
   7.126  }
   7.127  
   7.128  void
   7.129 -WIN32_VideoQuit(_THIS)
   7.130 +WIN_VideoQuit(_THIS)
   7.131  {
   7.132  }
   7.133  
     8.1 --- a/src/video/win32/SDL_win32video.h	Tue Jun 27 04:59:10 2006 +0000
     8.2 +++ b/src/video/win32/SDL_win32video.h	Tue Jun 27 07:46:36 2006 +0000
     8.3 @@ -27,6 +27,7 @@
     8.4  #include "../SDL_sysvideo.h"
     8.5  
     8.6  #define WIN32_LEAN_AND_MEAN
     8.7 +#define UNICODE
     8.8  #include <windows.h>
     8.9  
    8.10  #include "SDL_win32events.h"
     9.1 --- a/src/video/win32/SDL_win32window.c	Tue Jun 27 04:59:10 2006 +0000
     9.2 +++ b/src/video/win32/SDL_win32window.c	Tue Jun 27 07:46:36 2006 +0000
     9.3 @@ -27,72 +27,72 @@
     9.4  
     9.5  
     9.6  int
     9.7 -WIN32_CreateWindow(_THIS, SDL_Window * window)
     9.8 +WIN_CreateWindow(_THIS, SDL_Window * window)
     9.9  {
    9.10  }
    9.11  
    9.12  int
    9.13 -WIN32_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
    9.14 +WIN_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
    9.15  {
    9.16  }
    9.17  
    9.18  void
    9.19 -WIN32_SetWindowTitle(_THIS, SDL_Window * window)
    9.20 +WIN_SetWindowTitle(_THIS, SDL_Window * window)
    9.21  {
    9.22  }
    9.23  
    9.24  void
    9.25 -WIN32_SetWindowPosition(_THIS, SDL_Window * window)
    9.26 +WIN_SetWindowPosition(_THIS, SDL_Window * window)
    9.27  {
    9.28  }
    9.29  
    9.30  void
    9.31 -WIN32_SetWindowSize(_THIS, SDL_Window * window)
    9.32 +WIN_SetWindowSize(_THIS, SDL_Window * window)
    9.33  {
    9.34  }
    9.35  
    9.36  void
    9.37 -WIN32_ShowWindow(_THIS, SDL_Window * window)
    9.38 +WIN_ShowWindow(_THIS, SDL_Window * window)
    9.39  {
    9.40  }
    9.41  
    9.42  void
    9.43 -WIN32_HideWindow(_THIS, SDL_Window * window)
    9.44 +WIN_HideWindow(_THIS, SDL_Window * window)
    9.45  {
    9.46  }
    9.47  
    9.48  void
    9.49 -WIN32_RaiseWindow(_THIS, SDL_Window * window)
    9.50 +WIN_RaiseWindow(_THIS, SDL_Window * window)
    9.51  {
    9.52  }
    9.53  
    9.54  void
    9.55 -WIN32_MaximizeWindow(_THIS, SDL_Window * window)
    9.56 +WIN_MaximizeWindow(_THIS, SDL_Window * window)
    9.57  {
    9.58  }
    9.59  
    9.60  void
    9.61 -WIN32_MinimizeWindow(_THIS, SDL_Window * window)
    9.62 +WIN_MinimizeWindow(_THIS, SDL_Window * window)
    9.63  {
    9.64  }
    9.65  
    9.66  void
    9.67 -WIN32_RestoreWindow(_THIS, SDL_Window * window)
    9.68 +WIN_RestoreWindow(_THIS, SDL_Window * window)
    9.69  {
    9.70  }
    9.71  
    9.72  void
    9.73 -WIN32_SetWindowGrab(_THIS, SDL_Window * window)
    9.74 +WIN_SetWindowGrab(_THIS, SDL_Window * window)
    9.75  {
    9.76  }
    9.77  
    9.78  void
    9.79 -WIN32_DestroyWindow(_THIS, SDL_Window * window)
    9.80 +WIN_DestroyWindow(_THIS, SDL_Window * window)
    9.81  {
    9.82  }
    9.83  
    9.84  SDL_bool
    9.85 -WIN32_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
    9.86 +WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
    9.87  {
    9.88  }
    9.89  
    10.1 --- a/src/video/win32/SDL_win32window.h	Tue Jun 27 04:59:10 2006 +0000
    10.2 +++ b/src/video/win32/SDL_win32window.h	Tue Jun 27 07:46:36 2006 +0000
    10.3 @@ -27,22 +27,21 @@
    10.4  #include "../SDL_sysvideo.h"
    10.5  #include "SDL_win32video.h"
    10.6  
    10.7 -extern int WIN32_CreateWindow(_THIS, SDL_Window * window);
    10.8 -extern int WIN32_CreateWindowFrom(_THIS, SDL_Window * window,
    10.9 -                                  const void *data);
   10.10 -extern void WIN32_SetWindowTitle(_THIS, SDL_Window * window);
   10.11 -extern void WIN32_SetWindowPosition(_THIS, SDL_Window * window);
   10.12 -extern void WIN32_SetWindowSize(_THIS, SDL_Window * window);
   10.13 -extern void WIN32_ShowWindow(_THIS, SDL_Window * window);
   10.14 -extern void WIN32_HideWindow(_THIS, SDL_Window * window);
   10.15 -extern void WIN32_RaiseWindow(_THIS, SDL_Window * window);
   10.16 -extern void WIN32_MaximizeWindow(_THIS, SDL_Window * window);
   10.17 -extern void WIN32_MinimizeWindow(_THIS, SDL_Window * window);
   10.18 -extern void WIN32_RestoreWindow(_THIS, SDL_Window * window);
   10.19 -extern void WIN32_SetWindowGrab(_THIS, SDL_Window * window);
   10.20 -extern void WIN32_DestroyWindow(_THIS, SDL_Window * window);
   10.21 -extern SDL_bool WIN32_GetWindowWMInfo(_THIS, SDL_Window * window,
   10.22 -                                      SDL_SysWMinfo * info);
   10.23 +extern int WIN_CreateWindow(_THIS, SDL_Window * window);
   10.24 +extern int WIN_CreateWindowFrom(_THIS, SDL_Window * window, const void *data);
   10.25 +extern void WIN_SetWindowTitle(_THIS, SDL_Window * window);
   10.26 +extern void WIN_SetWindowPosition(_THIS, SDL_Window * window);
   10.27 +extern void WIN_SetWindowSize(_THIS, SDL_Window * window);
   10.28 +extern void WIN_ShowWindow(_THIS, SDL_Window * window);
   10.29 +extern void WIN_HideWindow(_THIS, SDL_Window * window);
   10.30 +extern void WIN_RaiseWindow(_THIS, SDL_Window * window);
   10.31 +extern void WIN_MaximizeWindow(_THIS, SDL_Window * window);
   10.32 +extern void WIN_MinimizeWindow(_THIS, SDL_Window * window);
   10.33 +extern void WIN_RestoreWindow(_THIS, SDL_Window * window);
   10.34 +extern void WIN_SetWindowGrab(_THIS, SDL_Window * window);
   10.35 +extern void WIN_DestroyWindow(_THIS, SDL_Window * window);
   10.36 +extern SDL_bool WIN_GetWindowWMInfo(_THIS, SDL_Window * window,
   10.37 +                                    SDL_SysWMinfo * info);
   10.38  
   10.39  #endif /* _SDL_win32window_h */
   10.40