From 677ce3960cd13cbf994311c76d75b343b22fd480 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sat, 29 Sep 2012 10:40:11 +0200 Subject: Some fixes and optimizations - fixed 2nd texture setting - added padding to some structs for faster access - changed rendering primitives to glDrawArrays() - optimized texture modesetting calls - fixed some valgrind errors --- src/app/app.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/app') diff --git a/src/app/app.cpp b/src/app/app.cpp index 00977d1..0b9aae6 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -357,7 +357,7 @@ bool CApplication::Create() /* SDL initialization sequence */ - Uint32 initFlags = SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER; + Uint32 initFlags = SDL_INIT_VIDEO | SDL_INIT_TIMER; if (SDL_Init(initFlags) < 0) { @@ -368,6 +368,12 @@ bool CApplication::Create() return false; } + // This is non-fatal and besides seems to fix some memory leaks + if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) + { + GetLogger()->Warn("Joystick subsystem init failed\nJoystick(s) will not be available\n"); + } + if ((IMG_Init(IMG_INIT_PNG) & IMG_INIT_PNG) == 0) { m_errorMessage = std::string("SDL_Image initialization error:\n") + @@ -398,10 +404,6 @@ bool CApplication::Create() SDL_JoystickEventState(SDL_IGNORE); - // For now, enable joystick for testing - SetJoystickEnabled(true); - - // The video is ready, we can create and initalize the graphics device m_device = new Gfx::CGLDevice(m_deviceConfig); if (! m_device->Create() ) -- cgit v1.2.3-1-g7c22