this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Made GPU_Init() work right when called after SDL has already been initialized elsewhere.

+19 -4
+19 -4
SDL_gpu/SDL_gpu.c
··· 87 87 88 88 if(GPU_GetNumActiveRenderers() == 0) 89 89 { 90 - if(SDL_Init(SDL_INIT_VIDEO) < 0) 91 - { 92 - return NULL; 93 - } 90 + Uint32 subsystems = SDL_WasInit(SDL_INIT_EVERYTHING); 91 + if(!subsystems) 92 + { 93 + // Nothing has been set up, so init SDL and the video subsystem. 94 + if(SDL_Init(SDL_INIT_VIDEO) < 0) 95 + { 96 + GPU_LogError("GPU_Init() failed to initialize SDL.\n"); 97 + return NULL; 98 + } 99 + } 100 + else if(!(subsystems & SDL_INIT_VIDEO)) 101 + { 102 + // Something already set up SDL, so just init video. 103 + if(SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) 104 + { 105 + GPU_LogError("GPU_Init() failed to initialize SDL video subsystem.\n"); 106 + return NULL; 107 + } 108 + } 94 109 } 95 110 96 111