index 31c5b1cde5c4147282cd52211f24446cd9a47e12..9cd1ee194b0ae4b89bb587e593c689067fd477cb 100644 (file)
// store real window size in gWinSize, downscale resolution now
w := round(w / r_pixel_scale);
h := round(h / r_pixel_scale);
- e_ResizeFramebuffer(w, h);
+ if not e_ResizeFramebuffer(w, h) then
+ begin
+ e_LogWriteln('GL: could not create framebuffer, falling back to --no-fbo');
+ glRenderToFBO := False;
+ w := gWinSizeX;
+ h := gWinSizeY;
+ end;
end;
gScreenWidth := w;
gScreenHeight := h;
e_ResizeWindow(w, h);
e_InitGL;
g_Game_SetupScreenSize;
- {$IFNDEF ANDOIRD}
+ {$IFNDEF ANDROID}
(* This will fix menu reset on keyboard showing *)
g_Menu_Reset;
{$ENDIF}
{$ENDIF}
end;
- function GetTitle (): PChar;
+ function GetTitle (): AnsiString;
var info: AnsiString;
begin
info := g_GetBuildHash(false);
if info = 'custom build' then
info := info + ' by ' + g_GetBuilderName() + ' ' + GAME_BUILDDATE + ' ' + GAME_BUILDTIME;
- result := PChar(Format(GameTitle, [info]))
+ result := Format(GameTitle, [info]);
end;
function InitWindow (w, h, bpp: Integer; fullScreen, maximized: Boolean): Boolean;
- var flags: UInt32; x, y: cint;
+ var flags: UInt32; x, y: cint; title: AnsiString;
begin
// note: on window close make: if assigned(oglDeinitCB) then oglDeinitCB;
e_LogWritefln('InitWindow %s %s %s %s', [w, h, bpp, fullScreen]);
x := wx;
y := wy
end;
- window := SDL_CreateWindow(GetTitle(), x, y, w, h, flags);
+ title := GetTitle();
+ window := SDL_CreateWindow(PChar(title), x, y, w, h, flags);
if window <> nil then
begin
context := SDL_GL_CreateContext(window);
procedure sys_Repaint;
begin
- if glRenderToFBO then
- e_BlitFramebuffer(gWinSizeX, gWinSizeY);
SDL_GL_SwapWindow(window)
end;
e_KeyUpDown(key, down);
g_Console_ProcessBind(key, down);
end
- else if gConsoleShow or gChatShow or (g_ActiveWindow <> nil) then
+ else
begin
- KeyPress(key) // key repeat in menus and shit
+ if g_dbg_input then
+ e_LogWritefln('Input Debug: keyrep, scancode=%s', [key]);
+ g_Console_ProcessBindRepeat(key);
end
end;