Add missing device commands for SDL2

This commit is contained in:
SR_team 2022-07-07 07:59:12 +03:00
parent a6d659d1b5
commit 52d6675249

View File

@ -1977,6 +1977,20 @@ deviceSystemSDL2(DeviceReq req, void *arg, int32 n)
case DEVICESETMULTISAMPLINGLEVELS: case DEVICESETMULTISAMPLINGLEVELS:
glGlobals.numSamples = (uint32)n; glGlobals.numSamples = (uint32)n;
return 1; 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: default:
assert(0 && "not implemented"); assert(0 && "not implemented");
return 0; return 0;