mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Fix Mac OS X compilation errors.
This commit is contained in:
parent
09eea95270
commit
929fafa7a1
|
@ -1,4 +1,8 @@
|
||||||
|
#ifdef OS_MAC_OS_X
|
||||||
|
#include <malloc/malloc.h>
|
||||||
|
#else
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "OpenGL.h"
|
#include "OpenGL.h"
|
||||||
#include "Combiner.h"
|
#include "Combiner.h"
|
||||||
|
|
|
@ -54,6 +54,15 @@ private:
|
||||||
iv2Uniform uCacheFrameBuffer;
|
iv2Uniform uCacheFrameBuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef OS_MAC_OS_X
|
||||||
|
#define glUniform1i glUniform1iARB
|
||||||
|
#define glUniform1f glUniform1fARB
|
||||||
|
#define glUniform2f glUniform2fARB
|
||||||
|
#define glUniform2i glUniform2iARB
|
||||||
|
#define glUniform3fv glUniform3fvARB
|
||||||
|
#define glUniform4fv glUniform4fvARB
|
||||||
|
#endif
|
||||||
|
|
||||||
void _locate_attributes() const;
|
void _locate_attributes() const;
|
||||||
void _locateUniforms();
|
void _locateUniforms();
|
||||||
void _setIUniform(iUniform & _u, int _val, bool _force) {
|
void _setIUniform(iUniform & _u, int _val, bool _force) {
|
||||||
|
|
1
OpenGL.h
1
OpenGL.h
|
@ -19,6 +19,7 @@
|
||||||
#define GL_GLEXT_PROTOTYPES
|
#define GL_GLEXT_PROTOTYPES
|
||||||
#if defined(OS_MAC_OS_X)
|
#if defined(OS_MAC_OS_X)
|
||||||
#include <OpenGL/OpenGL.h>
|
#include <OpenGL/OpenGL.h>
|
||||||
|
#include <OpenGL/gl.h>
|
||||||
#include <OpenGL/glext.h>
|
#include <OpenGL/glext.h>
|
||||||
#elif defined(OS_LINUX)
|
#elif defined(OS_LINUX)
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
|
19
Shaders.h
19
Shaders.h
|
@ -309,13 +309,6 @@ static const char* fragment_shader_toonify =
|
||||||
;
|
;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char* fragment_shader_default =
|
|
||||||
//" gl_FragColor = texture2D(uTex0, gl_TexCoord[0].st); \n"
|
|
||||||
//" gl_FragColor = gl_Color; \n"
|
|
||||||
" vec4 color = texture2D(uTex0, vTexCoord0); \n"
|
|
||||||
" gl_FragColor = vShadeColor*color; \n"
|
|
||||||
;
|
|
||||||
|
|
||||||
#ifdef GLES2
|
#ifdef GLES2
|
||||||
static const char* fragment_shader_readtex0color =
|
static const char* fragment_shader_readtex0color =
|
||||||
" lowp vec4 readtex0 = texture2D(uTex0, vTexCoord0); \n"
|
" lowp vec4 readtex0 = texture2D(uTex0, vTexCoord0); \n"
|
||||||
|
@ -344,6 +337,11 @@ static const char* fragment_shader_readtex1color =
|
||||||
" if (uFbFixedAlpha == 2 || uFbFixedAlpha == 3) readtex1.a = 0.825; \n"
|
" if (uFbFixedAlpha == 2 || uFbFixedAlpha == 3) readtex1.a = 0.825; \n"
|
||||||
;
|
;
|
||||||
|
|
||||||
|
static const char* fragment_shader_end =
|
||||||
|
"} \n"
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
static const char* fragment_shader_mipmap =
|
static const char* fragment_shader_mipmap =
|
||||||
#ifdef GLES2
|
#ifdef GLES2
|
||||||
"uniform lowp int uEnableLod; \n"
|
"uniform lowp int uEnableLod; \n"
|
||||||
|
@ -482,11 +480,7 @@ static const char* fragment_shader_mipmap =
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
static const char* fragment_shader_end =
|
#ifdef GL_IMAGE_TEXTURES_SUPPORT
|
||||||
"} \n"
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
|
|
||||||
static const char* depth_compare_shader_float =
|
static const char* depth_compare_shader_float =
|
||||||
"#version 420 core \n"
|
"#version 420 core \n"
|
||||||
"uniform int uEnableDepth; \n"
|
"uniform int uEnableDepth; \n"
|
||||||
|
@ -577,3 +571,4 @@ static const char* shadow_map_fragment_shader_float =
|
||||||
" gl_FragColor = vec4(uFogColor.rgb, get_alpha()); \n"
|
" gl_FragColor = vec4(uFogColor.rgb, get_alpha()); \n"
|
||||||
"} \n"
|
"} \n"
|
||||||
;
|
;
|
||||||
|
#endif // GL_IMAGE_TEXTURES_SUPPORT
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
#include <GLES2/gl2.h>
|
#include <GLES2/gl2.h>
|
||||||
|
#elif defined (OS_MAC_OS_X)
|
||||||
|
#include <OpenGL/gl.h>
|
||||||
#else
|
#else
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#endif //ANDROID
|
#endif //ANDROID
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
#ifndef WINLNXDEFS_H
|
#ifndef WINLNXDEFS_H
|
||||||
#define WINLNXDEFS_H
|
#define WINLNXDEFS_H
|
||||||
|
|
||||||
#include <features.h> // we want GNU extensions
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h> // PATH_MAX
|
#include <limits.h> // PATH_MAX
|
||||||
|
|
Loading…
Reference in New Issue
Block a user