diff src/main/win32/SDL_main.c @ 149:0e66fd980014

Fixed compile errors and added call to SDL_SetModuleHandle() in WinMain()
author Sam Lantinga <slouken@libsdl.org>
date Thu, 09 Aug 2001 14:04:46 +0000
parents 29a638dc26db
children a6fa62b1be09
line wrap: on
line diff
--- a/src/main/win32/SDL_main.c	Thu Aug 09 13:09:47 2001 +0000
+++ b/src/main/win32/SDL_main.c	Thu Aug 09 14:04:46 2001 +0000
@@ -199,16 +199,25 @@
 	atexit(SDL_Quit);
 
 #ifndef DISABLE_VIDEO
+#if 0
 	/* Create and register our class *
-      DJM: If we do this here, the user nevers gets a chance to
-      putenv(SDL_WINDOWID).  This is already called later by
-      the (DIB|DX5)_CreateWindow function, so it should be
-      safe to comment it out here.
+	   DJM: If we do this here, the user nevers gets a chance to
+	   putenv(SDL_WINDOWID).  This is already called later by
+	   the (DIB|DX5)_CreateWindow function, so it should be
+	   safe to comment it out here.
 	if ( SDL_RegisterApp(appname, CS_BYTEALIGNCLIENT, 
 	                     GetModuleHandle(NULL)) < 0 ) {
 		ShowError("WinMain() error", SDL_GetError());
 		exit(1);
 	}*/
+#else
+	/* Sam:
+	   We still need to pass in the application handle so that
+	   DirectInput will initialize properly when SDL_RegisterApp()
+	   is called later in the video initialization.
+	 */
+	SDL_SetModuleHandle(GetModuleHandle(NULL));
+#endif /* 0 */
 #endif /* !DISABLE_VIDEO */
 
 	/* Run the application main() code */