1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
* Mupen64plus - osal_opengl.h *
3
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
4
* Copyright (C) 2013 Richard Goedeken *
6
* This program is free software; you can redistribute it and/or modify *
7
* it under the terms of the GNU General Public License as published by *
8
* the Free Software Foundation; either version 2 of the License, or *
9
* (at your option) any later version. *
11
* This program is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU General Public License for more details. *
16
* You should have received a copy of the GNU General Public License *
17
* along with this program; if not, write to the *
18
* Free Software Foundation, Inc., *
19
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
22
#if !defined(OSAL_OPENGL_H)
25
#include <SDL_config.h>
28
#include <SDL_opengl.h>
29
#define GLSL_VERSION "120"
32
#define OSAL_GL_ARB_MULTITEXTURE "GL_ARB_multitexture"
33
#define OSAL_GL_ARB_TEXTURE_ENV_ADD "GL_ARB_texture_env_add"
37
#elif SDL_VIDEO_OPENGL_ES2
38
#include <SDL_opengles2.h>
39
#define GLSL_VERSION "100"
42
#define OSAL_GL_ARB_MULTITEXTURE "GL_multitexture"
43
#define OSAL_GL_ARB_TEXTURE_ENV_ADD "GL_texture_env_add"
45
// Vertex shader params
48
#define VS_TEXCOORD0 2
49
#define VS_TEXCOORD1 3
51
// Constant substitutions
52
#define GL_CLAMP GL_CLAMP_TO_EDGE
53
#define GL_MAX_TEXTURE_UNITS_ARB GL_MAX_TEXTURE_IMAGE_UNITS
54
#define GL_MIRRORED_REPEAT_ARB GL_MIRRORED_REPEAT
55
#define GL_TEXTURE0_ARB GL_TEXTURE0
56
#define GL_TEXTURE1_ARB GL_TEXTURE1
57
#define GL_TEXTURE2_ARB GL_TEXTURE2
58
#define GL_TEXTURE3_ARB GL_TEXTURE3
59
#define GL_TEXTURE4_ARB GL_TEXTURE4
60
#define GL_TEXTURE5_ARB GL_TEXTURE5
61
#define GL_TEXTURE6_ARB GL_TEXTURE6
62
#define GL_TEXTURE7_ARB GL_TEXTURE7
65
#define GL_MODULATE 0x2100
66
#define GL_INTERPOLATE_ARB 0x8575
67
#define GL_CONSTANT_ARB 0x8576
68
#define GL_PREVIOUS_ARB 0x8578
70
// Function substitutions
71
#define glClearDepth glClearDepthf
72
#define pglActiveTexture glActiveTexture
73
#define pglActiveTextureARB glActiveTexture
75
// No-op substitutions (unavailable in GLES2)
76
#define glLoadIdentity()
77
#define glMatrixMode(x)
78
#define glOrtho(a,b,c,d,e,f)
79
#define glReadBuffer(x)
80
#define glTexEnvi(x,y,z)
81
#define glTexEnvfv(x,y,z)
82
#define glTexCoord2f(u,v)
84
#endif // SDL_VIDEO_OPENGL*
86
#endif // OSAL_OPENGL_H