diff --git a/CMakeLists.txt b/CMakeLists.txt index 22be6ae3e..38b680ff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,16 +69,6 @@ set(ES_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ) -if(${GLSystem} MATCHES "Desktop OpenGL") - LIST(APPEND ES_INCLUDE_DIRS - ${OPENGL_INCLUDE_DIR} - ) -else() - LIST(APPEND ES_INCLUDE_DIRS - ${OPENGLES_INCLUDE_DIR} - ) -endif() - if(DEFINED BCMHOST) LIST(APPEND ES_INCLUDE_DIRS "/opt/vc/include" @@ -86,6 +76,16 @@ if(DEFINED BCMHOST) "/opt/vc/include/interface/vmcs_host/linux" "/opt/vc/include/interface/vcos/pthreads" ) +else() + if(${GLSystem} MATCHES "Desktop OpenGL") + LIST(APPEND ES_INCLUDE_DIRS + ${OPENGL_INCLUDE_DIR} + ) + else() + LIST(APPEND ES_INCLUDE_DIRS + ${OPENGLES_INCLUDE_DIR} + ) + endif() endif() #------------------------------------------------------------------------------- @@ -172,20 +172,22 @@ set(ES_LIBRARIES boost_system ) -if(${GLSystem} MATCHES "Desktop OpenGL") - LIST(APPEND ES_LIBRARIES - ${OPENGL_LIBRARIES} - ) -else() - LIST(APPEND ES_LIBRARIES - ${OPENGLES_LIBRARIES} - ) -endif() - if(DEFINED BCMHOST) LIST(APPEND ES_LIBRARIES bcm_host + EGL + GLESv1_CM ) +else() + if(${GLSystem} MATCHES "Desktop OpenGL") + LIST(APPEND ES_LIBRARIES + ${OPENGL_LIBRARIES} + ) + else() + LIST(APPEND ES_LIBRARIES + ${OPENGLES_LIBRARIES} + ) + endif() endif() if(DEFINED BCMHOST) diff --git a/src/Renderer_draw_gl.cpp b/src/Renderer_draw_gl.cpp index 9cdcbba9c..ee2058d30 100644 --- a/src/Renderer_draw_gl.cpp +++ b/src/Renderer_draw_gl.cpp @@ -28,7 +28,11 @@ namespace Renderer { void drawRect(int x, int y, int w, int h, unsigned int color) { +#ifdef USE_OPENGL_ES + GLshort points[12]; +#else GLint points[12]; +#endif points[0] = x; points [1] = y; points[2] = x; points[3] = y + h; @@ -46,7 +50,11 @@ namespace Renderer { glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_COLOR_ARRAY); +#ifdef USE_OPENGL_ES + glVertexPointer(2, GL_SHORT, 0, points); +#else glVertexPointer(2, GL_INT, 0, points); +#endif glColorPointer(4, GL_UNSIGNED_BYTE, 0, colors); glDrawArrays(GL_TRIANGLES, 0, 6);