From 52d6675249c97c0068eaa0991275e68ae7b5c37f Mon Sep 17 00:00:00 2001 From: SR_team Date: Thu, 7 Jul 2022 07:59:12 +0300 Subject: [PATCH] Add missing device commands for SDL2 --- src/gl/gl3device.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gl/gl3device.cpp b/src/gl/gl3device.cpp index 96bddb2..014571e 100644 --- a/src/gl/gl3device.cpp +++ b/src/gl/gl3device.cpp @@ -1977,6 +1977,20 @@ deviceSystemSDL2(DeviceReq req, void *arg, int32 n) case DEVICESETMULTISAMPLINGLEVELS: glGlobals.numSamples = (uint32)n; return 1; + case DEVICEGETNUMSUBSYSTEMS: + return SDL_GetNumVideoDisplays(); + case DEVICEGETSUBSSYSTEMINFO: + if (n > SDL_GetNumVideoDisplays()) + return 0; + strncpy(((SubSystemInfo*)arg)->name, SDL_GetDisplayName(n), sizeof(SubSystemInfo::name)); + return 1; + case DEVICEGETCURRENTSUBSYSTEM: + return 0; // FIXME: Returns first monitor index, instead of current + case DEVICESETSUBSYSTEM: + if (n > SDL_GetNumVideoDisplays()) + return 0; + // TODO: Set monitor index to be use + return 1; default: assert(0 && "not implemented"); return 0;