···2121 set(SDL_gpu_DEFAULT_BUILD_DEMOS OFF)
2222 set(SDL_gpu_DEFAULT_DISABLE_OPENGL ON)
2323 set(SDL_gpu_DEFAULT_DISABLE_GLES OFF)
2424+elseif(("${CMAKE_SYSTEM}" MATCHES "Linux") AND ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm"))
2525+2626+ # Assuming Raspberry Pi 2 for now.
2727+ # There is a bug with the shipping GLES v1 library where 3 of the symbols are misnamed.
2828+ # If you have an arm/ES device without this problem, don't enable this macro.
2929+ # TODO: Need way to identify Raspberry Pi/Broadcom
3030+ add_definitions(-DSDL_GPU_USE_BROADCOM_RASPBERRYPI_WORKAROUND)
3131+3232+ set(SDL_gpu_DEFAULT_BUILD_DEMOS OFF)
3333+ set(SDL_gpu_DEFAULT_DISABLE_OPENGL ON)
3434+ set(SDL_gpu_DEFAULT_DISABLE_GLES OFF)
2435else()
2536 set(SDL_gpu_DEFAULT_BUILD_DEMOS ON)
2637 set(SDL_gpu_DEFAULT_DISABLE_OPENGL OFF)
···114125 include_directories(${OPENGL_INCLUDE_DIR})
115126 if(APPLE AND NOT IOS)
116127 # CMake incorrectly includes AGL.framework in OPENGL_LIBRARIES which is obsolete.
117117- link_libraries(${OPENGL_gl_LIBRARY})
128128+ # link_libraries(${OPENGL_gl_LIBRARY})
129129+ set(SDL_gpu_GL_LIBRARIES ${OPENGL_gl_LIBRARY})
118130 else()
119119- link_libraries(${OPENGL_LIBRARIES})
131131+ # link_libraries(${OPENGL_LIBRARIES})
132132+ set(SDL_gpu_GL_LIBRARIES ${OPENGL_LIBRARIES})
120133 endif()
121134122135···181194 else()
182195 find_package(OpenGLES REQUIRED)
183196 include_directories(${OPENGLES_INCLUDE_DIR})
184184- link_libraries (${OPENGLES_LIBRARIES})
197197+# link_libraries (${OPENGLES_LIBRARIES})
198198+ set(SDL_gpu_GL_LIBRARIES ${OPENGLES_LIBRARIES})
185199 endif()
186200187201 if (SDL_gpu_DISABLE_GLES_1)
+10
include/SDL_gpu_GLES_1.h
···2727 #define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_OES
2828 #define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
29293030+/* It looks like on Raspberry Pi 2/Raspbian, the
3131+ symbols in library are missing the OES suffix,
3232+ even though the headers seem to be named right.
3333+*/
3434+#ifdef SDL_GPU_USE_BROADCOM_RASPBERRYPI_WORKAROUND
3535+ extern void glBlendEquation(GLenum mode);
3636+ extern void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
3737+ extern void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
3838+#else
3039 #define glBlendEquation glBlendEquationOES
3140 #define glBlendEquationSeparate glBlendEquationSeparateOES
3241 #define glBlendFuncSeparate glBlendFuncSeparateOES
4242+#endif
33433444 #define GL_FUNC_ADD GL_FUNC_ADD_OES
3545 #define GL_FUNC_SUBTRACT GL_FUNC_SUBTRACT_OES
+20-5
scripts/FindOpenGLES.cmake
···47474848 ELSE(APPLE)
49495050- IF(0) # Disabled, untill further testing
515052515353- FIND_PATH(OPENGLES_INCLUDE_DIR GLES/gl.h
5252+ FIND_PATH(OPENGLES_INCLUDE_DIR GLES2/gl2.h
5453 /usr/openwin/share/include
5554 /opt/graphics/OpenGL/include /usr/X11R6/include
5655 /usr/include
5656+ # Raspberry Pi (Raspbian) puts these in /opt/vc "VideoCore"
5757+ /opt/vc/include
5758 )
585959606061 FIND_LIBRARY(OPENGLES_gl_LIBRARY
6161- NAMES GLES_CM
6262+ # NAMES GLES_CM
6363+ NAMES GLESv2
6464+ PATHS /opt/graphics/OpenGL/lib
6565+ /usr/openwin/lib
6666+ /usr/shlib /usr/X11R6/lib
6767+ /usr/lib
6868+ # Raspberry Pi (Raspbian) puts these in /opt/vc "VideoCore"
6969+ /opt/vc/lib
7070+ )
7171+ FIND_LIBRARY(OPENGLES_gl1_LIBRARY
7272+ NAMES GLESv1_CM
6273 PATHS /opt/graphics/OpenGL/lib
6374 /usr/openwin/lib
6475 /usr/shlib /usr/X11R6/lib
6576 /usr/lib
7777+ # Raspberry Pi (Raspbian) puts these in /opt/vc "VideoCore"
7878+ /opt/vc/lib
6679 )
67806881 # On Unix OpenGL most certainly always requires X11.
6982 # Feel free to tighten up these conditions if you don't
7083 # think this is always true.
7184 # It's not true on OSX.
8585+ # This is not true on Raspberry Pi (Raspbian)
72868787+ IF(0) # Disabled, untill further testing
7388 IF (OPENGLES_gl_LIBRARY)
7489 IF(NOT X11_FOUND)
7590 INCLUDE(FindX11)
···88103SET( OPENGLES_FOUND "NO" )
89104IF(OPENGLES_gl_LIBRARY)
901059191- SET( OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY} ${OPENGLES_LIBRARIES})
106106+ SET( OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY} ${OPENGLES_gl1_LIBRARY} ${OPENGLES_LIBRARIES})
9210793108 SET( OPENGLES_FOUND "YES" )
94109···97112MARK_AS_ADVANCED(
98113 OPENGLES_INCLUDE_DIR
99114 OPENGLES_gl_LIBRARY
100100-)115115+)