QTfrontend/SDLs.cpp
changeset 5085 e8944ed92b61
parent 5083 b0b560f561b5
child 5238 46ddaf14509d
equal deleted inserted replaced
5083:b0b560f561b5 5085:e8944ed92b61
    22 #include "SDL_mixer.h"
    22 #include "SDL_mixer.h"
    23 #include "hwconsts.h"
    23 #include "hwconsts.h"
    24 
    24 
    25 #include <QApplication>
    25 #include <QApplication>
    26 
    26 
    27 #ifdef __APPLE__
       
    28 #include "CocoaInitializer.h"
       
    29 #endif
       
    30 
       
    31 
    27 
    32 extern char sdlkeys[1024][2][128];
    28 extern char sdlkeys[1024][2][128];
    33 extern char xb360buttons[][128];
    29 extern char xb360buttons[][128];
    34 extern char xb360dpad[128];
    30 extern char xb360dpad[128];
    35 extern char xbox360axes[][128];
    31 extern char xbox360axes[][128];
    36 
    32 
    37 
    33 
    38 SDLInteraction::SDLInteraction()
    34 SDLInteraction::SDLInteraction()
    39 {
    35 {
    40 #ifdef __APPLE__
    36 
    41     // SDL_Init needs a NSAutoreleasePool set up
       
    42     CocoaInitializer initializer;
       
    43 #endif
       
    44     
       
    45     SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK);
    37     SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK);
    46 
    38 
    47     musicInitialized = 0;
    39     musicInitialized = 0;
    48     music = NULL;
    40     music = NULL;
    49     if(SDL_NumJoysticks())
    41     if(SDL_NumJoysticks())