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