Add video driver name to debug
authorunc0rr
Mon, 09 Oct 2006 18:26:44 +0000
changeset 192 b644f61e803f
parent 191 a03c2d037e24
child 193 56885ea29202
Add video driver name to debug
hedgewars/CCHandlers.inc
hedgewars/SDLh.pas
--- a/hedgewars/CCHandlers.inc	Sun Oct 08 18:17:52 2006 +0000
+++ b/hedgewars/CCHandlers.inc	Mon Oct 09 18:26:44 2006 +0000
@@ -383,15 +383,22 @@
 
 procedure chFullScr(var s: shortstring);
 var flags: Longword;
+{$IFDEF DEBUGFILE}
+    buf: array[byte] of char;
+{$ENDIF}
 begin
 if Length(s) = 0 then cFullScreen:= not cFullScreen
                  else cFullScreen:= s = '1';
-   
+
 flags:= SDL_HWSURFACE or SDL_DOUBLEBUF or SDL_HWACCEL;
 if cFullScreen then flags:= flags or SDL_FULLSCREEN
                else SDL_WM_SetCaption('Hedgewars', nil);
 SDL_FreeSurface(SDLPrimSurface);
 SDLPrimSurface:= SDL_SetVideoMode(cScreenWidth, cScreenHeight, cBits, flags);
+
+{$IFDEF DEBUGFILE}
+AddFileLog('SDL video driver: ' + string(SDL_VideoDriverName(buf, sizeof(buf))));
+{$ENDIF}
 TryDo(SDLPrimSurface <> nil, errmsgCreateSurface, true);
 PixelFormat:= SDLPrimSurface.format;
 SDL_ShowCursor(0)
--- a/hedgewars/SDLh.pas	Sun Oct 08 18:17:52 2006 +0000
+++ b/hedgewars/SDLh.pas	Mon Oct 09 18:26:44 2006 +0000
@@ -176,6 +176,7 @@
 
 function  SDL_Init(flags: Longword): integer; cdecl; external SDLLibName;
 procedure SDL_Quit; cdecl; external SDLLibName;
+function  SDL_VideoDriverName(var namebuf; maxlen: integer): PChar; cdecl; external SDLLibName;
 
 procedure SDL_Delay(msec: Longword); cdecl; external SDLLibName;
 function  SDL_GetTicks: Longword; cdecl; external SDLLibName;