1 // Generated Code - DO NOT EDIT !!
2 // generated by 'emugen'
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include "renderControl_client_context.h"
6
7 extern "C" {
8 GLint rcGetRendererVersion();
9 EGLint rcGetEGLVersion(EGLint* major, EGLint* minor);
10 EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize);
11 EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize);
12 EGLint rcGetNumConfigs(uint32_t* numAttribs);
13 EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer);
14 EGLint rcChooseConfig(EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size);
15 EGLint rcGetFBParam(EGLint param);
16 uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion);
17 void rcDestroyContext(uint32_t context);
18 uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height);
19 void rcDestroyWindowSurface(uint32_t windowSurface);
20 uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat);
21 void rcOpenColorBuffer(uint32_t colorbuffer);
22 void rcCloseColorBuffer(uint32_t colorbuffer);
23 void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer);
24 int rcFlushWindowColorBuffer(uint32_t windowSurface);
25 EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf);
26 void rcFBPost(uint32_t colorBuffer);
27 void rcFBSetSwapInterval(EGLint interval);
28 void rcBindTexture(uint32_t colorBuffer);
29 void rcBindRenderbuffer(uint32_t colorBuffer);
30 EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead);
31 void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels);
32 int rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels);
33 int rcOpenColorBuffer2(uint32_t colorbuffer);
34 uint32_t rcCreateClientImage(uint32_t context, EGLenum target, GLuint buffer);
35 int rcDestroyClientImage(uint32_t image);
36 void rcSelectChecksumHelper(uint32_t newProtocol, uint32_t reserved);
37 void rcCreateSyncKHR(EGLenum type, EGLint* attribs, uint32_t num_attribs, int destroy_when_signaled, uint64_t* glsync_out, uint64_t* syncthread_out);
38 EGLint rcClientWaitSyncKHR(uint64_t sync, EGLint flags, uint64_t timeout);
39 void rcFlushWindowColorBufferAsync(uint32_t windowSurface);
40 int rcDestroySyncKHR(uint64_t sync);
41 void rcSetPuid(uint64_t puid);
42 int rcUpdateColorBufferDMA(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels, uint32_t pixels_size);
43 uint32_t rcCreateColorBufferDMA(uint32_t width, uint32_t height, GLenum internalFormat, int frameworkFormat);
44 void rcWaitSyncKHR(uint64_t sync, EGLint flags);
45 GLint rcCompose(uint32_t bufferSize, void* buffer);
46 GLint rcCreateDisplay(uint32_t* displayId);
47 GLint rcDestroyDisplay(uint32_t displayId);
48 GLint rcSetDisplayColorBuffer(uint32_t displayId, uint32_t colorBuffer);
49 GLint rcGetDisplayColorBuffer(uint32_t displayId, uint32_t* colorBuffer);
50 GLint rcGetColorBufferDisplay(uint32_t colorBuffer, uint32_t* displayId);
51 GLint rcGetDisplayPose(uint32_t displayId, uint32_t* x, uint32_t* y, uint32_t* w, uint32_t* h);
52 GLint rcSetDisplayPose(uint32_t displayId, uint32_t x, uint32_t y, uint32_t w, uint32_t h);
53 };
54
55 #ifndef GET_CONTEXT
56 static renderControl_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
setContextAccessor(CONTEXT_ACCESSOR_TYPE * f)57 void renderControl_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
58 #define GET_CONTEXT renderControl_client_context_t * ctx = getCurrentContext()
59 #endif
60
rcGetRendererVersion()61 GLint rcGetRendererVersion()
62 {
63 GET_CONTEXT;
64 return ctx->rcGetRendererVersion(ctx);
65 }
66
rcGetEGLVersion(EGLint * major,EGLint * minor)67 EGLint rcGetEGLVersion(EGLint* major, EGLint* minor)
68 {
69 GET_CONTEXT;
70 return ctx->rcGetEGLVersion(ctx, major, minor);
71 }
72
rcQueryEGLString(EGLenum name,void * buffer,EGLint bufferSize)73 EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize)
74 {
75 GET_CONTEXT;
76 return ctx->rcQueryEGLString(ctx, name, buffer, bufferSize);
77 }
78
rcGetGLString(EGLenum name,void * buffer,EGLint bufferSize)79 EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize)
80 {
81 GET_CONTEXT;
82 return ctx->rcGetGLString(ctx, name, buffer, bufferSize);
83 }
84
rcGetNumConfigs(uint32_t * numAttribs)85 EGLint rcGetNumConfigs(uint32_t* numAttribs)
86 {
87 GET_CONTEXT;
88 return ctx->rcGetNumConfigs(ctx, numAttribs);
89 }
90
rcGetConfigs(uint32_t bufSize,GLuint * buffer)91 EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer)
92 {
93 GET_CONTEXT;
94 return ctx->rcGetConfigs(ctx, bufSize, buffer);
95 }
96
rcChooseConfig(EGLint * attribs,uint32_t attribs_size,uint32_t * configs,uint32_t configs_size)97 EGLint rcChooseConfig(EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size)
98 {
99 GET_CONTEXT;
100 return ctx->rcChooseConfig(ctx, attribs, attribs_size, configs, configs_size);
101 }
102
rcGetFBParam(EGLint param)103 EGLint rcGetFBParam(EGLint param)
104 {
105 GET_CONTEXT;
106 return ctx->rcGetFBParam(ctx, param);
107 }
108
rcCreateContext(uint32_t config,uint32_t share,uint32_t glVersion)109 uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion)
110 {
111 GET_CONTEXT;
112 return ctx->rcCreateContext(ctx, config, share, glVersion);
113 }
114
rcDestroyContext(uint32_t context)115 void rcDestroyContext(uint32_t context)
116 {
117 GET_CONTEXT;
118 ctx->rcDestroyContext(ctx, context);
119 }
120
rcCreateWindowSurface(uint32_t config,uint32_t width,uint32_t height)121 uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height)
122 {
123 GET_CONTEXT;
124 return ctx->rcCreateWindowSurface(ctx, config, width, height);
125 }
126
rcDestroyWindowSurface(uint32_t windowSurface)127 void rcDestroyWindowSurface(uint32_t windowSurface)
128 {
129 GET_CONTEXT;
130 ctx->rcDestroyWindowSurface(ctx, windowSurface);
131 }
132
rcCreateColorBuffer(uint32_t width,uint32_t height,GLenum internalFormat)133 uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat)
134 {
135 GET_CONTEXT;
136 return ctx->rcCreateColorBuffer(ctx, width, height, internalFormat);
137 }
138
rcOpenColorBuffer(uint32_t colorbuffer)139 void rcOpenColorBuffer(uint32_t colorbuffer)
140 {
141 GET_CONTEXT;
142 ctx->rcOpenColorBuffer(ctx, colorbuffer);
143 }
144
rcCloseColorBuffer(uint32_t colorbuffer)145 void rcCloseColorBuffer(uint32_t colorbuffer)
146 {
147 GET_CONTEXT;
148 ctx->rcCloseColorBuffer(ctx, colorbuffer);
149 }
150
rcSetWindowColorBuffer(uint32_t windowSurface,uint32_t colorBuffer)151 void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer)
152 {
153 GET_CONTEXT;
154 ctx->rcSetWindowColorBuffer(ctx, windowSurface, colorBuffer);
155 }
156
rcFlushWindowColorBuffer(uint32_t windowSurface)157 int rcFlushWindowColorBuffer(uint32_t windowSurface)
158 {
159 GET_CONTEXT;
160 return ctx->rcFlushWindowColorBuffer(ctx, windowSurface);
161 }
162
rcMakeCurrent(uint32_t context,uint32_t drawSurf,uint32_t readSurf)163 EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf)
164 {
165 GET_CONTEXT;
166 return ctx->rcMakeCurrent(ctx, context, drawSurf, readSurf);
167 }
168
rcFBPost(uint32_t colorBuffer)169 void rcFBPost(uint32_t colorBuffer)
170 {
171 GET_CONTEXT;
172 ctx->rcFBPost(ctx, colorBuffer);
173 }
174
rcFBSetSwapInterval(EGLint interval)175 void rcFBSetSwapInterval(EGLint interval)
176 {
177 GET_CONTEXT;
178 ctx->rcFBSetSwapInterval(ctx, interval);
179 }
180
rcBindTexture(uint32_t colorBuffer)181 void rcBindTexture(uint32_t colorBuffer)
182 {
183 GET_CONTEXT;
184 ctx->rcBindTexture(ctx, colorBuffer);
185 }
186
rcBindRenderbuffer(uint32_t colorBuffer)187 void rcBindRenderbuffer(uint32_t colorBuffer)
188 {
189 GET_CONTEXT;
190 ctx->rcBindRenderbuffer(ctx, colorBuffer);
191 }
192
rcColorBufferCacheFlush(uint32_t colorbuffer,EGLint postCount,int forRead)193 EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead)
194 {
195 GET_CONTEXT;
196 return ctx->rcColorBufferCacheFlush(ctx, colorbuffer, postCount, forRead);
197 }
198
rcReadColorBuffer(uint32_t colorbuffer,GLint x,GLint y,GLint width,GLint height,GLenum format,GLenum type,void * pixels)199 void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
200 {
201 GET_CONTEXT;
202 ctx->rcReadColorBuffer(ctx, colorbuffer, x, y, width, height, format, type, pixels);
203 }
204
rcUpdateColorBuffer(uint32_t colorbuffer,GLint x,GLint y,GLint width,GLint height,GLenum format,GLenum type,void * pixels)205 int rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
206 {
207 GET_CONTEXT;
208 return ctx->rcUpdateColorBuffer(ctx, colorbuffer, x, y, width, height, format, type, pixels);
209 }
210
rcOpenColorBuffer2(uint32_t colorbuffer)211 int rcOpenColorBuffer2(uint32_t colorbuffer)
212 {
213 GET_CONTEXT;
214 return ctx->rcOpenColorBuffer2(ctx, colorbuffer);
215 }
216
rcCreateClientImage(uint32_t context,EGLenum target,GLuint buffer)217 uint32_t rcCreateClientImage(uint32_t context, EGLenum target, GLuint buffer)
218 {
219 GET_CONTEXT;
220 return ctx->rcCreateClientImage(ctx, context, target, buffer);
221 }
222
rcDestroyClientImage(uint32_t image)223 int rcDestroyClientImage(uint32_t image)
224 {
225 GET_CONTEXT;
226 return ctx->rcDestroyClientImage(ctx, image);
227 }
228
rcSelectChecksumHelper(uint32_t newProtocol,uint32_t reserved)229 void rcSelectChecksumHelper(uint32_t newProtocol, uint32_t reserved)
230 {
231 GET_CONTEXT;
232 ctx->rcSelectChecksumHelper(ctx, newProtocol, reserved);
233 }
234
rcCreateSyncKHR(EGLenum type,EGLint * attribs,uint32_t num_attribs,int destroy_when_signaled,uint64_t * glsync_out,uint64_t * syncthread_out)235 void rcCreateSyncKHR(EGLenum type, EGLint* attribs, uint32_t num_attribs, int destroy_when_signaled, uint64_t* glsync_out, uint64_t* syncthread_out)
236 {
237 GET_CONTEXT;
238 ctx->rcCreateSyncKHR(ctx, type, attribs, num_attribs, destroy_when_signaled, glsync_out, syncthread_out);
239 }
240
rcClientWaitSyncKHR(uint64_t sync,EGLint flags,uint64_t timeout)241 EGLint rcClientWaitSyncKHR(uint64_t sync, EGLint flags, uint64_t timeout)
242 {
243 GET_CONTEXT;
244 return ctx->rcClientWaitSyncKHR(ctx, sync, flags, timeout);
245 }
246
rcFlushWindowColorBufferAsync(uint32_t windowSurface)247 void rcFlushWindowColorBufferAsync(uint32_t windowSurface)
248 {
249 GET_CONTEXT;
250 ctx->rcFlushWindowColorBufferAsync(ctx, windowSurface);
251 }
252
rcDestroySyncKHR(uint64_t sync)253 int rcDestroySyncKHR(uint64_t sync)
254 {
255 GET_CONTEXT;
256 return ctx->rcDestroySyncKHR(ctx, sync);
257 }
258
rcSetPuid(uint64_t puid)259 void rcSetPuid(uint64_t puid)
260 {
261 GET_CONTEXT;
262 ctx->rcSetPuid(ctx, puid);
263 }
264
rcUpdateColorBufferDMA(uint32_t colorbuffer,GLint x,GLint y,GLint width,GLint height,GLenum format,GLenum type,void * pixels,uint32_t pixels_size)265 int rcUpdateColorBufferDMA(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels, uint32_t pixels_size)
266 {
267 GET_CONTEXT;
268 return ctx->rcUpdateColorBufferDMA(ctx, colorbuffer, x, y, width, height, format, type, pixels, pixels_size);
269 }
270
rcCreateColorBufferDMA(uint32_t width,uint32_t height,GLenum internalFormat,int frameworkFormat)271 uint32_t rcCreateColorBufferDMA(uint32_t width, uint32_t height, GLenum internalFormat, int frameworkFormat)
272 {
273 GET_CONTEXT;
274 return ctx->rcCreateColorBufferDMA(ctx, width, height, internalFormat, frameworkFormat);
275 }
276
rcWaitSyncKHR(uint64_t sync,EGLint flags)277 void rcWaitSyncKHR(uint64_t sync, EGLint flags)
278 {
279 GET_CONTEXT;
280 ctx->rcWaitSyncKHR(ctx, sync, flags);
281 }
282
rcCompose(uint32_t bufferSize,void * buffer)283 GLint rcCompose(uint32_t bufferSize, void* buffer)
284 {
285 GET_CONTEXT;
286 return ctx->rcCompose(ctx, bufferSize, buffer);
287 }
288
rcCreateDisplay(uint32_t * displayId)289 GLint rcCreateDisplay(uint32_t* displayId)
290 {
291 GET_CONTEXT;
292 return ctx->rcCreateDisplay(ctx, displayId);
293 }
294
rcDestroyDisplay(uint32_t displayId)295 GLint rcDestroyDisplay(uint32_t displayId)
296 {
297 GET_CONTEXT;
298 return ctx->rcDestroyDisplay(ctx, displayId);
299 }
300
rcSetDisplayColorBuffer(uint32_t displayId,uint32_t colorBuffer)301 GLint rcSetDisplayColorBuffer(uint32_t displayId, uint32_t colorBuffer)
302 {
303 GET_CONTEXT;
304 return ctx->rcSetDisplayColorBuffer(ctx, displayId, colorBuffer);
305 }
306
rcGetDisplayColorBuffer(uint32_t displayId,uint32_t * colorBuffer)307 GLint rcGetDisplayColorBuffer(uint32_t displayId, uint32_t* colorBuffer)
308 {
309 GET_CONTEXT;
310 return ctx->rcGetDisplayColorBuffer(ctx, displayId, colorBuffer);
311 }
312
rcGetColorBufferDisplay(uint32_t colorBuffer,uint32_t * displayId)313 GLint rcGetColorBufferDisplay(uint32_t colorBuffer, uint32_t* displayId)
314 {
315 GET_CONTEXT;
316 return ctx->rcGetColorBufferDisplay(ctx, colorBuffer, displayId);
317 }
318
rcGetDisplayPose(uint32_t displayId,uint32_t * x,uint32_t * y,uint32_t * w,uint32_t * h)319 GLint rcGetDisplayPose(uint32_t displayId, uint32_t* x, uint32_t* y, uint32_t* w, uint32_t* h)
320 {
321 GET_CONTEXT;
322 return ctx->rcGetDisplayPose(ctx, displayId, x, y, w, h);
323 }
324
rcSetDisplayPose(uint32_t displayId,uint32_t x,uint32_t y,uint32_t w,uint32_t h)325 GLint rcSetDisplayPose(uint32_t displayId, uint32_t x, uint32_t y, uint32_t w, uint32_t h)
326 {
327 GET_CONTEXT;
328 return ctx->rcSetDisplayPose(ctx, displayId, x, y, w, h);
329 }
330
331