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
1 changed files with 14 additions and 0 deletions

View File

@ -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;