mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Fix EGL build on non-Android devices
This commit is contained in:
parent
3207b91259
commit
302f20fa3a
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
option(GLES2 "Set to ON if targeting a GLES2 device" ${GLES2})
|
||||
option(EGL "Set to ON if targeting an EGL device" ${EGL})
|
||||
option(PANDORA "Set to ON if targeting an OpenPandora" ${PANDORA})
|
||||
option(MUPENPLUSAPI "Set to ON for Mupen64Plus plugin" ${MUPENPLUSAPI})
|
||||
|
||||
|
@ -89,7 +89,7 @@ MESSAGE("Looking for bcm_host.h")
|
|||
if(EXISTS "/opt/vc/include/bcm_host.h")
|
||||
MESSAGE("bcm_host.h found")
|
||||
set(BCMHOST ON)
|
||||
set(GLES2 ON)
|
||||
set(EGL ON)
|
||||
add_definitions(
|
||||
-DVC
|
||||
-DUSE_DEPTH_RENDERBUFFER
|
||||
|
@ -192,7 +192,7 @@ if(PANDORA)
|
|||
add_definitions(
|
||||
-DPANDORA
|
||||
-DPowerVR_SGX_540
|
||||
-DGLES2
|
||||
-DEGL
|
||||
)
|
||||
endif(PANDORA)
|
||||
|
||||
|
@ -246,12 +246,12 @@ if( CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|||
# )
|
||||
endif( CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
|
||||
if(GLES2)
|
||||
if(EGL)
|
||||
add_definitions(
|
||||
-DGLES2
|
||||
-DEGL
|
||||
)
|
||||
SET(OPENGL_LIBRARIES -lGLESv2 -lEGL)
|
||||
else(GLES2)
|
||||
SET(OPENGL_LIBRARIES -lEGL)
|
||||
else(EGL)
|
||||
find_package(OpenGL REQUIRED)
|
||||
include_directories(${OpenGL_INCLUDE_DIRS})
|
||||
link_directories(${OpenGL_LIBRARY_DIRS})
|
||||
|
@ -259,7 +259,7 @@ else(GLES2)
|
|||
if(NOT OPENGL_FOUND)
|
||||
message(ERROR " OPENGL not found!")
|
||||
endif(NOT OPENGL_FOUND)
|
||||
endif(GLES2)
|
||||
endif(EGL)
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
#check for G++ 4.8+
|
||||
|
|
|
@ -5,6 +5,13 @@
|
|||
#define glGetProcAddress wglGetProcAddress
|
||||
#define GL_GET_PROC_ADR(proc_type, proc_name) g_##proc_name = (proc_type) glGetProcAddress(#proc_name)
|
||||
|
||||
#elif defined(EGL)
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#define glGetProcAddress eglGetProcAddress
|
||||
#define GL_GET_PROC_ADR(proc_type, proc_name) g_##proc_name = (proc_type) glGetProcAddress(#proc_name)
|
||||
|
||||
#elif defined(OS_LINUX)
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
|
@ -21,13 +28,6 @@ typedef struct __GLXFBConfigRec *GLXFBConfig;
|
|||
#define glGetProcAddress glXGetProcAddress
|
||||
#define GL_GET_PROC_ADR(proc_type, proc_name) g_##proc_name = (proc_type) glGetProcAddress((const GLubyte*)#proc_name)
|
||||
|
||||
#elif defined(EGL)
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#define glGetProcAddress eglGetProcAddress
|
||||
#define GL_GET_PROC_ADR(proc_type, proc_name) g_##proc_name = (proc_type) glGetProcAddress(#proc_name)
|
||||
|
||||
#endif
|
||||
|
||||
//GL Fucntions
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifdef EGL
|
||||
#if defined(EGL) && defined(ANDROID)
|
||||
|
||||
#include <GBI.h>
|
||||
#include <Graphics/Context.h>
|
||||
|
|
Loading…
Reference in New Issue
Block a user