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 #ifndef GL_TRUE
8 extern "C" {
9 GLint rcGetRendererVersion();
10 EGLint rcGetEGLVersion(EGLint* major, EGLint* minor);
11 EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize);
12 EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize);
13 EGLint rcGetNumConfigs(uint32_t* numAttribs);
14 EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer);
15 EGLint rcChooseConfig(EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size);
16 EGLint rcGetFBParam(EGLint param);
17 uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion);
18 void rcDestroyContext(uint32_t context);
19 uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height);
20 void rcDestroyWindowSurface(uint32_t windowSurface);
21 uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat);
22 void rcOpenColorBuffer(uint32_t colorbuffer);
23 void rcCloseColorBuffer(uint32_t colorbuffer);
24 void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer);
25 int rcFlushWindowColorBuffer(uint32_t windowSurface);
26 EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf);
27 void rcFBPost(uint32_t colorBuffer);
28 void rcFBSetSwapInterval(EGLint interval);
29 void rcBindTexture(uint32_t colorBuffer);
30 void rcBindRenderbuffer(uint32_t colorBuffer);
31 EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead);
32 void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels);
33 int rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels);
34 };
35
36 #endif
37 #ifndef GET_CONTEXT
38 static renderControl_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
setContextAccessor(CONTEXT_ACCESSOR_TYPE * f)39 void renderControl_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
40 #define GET_CONTEXT renderControl_client_context_t * ctx = getCurrentContext()
41 #endif
42
rcGetRendererVersion()43 GLint rcGetRendererVersion()
44 {
45 GET_CONTEXT;
46 return ctx->rcGetRendererVersion(ctx);
47 }
48
rcGetEGLVersion(EGLint * major,EGLint * minor)49 EGLint rcGetEGLVersion(EGLint* major, EGLint* minor)
50 {
51 GET_CONTEXT;
52 return ctx->rcGetEGLVersion(ctx, major, minor);
53 }
54
rcQueryEGLString(EGLenum name,void * buffer,EGLint bufferSize)55 EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize)
56 {
57 GET_CONTEXT;
58 return ctx->rcQueryEGLString(ctx, name, buffer, bufferSize);
59 }
60
rcGetGLString(EGLenum name,void * buffer,EGLint bufferSize)61 EGLint rcGetGLString(EGLenum name, void* buffer, EGLint bufferSize)
62 {
63 GET_CONTEXT;
64 return ctx->rcGetGLString(ctx, name, buffer, bufferSize);
65 }
66
rcGetNumConfigs(uint32_t * numAttribs)67 EGLint rcGetNumConfigs(uint32_t* numAttribs)
68 {
69 GET_CONTEXT;
70 return ctx->rcGetNumConfigs(ctx, numAttribs);
71 }
72
rcGetConfigs(uint32_t bufSize,GLuint * buffer)73 EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer)
74 {
75 GET_CONTEXT;
76 return ctx->rcGetConfigs(ctx, bufSize, buffer);
77 }
78
rcChooseConfig(EGLint * attribs,uint32_t attribs_size,uint32_t * configs,uint32_t configs_size)79 EGLint rcChooseConfig(EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size)
80 {
81 GET_CONTEXT;
82 return ctx->rcChooseConfig(ctx, attribs, attribs_size, configs, configs_size);
83 }
84
rcGetFBParam(EGLint param)85 EGLint rcGetFBParam(EGLint param)
86 {
87 GET_CONTEXT;
88 return ctx->rcGetFBParam(ctx, param);
89 }
90
rcCreateContext(uint32_t config,uint32_t share,uint32_t glVersion)91 uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion)
92 {
93 GET_CONTEXT;
94 return ctx->rcCreateContext(ctx, config, share, glVersion);
95 }
96
rcDestroyContext(uint32_t context)97 void rcDestroyContext(uint32_t context)
98 {
99 GET_CONTEXT;
100 ctx->rcDestroyContext(ctx, context);
101 }
102
rcCreateWindowSurface(uint32_t config,uint32_t width,uint32_t height)103 uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height)
104 {
105 GET_CONTEXT;
106 return ctx->rcCreateWindowSurface(ctx, config, width, height);
107 }
108
rcDestroyWindowSurface(uint32_t windowSurface)109 void rcDestroyWindowSurface(uint32_t windowSurface)
110 {
111 GET_CONTEXT;
112 ctx->rcDestroyWindowSurface(ctx, windowSurface);
113 }
114
rcCreateColorBuffer(uint32_t width,uint32_t height,GLenum internalFormat)115 uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat)
116 {
117 GET_CONTEXT;
118 return ctx->rcCreateColorBuffer(ctx, width, height, internalFormat);
119 }
120
rcOpenColorBuffer(uint32_t colorbuffer)121 void rcOpenColorBuffer(uint32_t colorbuffer)
122 {
123 GET_CONTEXT;
124 ctx->rcOpenColorBuffer(ctx, colorbuffer);
125 }
126
rcCloseColorBuffer(uint32_t colorbuffer)127 void rcCloseColorBuffer(uint32_t colorbuffer)
128 {
129 GET_CONTEXT;
130 ctx->rcCloseColorBuffer(ctx, colorbuffer);
131 }
132
rcSetWindowColorBuffer(uint32_t windowSurface,uint32_t colorBuffer)133 void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer)
134 {
135 GET_CONTEXT;
136 ctx->rcSetWindowColorBuffer(ctx, windowSurface, colorBuffer);
137 }
138
rcFlushWindowColorBuffer(uint32_t windowSurface)139 int rcFlushWindowColorBuffer(uint32_t windowSurface)
140 {
141 GET_CONTEXT;
142 return ctx->rcFlushWindowColorBuffer(ctx, windowSurface);
143 }
144
rcMakeCurrent(uint32_t context,uint32_t drawSurf,uint32_t readSurf)145 EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf)
146 {
147 GET_CONTEXT;
148 return ctx->rcMakeCurrent(ctx, context, drawSurf, readSurf);
149 }
150
rcFBPost(uint32_t colorBuffer)151 void rcFBPost(uint32_t colorBuffer)
152 {
153 GET_CONTEXT;
154 ctx->rcFBPost(ctx, colorBuffer);
155 }
156
rcFBSetSwapInterval(EGLint interval)157 void rcFBSetSwapInterval(EGLint interval)
158 {
159 GET_CONTEXT;
160 ctx->rcFBSetSwapInterval(ctx, interval);
161 }
162
rcBindTexture(uint32_t colorBuffer)163 void rcBindTexture(uint32_t colorBuffer)
164 {
165 GET_CONTEXT;
166 ctx->rcBindTexture(ctx, colorBuffer);
167 }
168
rcBindRenderbuffer(uint32_t colorBuffer)169 void rcBindRenderbuffer(uint32_t colorBuffer)
170 {
171 GET_CONTEXT;
172 ctx->rcBindRenderbuffer(ctx, colorBuffer);
173 }
174
rcColorBufferCacheFlush(uint32_t colorbuffer,EGLint postCount,int forRead)175 EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead)
176 {
177 GET_CONTEXT;
178 return ctx->rcColorBufferCacheFlush(ctx, colorbuffer, postCount, forRead);
179 }
180
rcReadColorBuffer(uint32_t colorbuffer,GLint x,GLint y,GLint width,GLint height,GLenum format,GLenum type,void * pixels)181 void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
182 {
183 GET_CONTEXT;
184 ctx->rcReadColorBuffer(ctx, colorbuffer, x, y, width, height, format, type, pixels);
185 }
186
rcUpdateColorBuffer(uint32_t colorbuffer,GLint x,GLint y,GLint width,GLint height,GLenum format,GLenum type,void * pixels)187 int rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
188 {
189 GET_CONTEXT;
190 return ctx->rcUpdateColorBuffer(ctx, colorbuffer, x, y, width, height, format, type, pixels);
191 }
192
193