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 int rcCreateDisplay(uint32_t* displayId);
47 int rcDestroyDisplay(uint32_t displayId);
48 int rcSetDisplayColorBuffer(uint32_t displayId, uint32_t colorBuffer);
49 int rcGetDisplayColorBuffer(uint32_t displayId, uint32_t* colorBuffer);
50 int rcGetColorBufferDisplay(uint32_t colorBuffer, uint32_t* displayId);
51 int rcGetDisplayPose(uint32_t displayId, GLint* x, GLint* y, uint32_t* w, uint32_t* h);
52 int rcSetDisplayPose(uint32_t displayId, GLint x, GLint y, uint32_t w, uint32_t h);
53 GLint rcSetColorBufferVulkanMode(uint32_t colorBuffer, uint32_t mode);
54 void rcReadColorBufferYUV(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, void* pixels, uint32_t pixels_size);
55 int rcIsSyncSignaled(uint64_t sync);
56 void rcCreateColorBufferWithHandle(uint32_t width, uint32_t height, GLenum internalFormat, uint32_t handle);
57 uint32_t rcCreateBuffer(uint32_t size);
58 void rcCloseBuffer(uint32_t buffer);
59 };
60
61 #ifndef GET_CONTEXT
62 static renderControl_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
setContextAccessor(CONTEXT_ACCESSOR_TYPE * f)63 void renderControl_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
64 #define GET_CONTEXT renderControl_client_context_t * ctx = getCurrentContext()
65 #endif
66
rcGetRendererVersion()67 GLint rcGetRendererVersion()
68 {
69 GET_CONTEXT;
70 return ctx->rcGetRendererVersion(ctx);
71 }
72
rcGetEGLVersion(EGLint * major,EGLint * minor)73 EGLint rcGetEGLVersion(EGLint* major, EGLint* minor)
74 {
75 GET_CONTEXT;
76 return ctx->rcGetEGLVersion(ctx, major, minor);
77 }
78
rcQueryEGLString(EGLenum name,void * buffer,EGLint bufferSize)79 EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize)
80 {
81 GET_CONTEXT;
82 return ctx->rcQueryEGLString(ctx, name, buffer, bufferSize);
83 }
84
rcGetGLString(EGLenum name,void * buffer,EGLint bufferSize)85 EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize)
86 {
87 GET_CONTEXT;
88 return ctx->rcGetGLString(ctx, name, buffer, bufferSize);
89 }
90
rcGetNumConfigs(uint32_t * numAttribs)91 EGLint rcGetNumConfigs(uint32_t* numAttribs)
92 {
93 GET_CONTEXT;
94 return ctx->rcGetNumConfigs(ctx, numAttribs);
95 }
96
rcGetConfigs(uint32_t bufSize,GLuint * buffer)97 EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer)
98 {
99 GET_CONTEXT;
100 return ctx->rcGetConfigs(ctx, bufSize, buffer);
101 }
102
rcChooseConfig(EGLint * attribs,uint32_t attribs_size,uint32_t * configs,uint32_t configs_size)103 EGLint rcChooseConfig(EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size)
104 {
105 GET_CONTEXT;
106 return ctx->rcChooseConfig(ctx, attribs, attribs_size, configs, configs_size);
107 }
108
rcGetFBParam(EGLint param)109 EGLint rcGetFBParam(EGLint param)
110 {
111 GET_CONTEXT;
112 return ctx->rcGetFBParam(ctx, param);
113 }
114
rcCreateContext(uint32_t config,uint32_t share,uint32_t glVersion)115 uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion)
116 {
117 GET_CONTEXT;
118 return ctx->rcCreateContext(ctx, config, share, glVersion);
119 }
120
rcDestroyContext(uint32_t context)121 void rcDestroyContext(uint32_t context)
122 {
123 GET_CONTEXT;
124 ctx->rcDestroyContext(ctx, context);
125 }
126
rcCreateWindowSurface(uint32_t config,uint32_t width,uint32_t height)127 uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height)
128 {
129 GET_CONTEXT;
130 return ctx->rcCreateWindowSurface(ctx, config, width, height);
131 }
132
rcDestroyWindowSurface(uint32_t windowSurface)133 void rcDestroyWindowSurface(uint32_t windowSurface)
134 {
135 GET_CONTEXT;
136 ctx->rcDestroyWindowSurface(ctx, windowSurface);
137 }
138
rcCreateColorBuffer(uint32_t width,uint32_t height,GLenum internalFormat)139 uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat)
140 {
141 GET_CONTEXT;
142 return ctx->rcCreateColorBuffer(ctx, width, height, internalFormat);
143 }
144
rcOpenColorBuffer(uint32_t colorbuffer)145 void rcOpenColorBuffer(uint32_t colorbuffer)
146 {
147 GET_CONTEXT;
148 ctx->rcOpenColorBuffer(ctx, colorbuffer);
149 }
150
rcCloseColorBuffer(uint32_t colorbuffer)151 void rcCloseColorBuffer(uint32_t colorbuffer)
152 {
153 GET_CONTEXT;
154 ctx->rcCloseColorBuffer(ctx, colorbuffer);
155 }
156
rcSetWindowColorBuffer(uint32_t windowSurface,uint32_t colorBuffer)157 void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer)
158 {
159 GET_CONTEXT;
160 ctx->rcSetWindowColorBuffer(ctx, windowSurface, colorBuffer);
161 }
162
rcFlushWindowColorBuffer(uint32_t windowSurface)163 int rcFlushWindowColorBuffer(uint32_t windowSurface)
164 {
165 GET_CONTEXT;
166 return ctx->rcFlushWindowColorBuffer(ctx, windowSurface);
167 }
168
rcMakeCurrent(uint32_t context,uint32_t drawSurf,uint32_t readSurf)169 EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf)
170 {
171 GET_CONTEXT;
172 return ctx->rcMakeCurrent(ctx, context, drawSurf, readSurf);
173 }
174
rcFBPost(uint32_t colorBuffer)175 void rcFBPost(uint32_t colorBuffer)
176 {
177 GET_CONTEXT;
178 ctx->rcFBPost(ctx, colorBuffer);
179 }
180
rcFBSetSwapInterval(EGLint interval)181 void rcFBSetSwapInterval(EGLint interval)
182 {
183 GET_CONTEXT;
184 ctx->rcFBSetSwapInterval(ctx, interval);
185 }
186
rcBindTexture(uint32_t colorBuffer)187 void rcBindTexture(uint32_t colorBuffer)
188 {
189 GET_CONTEXT;
190 ctx->rcBindTexture(ctx, colorBuffer);
191 }
192
rcBindRenderbuffer(uint32_t colorBuffer)193 void rcBindRenderbuffer(uint32_t colorBuffer)
194 {
195 GET_CONTEXT;
196 ctx->rcBindRenderbuffer(ctx, colorBuffer);
197 }
198
rcColorBufferCacheFlush(uint32_t colorbuffer,EGLint postCount,int forRead)199 EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead)
200 {
201 GET_CONTEXT;
202 return ctx->rcColorBufferCacheFlush(ctx, colorbuffer, postCount, forRead);
203 }
204
rcReadColorBuffer(uint32_t colorbuffer,GLint x,GLint y,GLint width,GLint height,GLenum format,GLenum type,void * pixels)205 void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
206 {
207 GET_CONTEXT;
208 ctx->rcReadColorBuffer(ctx, colorbuffer, x, y, width, height, format, type, pixels);
209 }
210
rcUpdateColorBuffer(uint32_t colorbuffer,GLint x,GLint y,GLint width,GLint height,GLenum format,GLenum type,void * pixels)211 int rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
212 {
213 GET_CONTEXT;
214 return ctx->rcUpdateColorBuffer(ctx, colorbuffer, x, y, width, height, format, type, pixels);
215 }
216
rcOpenColorBuffer2(uint32_t colorbuffer)217 int rcOpenColorBuffer2(uint32_t colorbuffer)
218 {
219 GET_CONTEXT;
220 return ctx->rcOpenColorBuffer2(ctx, colorbuffer);
221 }
222
rcCreateClientImage(uint32_t context,EGLenum target,GLuint buffer)223 uint32_t rcCreateClientImage(uint32_t context, EGLenum target, GLuint buffer)
224 {
225 GET_CONTEXT;
226 return ctx->rcCreateClientImage(ctx, context, target, buffer);
227 }
228
rcDestroyClientImage(uint32_t image)229 int rcDestroyClientImage(uint32_t image)
230 {
231 GET_CONTEXT;
232 return ctx->rcDestroyClientImage(ctx, image);
233 }
234
rcSelectChecksumHelper(uint32_t newProtocol,uint32_t reserved)235 void rcSelectChecksumHelper(uint32_t newProtocol, uint32_t reserved)
236 {
237 GET_CONTEXT;
238 ctx->rcSelectChecksumHelper(ctx, newProtocol, reserved);
239 }
240
rcCreateSyncKHR(EGLenum type,EGLint * attribs,uint32_t num_attribs,int destroy_when_signaled,uint64_t * glsync_out,uint64_t * syncthread_out)241 void rcCreateSyncKHR(EGLenum type, EGLint* attribs, uint32_t num_attribs, int destroy_when_signaled, uint64_t* glsync_out, uint64_t* syncthread_out)
242 {
243 GET_CONTEXT;
244 ctx->rcCreateSyncKHR(ctx, type, attribs, num_attribs, destroy_when_signaled, glsync_out, syncthread_out);
245 }
246
rcClientWaitSyncKHR(uint64_t sync,EGLint flags,uint64_t timeout)247 EGLint rcClientWaitSyncKHR(uint64_t sync, EGLint flags, uint64_t timeout)
248 {
249 GET_CONTEXT;
250 return ctx->rcClientWaitSyncKHR(ctx, sync, flags, timeout);
251 }
252
rcFlushWindowColorBufferAsync(uint32_t windowSurface)253 void rcFlushWindowColorBufferAsync(uint32_t windowSurface)
254 {
255 GET_CONTEXT;
256 ctx->rcFlushWindowColorBufferAsync(ctx, windowSurface);
257 }
258
rcDestroySyncKHR(uint64_t sync)259 int rcDestroySyncKHR(uint64_t sync)
260 {
261 GET_CONTEXT;
262 return ctx->rcDestroySyncKHR(ctx, sync);
263 }
264
rcSetPuid(uint64_t puid)265 void rcSetPuid(uint64_t puid)
266 {
267 GET_CONTEXT;
268 ctx->rcSetPuid(ctx, puid);
269 }
270
rcUpdateColorBufferDMA(uint32_t colorbuffer,GLint x,GLint y,GLint width,GLint height,GLenum format,GLenum type,void * pixels,uint32_t pixels_size)271 int rcUpdateColorBufferDMA(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels, uint32_t pixels_size)
272 {
273 GET_CONTEXT;
274 return ctx->rcUpdateColorBufferDMA(ctx, colorbuffer, x, y, width, height, format, type, pixels, pixels_size);
275 }
276
rcCreateColorBufferDMA(uint32_t width,uint32_t height,GLenum internalFormat,int frameworkFormat)277 uint32_t rcCreateColorBufferDMA(uint32_t width, uint32_t height, GLenum internalFormat, int frameworkFormat)
278 {
279 GET_CONTEXT;
280 return ctx->rcCreateColorBufferDMA(ctx, width, height, internalFormat, frameworkFormat);
281 }
282
rcWaitSyncKHR(uint64_t sync,EGLint flags)283 void rcWaitSyncKHR(uint64_t sync, EGLint flags)
284 {
285 GET_CONTEXT;
286 ctx->rcWaitSyncKHR(ctx, sync, flags);
287 }
288
rcCompose(uint32_t bufferSize,void * buffer)289 GLint rcCompose(uint32_t bufferSize, void* buffer)
290 {
291 GET_CONTEXT;
292 return ctx->rcCompose(ctx, bufferSize, buffer);
293 }
294
rcCreateDisplay(uint32_t * displayId)295 int rcCreateDisplay(uint32_t* displayId)
296 {
297 GET_CONTEXT;
298 return ctx->rcCreateDisplay(ctx, displayId);
299 }
300
rcDestroyDisplay(uint32_t displayId)301 int rcDestroyDisplay(uint32_t displayId)
302 {
303 GET_CONTEXT;
304 return ctx->rcDestroyDisplay(ctx, displayId);
305 }
306
rcSetDisplayColorBuffer(uint32_t displayId,uint32_t colorBuffer)307 int rcSetDisplayColorBuffer(uint32_t displayId, uint32_t colorBuffer)
308 {
309 GET_CONTEXT;
310 return ctx->rcSetDisplayColorBuffer(ctx, displayId, colorBuffer);
311 }
312
rcGetDisplayColorBuffer(uint32_t displayId,uint32_t * colorBuffer)313 int rcGetDisplayColorBuffer(uint32_t displayId, uint32_t* colorBuffer)
314 {
315 GET_CONTEXT;
316 return ctx->rcGetDisplayColorBuffer(ctx, displayId, colorBuffer);
317 }
318
rcGetColorBufferDisplay(uint32_t colorBuffer,uint32_t * displayId)319 int rcGetColorBufferDisplay(uint32_t colorBuffer, uint32_t* displayId)
320 {
321 GET_CONTEXT;
322 return ctx->rcGetColorBufferDisplay(ctx, colorBuffer, displayId);
323 }
324
rcGetDisplayPose(uint32_t displayId,GLint * x,GLint * y,uint32_t * w,uint32_t * h)325 int rcGetDisplayPose(uint32_t displayId, GLint* x, GLint* y, uint32_t* w, uint32_t* h)
326 {
327 GET_CONTEXT;
328 return ctx->rcGetDisplayPose(ctx, displayId, x, y, w, h);
329 }
330
rcSetDisplayPose(uint32_t displayId,GLint x,GLint y,uint32_t w,uint32_t h)331 int rcSetDisplayPose(uint32_t displayId, GLint x, GLint y, uint32_t w, uint32_t h)
332 {
333 GET_CONTEXT;
334 return ctx->rcSetDisplayPose(ctx, displayId, x, y, w, h);
335 }
336
rcSetColorBufferVulkanMode(uint32_t colorBuffer,uint32_t mode)337 GLint rcSetColorBufferVulkanMode(uint32_t colorBuffer, uint32_t mode)
338 {
339 GET_CONTEXT;
340 return ctx->rcSetColorBufferVulkanMode(ctx, colorBuffer, mode);
341 }
342
rcReadColorBufferYUV(uint32_t colorbuffer,GLint x,GLint y,GLint width,GLint height,void * pixels,uint32_t pixels_size)343 void rcReadColorBufferYUV(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, void* pixels, uint32_t pixels_size)
344 {
345 GET_CONTEXT;
346 ctx->rcReadColorBufferYUV(ctx, colorbuffer, x, y, width, height, pixels, pixels_size);
347 }
348
rcIsSyncSignaled(uint64_t sync)349 int rcIsSyncSignaled(uint64_t sync)
350 {
351 GET_CONTEXT;
352 return ctx->rcIsSyncSignaled(ctx, sync);
353 }
354
rcCreateColorBufferWithHandle(uint32_t width,uint32_t height,GLenum internalFormat,uint32_t handle)355 void rcCreateColorBufferWithHandle(uint32_t width, uint32_t height, GLenum internalFormat, uint32_t handle)
356 {
357 GET_CONTEXT;
358 ctx->rcCreateColorBufferWithHandle(ctx, width, height, internalFormat, handle);
359 }
360
rcCreateBuffer(uint32_t size)361 uint32_t rcCreateBuffer(uint32_t size)
362 {
363 GET_CONTEXT;
364 return ctx->rcCreateBuffer(ctx, size);
365 }
366
rcCloseBuffer(uint32_t buffer)367 void rcCloseBuffer(uint32_t buffer)
368 {
369 GET_CONTEXT;
370 ctx->rcCloseBuffer(ctx, buffer);
371 }
372
373