Fix library for GLES1

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1186 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
beuc 2012-03-17 16:26:00 +00:00
parent b42288155e
commit 7a42e4527e
2 changed files with 18 additions and 4 deletions

View File

@ -153,7 +153,7 @@ IF(FREEGLUT_GLES2)
LIST(APPEND LIBS GLESv2 EGL)
ELSEIF(FREEGLUT_GLES1)
ADD_DEFINITIONS(-DFREEGLUT_GLES1)
LIST(APPEND LIBS GLESv1 EGL)
LIST(APPEND LIBS GLESv1_CM EGL)
ELSE()
FIND_PACKAGE(OpenGL REQUIRED)
LIST(APPEND LIBS ${OPENGL_gl_LIBRARY})
@ -363,11 +363,21 @@ ENDIF()
# Define static build dependencies
IF(WIN32)
SET(PC_LIBS_PRIVATE "-lopengl32 -lwinmm -lgdi32")
ELSEIF(ANDROID)
ELSEIF(FREEGLUT_GLES2)
IF(ANDROID)
SET(PC_LIBS_PRIVATE "-llog -landroid -lGLESv2 -lEGL")
ELSE()
SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGLESv2 -lEGL")
ENDIF()
ELSEIF(FREEGLUT_GLES1)
IF(ANDROID)
SET(PC_LIBS_PRIVATE "-llog -landroid -lGLESv1_CM -lEGL")
ELSE()
SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGLESv1_CM -lEGL")
ENDIF()
ELSE()
SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGL")
ENDIF()
# Client applications need to define FreeGLUT GLES version to
# bootstrap headers inclusion in freeglut_std.h:
IF(FREEGLUT_GLES2)

View File

@ -82,7 +82,11 @@ EGLContext fghCreateNewContextEGL( SFG_Window* window ) {
}
EGLint ver = -1;
eglQueryContext(fgDisplay.pDisplay.egl.Display, context, EGL_CONTEXT_CLIENT_VERSION, &ver);
#ifdef GL_ES_VERSION_2_0
if (ver != 2)
#else
if (ver != 1)
#endif
fgError("Wrong GLES major version: %d\n", ver);
return context;