Skip to content

Commit

Permalink
Fix headless
Browse files Browse the repository at this point in the history
  • Loading branch information
lhog committed Jan 3, 2022
1 parent 66f6637 commit 0d99425
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rts/lib/headlessStubs/sdlstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_GetAppState() {
extern DECLSPEC int SDL_GetNumVideoDisplays(void) {
return 0;
}

extern DECLSPEC int SDL_GetDisplayBounds(int displayIndex, SDL_Rect* rect) {
if (rect == 0) return -1;
rect->w = 640;
Expand All @@ -288,6 +289,19 @@ extern DECLSPEC int SDL_GetDisplayBounds(int displayIndex, SDL_Rect* rect) {
return 0;
}

extern DECLSPEC int SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect* rect) {
if (rect == 0) return -1;
rect->w = 640;
rect->h = 480;
rect->x = 0;
rect->y = 0;
return 0;
}

extern DECLSPEC const char* SDLCALL SDL_GetDisplayName(int displayIndex) {
return "";
}

extern DECLSPEC int SDL_GL_GetSwapInterval() {
return 0;
}
Expand Down

0 comments on commit 0d99425

Please sign in to comment.