- Defer SDL subsystem initialization since it seems to cause conflicts with GUI toolkits on some systems.

This commit is contained in:
Braden Obrzut 2015-02-02 19:36:08 -05:00
parent dc6b45804d
commit 8e1b1aa201
4 changed files with 23 additions and 6 deletions

View File

@ -66,10 +66,20 @@ void I_ShutdownGraphics ()
}
if (Video)
delete Video, Video = NULL;
SDL_QuitSubSystem (SDL_INIT_VIDEO);
}
void I_InitGraphics ()
{
if (SDL_InitSubSystem (SDL_INIT_VIDEO) < 0)
{
I_FatalError ("Could not initialize SDL video:\n%s\n", SDL_GetError());
return;
}
Printf("Using video driver %s\n", SDL_GetCurrentVideoDriver());
UCVarValue val;
val.Bool = !!Args->CheckParm ("-devparm");

View File

@ -1,4 +1,4 @@
#include <SDL_joystick.h>
#include <SDL.h>
#include "doomdef.h"
#include "templates.h"
@ -266,11 +266,16 @@ static SDLInputJoystickManager *JoystickManager;
void I_StartupJoysticks()
{
JoystickManager = new SDLInputJoystickManager();
if(SDL_InitSubSystem(SDL_INIT_JOYSTICK) >= 0)
JoystickManager = new SDLInputJoystickManager();
}
void I_ShutdownJoysticks()
{
delete JoystickManager;
if(JoystickManager)
{
delete JoystickManager;
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
}
}
void I_GetJoysticks(TArray<IJoystickConfig *> &sticks)

View File

@ -265,14 +265,13 @@ int main (int argc, char **argv)
setlocale (LC_ALL, "C");
if (SDL_Init (SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE|SDL_INIT_JOYSTICK) == -1)
if (SDL_Init (0) < 0)
{
fprintf (stderr, "Could not initialize SDL:\n%s\n", SDL_GetError());
return -1;
}
atterm (SDL_Quit);
printf("Using video driver %s\n", SDL_GetCurrentVideoDriver());
printf("\n");
try

View File

@ -195,6 +195,9 @@ fixed_t I_GetTimeFrac (uint32 *ms)
void I_InitTimer ()
{
if(SDL_InitSubSystem(SDL_INIT_TIMER) < 0)
I_FatalError("Could not initialize SDL timers:\n%s\n", SDL_GetError());
I_GetTime = I_GetTimeSelect;
I_WaitForTic = I_WaitForTicSelect;
I_FreezeTime = I_FreezeTimeSelect;
@ -202,5 +205,5 @@ void I_InitTimer ()
void I_ShutdownTimer ()
{
SDL_QuitSubSystem(SDL_INIT_TIMER);
}