안드로이드/포팅2013. 3. 24. 16:15

아래는 recovery UI 에 사용되는 GGLContext 의 구조체이다.

204 typedef struct {
205    // immediate rendering
206    void (*pointx)(void *con, const GGLcoord* v, GGLcoord r);
207    void (*linex)(void *con,
208            const GGLcoord* v0, const GGLcoord* v1, GGLcoord width);
209    void (*recti)(void* c, GGLint l, GGLint t, GGLint r, GGLint b);
210    void (*trianglex)(void* c,
211            GGLcoord const* v0, GGLcoord const* v1, GGLcoord const* v2);
212
213    // scissor
214    void (*scissor)(void* c, GGLint x, GGLint y, GGLsizei width, GGLsizei height);
215
216    // Set the textures and color buffers
217    void (*activeTexture)(void* c, GGLuint tmu);
218    void (*bindTexture)(void* c, const GGLSurface* surface);
219    void (*colorBuffer)(void* c, const GGLSurface* surface);
220    void (*readBuffer)(void* c, const GGLSurface* surface);
221    void (*depthBuffer)(void* c, const GGLSurface* surface);
222    void (*bindTextureLod)(void* c, GGLuint tmu, const GGLSurface* surface);
223
224    // enable/disable features
225    void (*enable)(void* c, GGLenum name);
226    void (*disable)(void* c, GGLenum name);
227    void (*enableDisable)(void* c, GGLenum name, GGLboolean en);
228
229    // specify the fragment's color
230    void (*shadeModel)(void* c, GGLenum mode);
231    void (*color4xv)(void* c, const GGLclampx* color);
232    // specify color iterators (16.16)
233    void (*colorGrad12xv)(void* c, const GGLcolor* grad);
234
235    // specify Z coordinate iterators (0.32)
236    void (*zGrad3xv)(void* c, const GGLfixed32* grad);
237
238    // specify W coordinate iterators (16.16)
239    void (*wGrad3xv)(void* c, const GGLfixed* grad);
240
241    // specify fog iterator & color (16.16)
242    void (*fogGrad3xv)(void* c, const GGLfixed* grad);
243    void (*fogColor3xv)(void* c, const GGLclampx* color);
244
245    // specify blending parameters
246    void (*blendFunc)(void* c, GGLenum src, GGLenum dst);
247    void (*blendFuncSeparate)(void* c,  GGLenum src, GGLenum dst,
248                                        GGLenum srcAlpha, GGLenum dstAplha);
249
250    // texture environnement (REPLACE / MODULATE / DECAL / BLEND)
251    void (*texEnvi)(void* c,    GGLenum target,
252                                GGLenum pname,
253                                GGLint param);
254
255    void (*texEnvxv)(void* c, GGLenum target,
256            GGLenum pname, const GGLfixed* params);
257
258    // texture parameters (Wrapping, filter)
259    void (*texParameteri)(void* c,  GGLenum target,
260                                    GGLenum pname,
261                                    GGLint param);
262
263    // texture iterators (16.16)
264    void (*texCoord2i)(void* c, GGLint s, GGLint t);
265    void (*texCoord2x)(void* c, GGLfixed s, GGLfixed t);
266
267    // s, dsdx, dsdy, scale, t, dtdx, dtdy, tscale
268    // This api uses block floating-point for S and T texture coordinates.
269    // All values are given in 16.16, scaled by 'scale'. In other words,
270    // set scale to 0, for 16.16 values.
271    void (*texCoordGradScale8xv)(void* c, GGLint tmu, const int32_t* grad8);
272
273    void (*texGeni)(void* c, GGLenum coord, GGLenum pname, GGLint param);
274
275    // masking
276    void (*colorMask)(void* c,  GGLboolean red,
277                                GGLboolean green,
278                                GGLboolean blue,
279                                GGLboolean alpha);
280
281    void (*depthMask)(void* c, GGLboolean flag);
282
283    void (*stencilMask)(void* c, GGLuint mask);
284
285    // alpha func
286    void (*alphaFuncx)(void* c, GGLenum func, GGLclampx ref);
287
288    // depth func
289    void (*depthFunc)(void* c, GGLenum func);
290
291    // logic op
292    void (*logicOp)(void* c, GGLenum opcode);
293
294    // clear
295    void (*clear)(void* c, GGLbitfield mask);
296    void (*clearColorx)(void* c,
297            GGLclampx r, GGLclampx g, GGLclampx b, GGLclampx a);
298    void (*clearDepthx)(void* c, GGLclampx depth);
299    void (*clearStencil)(void* c, GGLint s);
300
301    // framebuffer operations
302    void (*copyPixels)(void* c, GGLint x, GGLint y,
303            GGLsizei width, GGLsizei height, GGLenum type);
304    void (*rasterPos2x)(void* c, GGLfixed x, GGLfixed y);
305    void (*rasterPos2i)(void* c, GGLint x, GGLint y);
306} GGLContext;
307


Posted by code cat