mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-10 12:02:53 +02:00
Use Khronos OpenGL headers in libretro builds instead of SDL OpenGL headers
SDL disables OpenGL headers when building for iOS and tvOS, but that causes our builds to fail. I'm getting conflicting answers on whether or not OpenGL is supported on iOS and tvOS, but it's the libretro frontend's job to care about this, not mine. Regardless, I'm gonna need these OpenGL headers for software rendering on platforms with no OpenGL support, so I can't tolerate the headers being disabled.
This commit is contained in:
parent
ccceeeb75b
commit
497d6788c6
6 changed files with 29 additions and 6 deletions
|
@ -115,6 +115,8 @@ if is_libretro
|
|||
'-DSHARED_FLUID',
|
||||
'-D_FILE_OFFSET_BITS=64',
|
||||
'-DMPG123_NO_LARGENAME',
|
||||
'-DPGL_PREFIX_TYPES',
|
||||
'-DPGL_PREFIX_GLSL',
|
||||
]
|
||||
|
||||
if host_endian == 'big'
|
||||
|
@ -514,6 +516,7 @@ if is_libretro
|
|||
cmake.subproject('libsndfile', options: libsndfile_options).dependency('sndfile'),
|
||||
cmake.subproject('pixman-region', options: pixman_region_options).dependency('pixman-region'),
|
||||
subproject('stb').get_variable('stb'),
|
||||
subproject('opengl-registry').get_variable('opengl_registry'),
|
||||
subproject('portablegl').get_variable('portablegl'),
|
||||
subproject('freetype', default_options: freetype_options).get_variable('freetype_dep'),
|
||||
declare_dependency(
|
||||
|
|
|
@ -22,12 +22,18 @@
|
|||
#ifndef GLFUN_H
|
||||
#define GLFUN_H
|
||||
|
||||
#ifdef GLES2_HEADER
|
||||
#include <SDL_opengles2.h>
|
||||
#define APIENTRYP GL_APIENTRYP
|
||||
#ifdef MKXPZ_RETRO
|
||||
# include <GLES3/gl3.h>
|
||||
# define APIENTRY GL_APIENTRY
|
||||
# define APIENTRYP GL_APIENTRYP
|
||||
#else
|
||||
#include <SDL_opengl.h>
|
||||
#endif
|
||||
# ifdef GLES2_HEADER
|
||||
# include <SDL_opengles2.h>
|
||||
# define APIENTRYP GL_APIENTRYP
|
||||
# else
|
||||
# include <SDL_opengl.h>
|
||||
# endif // GLES2_HEADER
|
||||
#endif // MKXPZ_RETRO
|
||||
|
||||
/* Etc */
|
||||
typedef GLenum (APIENTRYP _PFNGLGETERRORPROC) (void);
|
||||
|
@ -58,7 +64,7 @@ typedef void (APIENTRYP _PFNGLGENERATEMIPMAPPROC) (GLenum target);
|
|||
typedef void (APIENTRYP _PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture);
|
||||
|
||||
/* Debugging */
|
||||
typedef void (APIENTRY * _GLDEBUGPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void *userParam);
|
||||
typedef void (APIENTRYP _GLDEBUGPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void *userParam);
|
||||
typedef void (APIENTRYP _PFNGLDEBUGMESSAGECALLBACKPROC) (_GLDEBUGPROC callback, const void *userParam);
|
||||
typedef void (APIENTRYP _PFNGLSTRINGMARKERPROC) (GLsizei len, const GLvoid *string);
|
||||
|
||||
|
|
5
subprojects/egl-registry.wrap
Normal file
5
subprojects/egl-registry.wrap
Normal file
|
@ -0,0 +1,5 @@
|
|||
[wrap-git]
|
||||
url = https://github.com/KhronosGroup/EGL-Registry
|
||||
revision = 29c4314e0ef04c730992d295f91b76635019fbba
|
||||
depth = 1
|
||||
patch_directory = egl-registry
|
5
subprojects/opengl-registry.wrap
Normal file
5
subprojects/opengl-registry.wrap
Normal file
|
@ -0,0 +1,5 @@
|
|||
[wrap-git]
|
||||
url = https://github.com/KhronosGroup/OpenGL-Registry
|
||||
revision = b53ca669bea4715b6d5fa53c459f47a1fecd7944
|
||||
depth = 1
|
||||
patch_directory = opengl-registry
|
2
subprojects/packagefiles/egl-registry/meson.build
Normal file
2
subprojects/packagefiles/egl-registry/meson.build
Normal file
|
@ -0,0 +1,2 @@
|
|||
project('egl-registry', 'c', meson_version: '>=1.3.0')
|
||||
egl_registry = declare_dependency(include_directories: 'api')
|
2
subprojects/packagefiles/opengl-registry/meson.build
Normal file
2
subprojects/packagefiles/opengl-registry/meson.build
Normal file
|
@ -0,0 +1,2 @@
|
|||
project('opengl-registry', 'c', meson_version: '>=1.3.0')
|
||||
opengl_registry = declare_dependency(include_directories: 'api', dependencies: [subproject('egl-registry').get_variable('egl_registry')])
|
Loading…
Add table
Reference in a new issue