From 3c0e460a23bea743e3067ffa981d1a73d8c95d9c Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Thu, 7 Aug 2014 11:29:04 +0200 Subject: [PATCH] Fixes for the Raspberry Pi build. The slowness problem is still there. --- CMakeLists.txt | 2 ++ src/sdlmain.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) 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