diff --git a/CMakeLists.txt b/CMakeLists.txt index f6fe71e..7bea885 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,8 @@ if (RASPBERRY_PI) message(STATUS "Will build for Raspberry Pi") include_directories(SYSTEM /opt/vc/include + /opt/vc/include/interface/vcos/pthreads + /opt/vc/include/interface/vmcs_host/linux ) link_directories( /opt/vc/lib diff --git a/src/sdlmain.cpp b/src/sdlmain.cpp index 1f33b8e..2d0d9df 100644 --- a/src/sdlmain.cpp +++ b/src/sdlmain.cpp @@ -115,6 +115,12 @@ namespace cloonel { ///------------------------------------------------------------------------ ///------------------------------------------------------------------------ void SDLMain::InitSDL (LocalData& parInitSDL) { +#if defined(RASPBERRY_PI) + assert(not parInitSDL.bcmInitialized); + bcm_host_init(); + parInitSDL.bcmInitialized = true; +#endif + parInitSDL.window = nullptr; parInitSDL.renderer = nullptr; parInitSDL.initialized = false; @@ -123,12 +129,6 @@ namespace cloonel { throw std::runtime_error(SDL_GetError()); parInitSDL.initialized = true; -#if defined(RASPBERRY_PI) - assert(not parInitSDL.bcmInitialized); - bcm_host_init(); - parInitSDL.bcmInitialized = true; -#endif - #if defined(FORCE_OPENGLES) SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); #endif