Improve RPi support

This commit is contained in:
Joshua Granick
2015-09-02 23:53:14 -07:00
parent c6ed35b493
commit 34d4b9cc13
11 changed files with 42 additions and 24 deletions

View File

@@ -8,7 +8,7 @@
<set name="lime-legacy" value="1" if="legacy || lime_legacy" />
<set name="ios" value="1" if="iphone" />
<set name="LIME_CAIRO" value="1" />
<set name="LIME_CURL" value="1" unless="emscripten" />
<set name="LIME_JPEG" value="1" />
@@ -173,10 +173,12 @@
<section unless="emscripten">
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include/" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include/configs/default/" unless="windows || mac || linux"/>
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include/configs/linux/" if="linux"/>
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include/configs/default/" unless="windows || mac || linux || rpi"/>
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include/configs/linux/" if="linux" unless="rpi"/>
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include/configs/windows/" if="windows"/>
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include/configs/mac/" if="mac"/>
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include/configs/rpi/" if="rpi"/>
<compilerflag value="-DHAVE_LIBC" />
</section>
@@ -336,6 +338,16 @@
</section>
<section if="rpi">
<lib name="-lbcm_host" />
<lib name="-ldl" />
<lib name="-lm" />
<lib name="-lGLESv2" />
<lib name="-lEGL" />
</section>
</section>
</target>

View File

@@ -34,6 +34,13 @@ namespace lime {
SDL_SetHint (SDL_HINT_VIDEO_WIN_D3DCOMPILER, "d3dcompiler_47.dll");
#endif
#if defined (RASPBERRYPI)
SDL_GL_SetAttribute (SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute (SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute (SDL_GL_CONTEXT_MINOR_VERSION, 0);
SDL_SetHint (SDL_HINT_RENDER_DRIVER, "opengles2");
#endif
if (flags & WINDOW_FLAG_DEPTH_BUFFER) {
SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 32 - (flags & WINDOW_FLAG_STENCIL_BUFFER) ? 8 : 0);
@@ -309,4 +316,4 @@ namespace lime {
}
}
}

View File

@@ -2,7 +2,7 @@
#define LIME_GRAPHICS_OPENGL_OPENGL_H
#if defined (BLACKBERRY) || defined (ANDROID) || defined (WEBOS) || defined (GPH) || defined (EMSCRIPTEN)
#if defined (BLACKBERRY) || defined (ANDROID) || defined (WEBOS) || defined (GPH) || defined (EMSCRIPTEN) || defined (RASPBERRYPI)
#define LIME_GLES
#include <GLES2/gl2.h>