1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Fix Mac OS X compilation errors.

This commit is contained in:
Sergey Lipskiy 2014-10-13 19:38:51 +07:00
parent 09eea95270
commit 929fafa7a1
6 changed files with 23 additions and 13 deletions

View File

@ -1,4 +1,8 @@
#ifdef OS_MAC_OS_X
#include <malloc/malloc.h>
#else
#include <malloc.h>
#endif
#include <assert.h>
#include "OpenGL.h"
#include "Combiner.h"

View File

@ -54,6 +54,15 @@ private:
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 _locateUniforms();
void _setIUniform(iUniform & _u, int _val, bool _force) {

View File

@ -19,6 +19,7 @@
#define GL_GLEXT_PROTOTYPES
#if defined(OS_MAC_OS_X)
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
#elif defined(OS_LINUX)
#include <GL/gl.h>

View File

@ -309,13 +309,6 @@ static const char* fragment_shader_toonify =
;
#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
static const char* fragment_shader_readtex0color =
" 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"
;
static const char* fragment_shader_end =
"} \n"
#endif
;
static const char* fragment_shader_mipmap =
#ifdef GLES2
"uniform lowp int uEnableLod; \n"
@ -482,11 +480,7 @@ static const char* fragment_shader_mipmap =
#endif
;
static const char* fragment_shader_end =
"} \n"
#endif
;
#ifdef GL_IMAGE_TEXTURES_SUPPORT
static const char* depth_compare_shader_float =
"#version 420 core \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"
"} \n"
;
#endif // GL_IMAGE_TEXTURES_SUPPORT

View File

@ -3,6 +3,8 @@
#ifdef ANDROID
#include <GLES2/gl2.h>
#elif defined (OS_MAC_OS_X)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif //ANDROID

View File

@ -30,7 +30,6 @@
#ifndef WINLNXDEFS_H
#define WINLNXDEFS_H
#include <features.h> // we want GNU extensions
#include <dlfcn.h>
#include <errno.h>
#include <limits.h> // PATH_MAX