RetroArch
glsm.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2018 The RetroArch team
2  *
3  * ---------------------------------------------------------------------------------------
4  * The following license statement only applies to this libretro SDK code part (glsm.h).
5  * ---------------------------------------------------------------------------------------
6  *
7  * Permission is hereby granted, free of charge,
8  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation the rights to
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef LIBRETRO_SDK_GLSM_H
24 #define LIBRETRO_SDK_GLSM_H
25 
26 #include <retro_common_api.h>
27 
28 #include <boolean.h>
29 #include <libretro.h>
30 #include <glsym/rglgen_headers.h>
31 
33 
34 #ifdef HAVE_OPENGLES2
35 typedef GLfloat GLdouble;
36 typedef GLclampf GLclampd;
37 #endif
38 
39 #if defined(HAVE_OPENGLES2)
40 #define RARCH_GL_RENDERBUFFER GL_RENDERBUFFER
41 #define RARCH_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
42 #define RARCH_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT
43 #define RARCH_GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT
44 #elif (defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
45 #define RARCH_GL_RENDERBUFFER GL_RENDERBUFFER_EXT
46 #define RARCH_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_EXT
47 #define RARCH_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_EXT
48 #define RARCH_GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_EXT
49 #elif defined(HAVE_PSGL)
50 #define RARCH_GL_RENDERBUFFER GL_RENDERBUFFER_OES
51 #define RARCH_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_SCE
52 #define RARCH_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_OES
53 #define RARCH_GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_OES
54 #else
55 #define RARCH_GL_RENDERBUFFER GL_RENDERBUFFER
56 #define RARCH_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8
57 #define RARCH_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT
58 #define RARCH_GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT
59 #endif
60 
61 #if defined(HAVE_PSGL)
62 #define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
63 #define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
64 #define RARCH_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
65 #elif (defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
66 #define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
67 #define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT
68 #define RARCH_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
69 #else
70 #define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER
71 #define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE
72 #define RARCH_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0
73 #endif
74 
75 #ifndef GL_FOG
76 #define GL_FOG 0x0B60
77 #endif
78 
79 #ifndef GL_ALPHA_TEST
80 #define GL_ALPHA_TEST 0x0BC0
81 #endif
82 
83 #ifndef GL_CLIP_DISTANCE0
84 #define GL_CLIP_DISTANCE0 0x3000
85 #endif
86 
87 #define MAX_ATTRIB 8
88 
89 enum
90 {
99 #if !defined(HAVE_OPENGLES)
102 #endif
106 #ifndef HAVE_OPENGLES
108 #endif
110 };
111 
113 {
127 };
128 
129 typedef bool (*glsm_imm_vbo_draw)(void *);
130 typedef bool (*glsm_imm_vbo_disable)(void *);
131 typedef bool (*glsm_framebuffer_lock)(void *);
132 
133 typedef struct glsm_ctx_proc_address
134 {
137 
138 typedef struct glsm_ctx_params
139 {
146  bool stencil;
147  unsigned major;
148  unsigned minor;
151 
153 
154 bool glsm_ctl(enum glsm_state_ctl state, void *data);
155 
157 
158 #endif
retro_hw_context_reset_t context_reset
Definition: glsm.h:143
retro_hw_context_type
Definition: libretro.h:1935
Definition: glsm.h:118
Definition: glsm.h:94
unsigned minor
Definition: glsm.h:148
double GLdouble
Definition: nx_gl.h:52
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
Definition: glsm.h:126
Definition: glsm.h:121
Definition: glsm.h:119
glsm_state_ctl
Definition: glsm.h:112
Definition: glsm.h:117
Definition: glsm.h:114
Definition: glsm.h:107
bool glsm_ctl(enum glsm_state_ctl state, void *data)
Definition: glsm.c:2860
Definition: glsm.h:98
unsigned int GLuint
Definition: nx_gl.h:48
Definition: glsm.h:100
Definition: glsm.h:104
bool(RETRO_CALLCONV * retro_environment_t)(unsigned cmd, void *data)
Definition: libretro.h:2325
Definition: ibxm.h:9
Definition: glsm.h:116
bool(* glsm_imm_vbo_draw)(void *)
Definition: glsm.h:129
typedef bool(RETRO_CALLCONV *retro_replace_image_index_t)(unsigned index
glsm_imm_vbo_disable imm_vbo_disable
Definition: glsm.h:142
Definition: glsm.h:122
Definition: glsm.h:105
Definition: glsm.h:125
Definition: glsm.h:93
struct glsm_ctx_proc_address glsm_ctx_proc_address_t
Definition: glsm.h:138
Definition: glsm.h:109
Definition: glsm.h:115
bool stencil
Definition: glsm.h:146
Definition: glsm.h:95
Definition: glsm.h:91
float GLclampf
Definition: nx_gl.h:51
Definition: glsm.h:101
unsigned major
Definition: glsm.h:147
bool(* glsm_framebuffer_lock)(void *)
Definition: glsm.h:131
Definition: glsm.h:124
retro_proc_address_t(RETRO_CALLCONV * retro_get_proc_address_t)(const char *sym)
Definition: libretro.h:1557
float GLfloat
Definition: nx_gl.h:50
static uint64_t state[MAX_PADS]
Definition: xenon360_input.c:33
Definition: glsm.h:92
enum retro_hw_context_type context_type
Definition: glsm.h:149
Definition: glsm.h:133
Definition: glsm.h:103
Definition: glsm.h:97
retro_environment_t environ_cb
Definition: glsm.h:145
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
retro_hw_context_reset_t context_destroy
Definition: glsm.h:144
retro_get_proc_address_t addr
Definition: glsm.h:135
double GLclampd
Definition: nx_gl.h:53
glsm_imm_vbo_draw imm_vbo_draw
Definition: glsm.h:141
struct glsm_ctx_params glsm_ctx_params_t
Definition: glsm.h:96
glsm_framebuffer_lock framebuffer_lock
Definition: glsm.h:140
bool(* glsm_imm_vbo_disable)(void *)
Definition: glsm.h:130
Definition: glsm.h:120
GLuint glsm_get_current_framebuffer(void)
Definition: glsm.c:2855
void(RETRO_CALLCONV * retro_hw_context_reset_t)(void)
Definition: libretro.h:1925
Definition: glsm.h:123