mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Fix compile errors on Rasbian
Add proper EGL/GLES libraries. Change glVertexPointer() call, because GLES only can use GL_BYTE, GL_SHORT, GL_FIXED and GL_FLOAT...
This commit is contained in:
parent
1f91fe6cdf
commit
a2c990bd26
|
@ -69,16 +69,6 @@ set(ES_INCLUDE_DIRS
|
||||||
${Boost_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)
|
if(DEFINED BCMHOST)
|
||||||
LIST(APPEND ES_INCLUDE_DIRS
|
LIST(APPEND ES_INCLUDE_DIRS
|
||||||
"/opt/vc/include"
|
"/opt/vc/include"
|
||||||
|
@ -86,6 +76,16 @@ if(DEFINED BCMHOST)
|
||||||
"/opt/vc/include/interface/vmcs_host/linux"
|
"/opt/vc/include/interface/vmcs_host/linux"
|
||||||
"/opt/vc/include/interface/vcos/pthreads"
|
"/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()
|
endif()
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
@ -172,20 +172,22 @@ set(ES_LIBRARIES
|
||||||
boost_system
|
boost_system
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${GLSystem} MATCHES "Desktop OpenGL")
|
|
||||||
LIST(APPEND ES_LIBRARIES
|
|
||||||
${OPENGL_LIBRARIES}
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
LIST(APPEND ES_LIBRARIES
|
|
||||||
${OPENGLES_LIBRARIES}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(DEFINED BCMHOST)
|
if(DEFINED BCMHOST)
|
||||||
LIST(APPEND ES_LIBRARIES
|
LIST(APPEND ES_LIBRARIES
|
||||||
bcm_host
|
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()
|
endif()
|
||||||
|
|
||||||
if(DEFINED BCMHOST)
|
if(DEFINED BCMHOST)
|
||||||
|
|
|
@ -28,7 +28,11 @@ namespace Renderer {
|
||||||
|
|
||||||
void drawRect(int x, int y, int w, int h, unsigned int color)
|
void drawRect(int x, int y, int w, int h, unsigned int color)
|
||||||
{
|
{
|
||||||
|
#ifdef USE_OPENGL_ES
|
||||||
|
GLshort points[12];
|
||||||
|
#else
|
||||||
GLint points[12];
|
GLint points[12];
|
||||||
|
#endif
|
||||||
|
|
||||||
points[0] = x; points [1] = y;
|
points[0] = x; points [1] = y;
|
||||||
points[2] = x; points[3] = y + h;
|
points[2] = x; points[3] = y + h;
|
||||||
|
@ -46,7 +50,11 @@ namespace Renderer {
|
||||||
glEnableClientState(GL_VERTEX_ARRAY);
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
glEnableClientState(GL_COLOR_ARRAY);
|
glEnableClientState(GL_COLOR_ARRAY);
|
||||||
|
|
||||||
|
#ifdef USE_OPENGL_ES
|
||||||
|
glVertexPointer(2, GL_SHORT, 0, points);
|
||||||
|
#else
|
||||||
glVertexPointer(2, GL_INT, 0, points);
|
glVertexPointer(2, GL_INT, 0, points);
|
||||||
|
#endif
|
||||||
glColorPointer(4, GL_UNSIGNED_BYTE, 0, colors);
|
glColorPointer(4, GL_UNSIGNED_BYTE, 0, colors);
|
||||||
|
|
||||||
glDrawArrays(GL_TRIANGLES, 0, 6);
|
glDrawArrays(GL_TRIANGLES, 0, 6);
|
||||||
|
|
Loading…
Reference in a new issue