build
[mupen64plus-pandora.git] / source / gles2rice / src / osal_opengl.h
CommitLineData
292f9317 1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Mupen64plus - osal_opengl.h *
3 * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
4 * Copyright (C) 2013 Richard Goedeken *
5 * *
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. *
10 * *
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. *
15 * *
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 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
21
22#if !defined(OSAL_OPENGL_H)
23#define OSAL_OPENGL_H
24
25#include <SDL_config.h>
26
27#undef SDL_VIDEO_OPENGL
28#define SDL_VIDEO_OPENGL_ES2 1
29
30
31#if SDL_VIDEO_OPENGL
32#include <SDL_opengl.h>
33#define GLSL_VERSION "120"
34
35// Extension names
36#define OSAL_GL_ARB_MULTITEXTURE "GL_ARB_multitexture"
37#define OSAL_GL_ARB_TEXTURE_ENV_ADD "GL_ARB_texture_env_add"
38
39
40
41#elif SDL_VIDEO_OPENGL_ES2
70282791 42//#include <SDL_opengles2.h>
43#include <GLES2/gl2.h>
44#include <GLES2/gl2ext.h>
45
292f9317 46#define GLSL_VERSION "100"
47
48// Extension names
49#define OSAL_GL_ARB_MULTITEXTURE "GL_multitexture"
50#define OSAL_GL_ARB_TEXTURE_ENV_ADD "GL_texture_env_add"
51
52// Vertex shader params
53#define VS_POSITION 0
54#define VS_COLOR 1
55#define VS_TEXCOORD0 2
56#define VS_TEXCOORD1 3
ea03ad21 57#define VS_FOG 4
292f9317 58
59// Constant substitutions
60#define GL_CLAMP GL_CLAMP_TO_EDGE
61#define GL_MAX_TEXTURE_UNITS_ARB GL_MAX_TEXTURE_IMAGE_UNITS
62#define GL_MIRRORED_REPEAT_ARB GL_MIRRORED_REPEAT
63#define GL_TEXTURE0_ARB GL_TEXTURE0
64#define GL_TEXTURE1_ARB GL_TEXTURE1
65#define GL_TEXTURE2_ARB GL_TEXTURE2
66#define GL_TEXTURE3_ARB GL_TEXTURE3
67#define GL_TEXTURE4_ARB GL_TEXTURE4
68#define GL_TEXTURE5_ARB GL_TEXTURE5
69#define GL_TEXTURE6_ARB GL_TEXTURE6
70#define GL_TEXTURE7_ARB GL_TEXTURE7
71
72#define GL_ADD 0x0104
73#define GL_MODULATE 0x2100
74#define GL_INTERPOLATE_ARB 0x8575
75#define GL_CONSTANT_ARB 0x8576
76#define GL_PREVIOUS_ARB 0x8578
77
78// Function substitutions
79#define glClearDepth glClearDepthf
80#define pglActiveTexture glActiveTexture
81#define pglActiveTextureARB glActiveTexture
82
83// No-op substitutions (unavailable in GLES2)
84#define glLoadIdentity()
85#define glMatrixMode(x)
86#define glOrtho(a,b,c,d,e,f)
87#define glReadBuffer(x)
88#define glTexEnvi(x,y,z)
89#define glTexEnvfv(x,y,z)
90#define glTexCoord2f(u,v)
91
92#endif // SDL_VIDEO_OPENGL*
93
94#endif // OSAL_OPENGL_H