X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fsdl%2Fg_system.pas;h=6d7cf03ef433b371fb4abcad6cf440f1c9b8cbd5;hb=7ea33f434a86160ce9223f5946b5e3407026c76f;hp=bd003768ab37d62e2a533fde10aabd47e54e7e58;hpb=121a26337c4e9e6abcda3b0e5e5df042d6bf0525;p=d2df-sdl.git diff --git a/src/game/sdl/g_system.pas b/src/game/sdl/g_system.pas index bd00376..6d7cf03 100644 --- a/src/game/sdl/g_system.pas +++ b/src/game/sdl/g_system.pas @@ -19,20 +19,36 @@ interface uses Utils; - (* --- Utils --- *) - function sys_GetTicks (): Int64; - procedure sys_Delay (ms: Integer); + type + TGLProfile = (Core, Compat, Common, CommonLite); + + TGLDisplayInfo = record + w, h, bpp: Integer; + fullscreen: Boolean; + maximized: Boolean; + major, minor: Integer; + profile: TGLProfile; + end; (* --- Graphics --- *) + function sys_GetDisplayModes (bpp: Integer): SSArray; function sys_SetDisplayMode (w, h, bpp: Integer; fullscreen, maximized: Boolean): Boolean; procedure sys_EnableVSync (yes: Boolean); procedure sys_Repaint; + function sys_SetDisplayModeGL (const info: TGLDisplayInfo): Boolean; + (* --- Input --- *) + function sys_HandleInput (): Boolean; procedure sys_RequestQuit; +{$IFDEF ENABLE_TOUCH} + function sys_IsTextInputActive (): Boolean; + procedure sys_ShowKeyboard (yes: Boolean); +{$ENDIF} + (* --- Init --- *) procedure sys_Init; procedure sys_Final; @@ -66,18 +82,6 @@ implementation JoystickHatState: array [0..e_MaxJoys - 1, 0..e_MaxJoyHats - 1, HAT_LEFT..HAT_DOWN] of Boolean; JoystickZeroAxes: array [0..e_MaxJoys - 1, 0..e_MaxJoyAxes - 1] of Integer; - (* --------- Utils --------- *) - - function sys_GetTicks (): Int64; - begin - result := SDL_GetTicks() - end; - - procedure sys_Delay (ms: Integer); - begin - SDL_Delay(ms) - end; - (* --------- Graphics --------- *) function GetDriver (): AnsiString; @@ -166,6 +170,14 @@ implementation result := InitWindow(w, h, bpp, fullscreen) end; + function sys_SetDisplayModeGL (const info: TGLDisplayInfo): Boolean; + begin + result := false; + case info.profile of + TGLProfile.Compat: result := InitWindow(info.w, info.h, info.bpp, info.fullscreen); + end; + end; + (* --------- Joystick --------- *) procedure HandleJoyButton (var ev: TSDL_JoyButtonEvent); @@ -464,6 +476,18 @@ implementation end; {$ENDIF} +{$IFDEF ENABLE_TOUCH} + procedure sys_ShowKeyboard (yes: Boolean); + begin + // stub + end; + + function sys_IsTextInputActive (): Boolean; + begin + Result := false + end; +{$ENDIF} + function Key2Stub (key: Integer): Integer; var x: Integer; begin