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