Lines Matching refs:c
71 ogles_context_t *c = in ogles_init() local
73 memset(c, 0, sizeof(ogles_context_t)); in ogles_init()
74 ggl_init_context(&(c->rasterizer)); in ogles_init()
78 c->surfaceManager = smgr.get(); in ogles_init()
79 c->surfaceManager->incStrong(c); in ogles_init()
82 c->bufferObjectManager = bomgr.get(); in ogles_init()
83 c->bufferObjectManager->incStrong(c); in ogles_init()
85 ogles_init_array(c); in ogles_init()
86 ogles_init_matrix(c); in ogles_init()
87 ogles_init_vertex(c); in ogles_init()
88 ogles_init_light(c); in ogles_init()
89 ogles_init_texture(c); in ogles_init()
91 c->rasterizer.base = base; in ogles_init()
92 c->point.size = TRI_ONE; in ogles_init()
93 c->line.width = TRI_ONE; in ogles_init()
96 c->rasterizer.procs.depthMask(c, 1); in ogles_init()
99 c->rasterizer.procs.enable(c, GL_DITHER); in ogles_init()
101 return c; in ogles_init()
104 void ogles_uninit(ogles_context_t* c) in ogles_uninit() argument
106 ogles_uninit_array(c); in ogles_uninit()
107 ogles_uninit_matrix(c); in ogles_uninit()
108 ogles_uninit_vertex(c); in ogles_uninit()
109 ogles_uninit_light(c); in ogles_uninit()
110 ogles_uninit_texture(c); in ogles_uninit()
111 c->surfaceManager->decStrong(c); in ogles_uninit()
112 c->bufferObjectManager->decStrong(c); in ogles_uninit()
113 ggl_uninit_context(&(c->rasterizer)); in ogles_uninit()
114 free(c->rasterizer.base); in ogles_uninit()
117 void _ogles_error(ogles_context_t* c, GLenum error) in _ogles_error() argument
119 if (c->error == GL_NO_ERROR) in _ogles_error()
120 c->error = error; in _ogles_error()
136 static void enable_disable(ogles_context_t* c, GLenum cap, int enabled) in enable_disable() argument
139 c->lighting.lights[cap-GL_LIGHT0].enable = enabled; in enable_disable()
140 c->lighting.enabledLights &= ~(1<<(cap-GL_LIGHT0)); in enable_disable()
141 c->lighting.enabledLights |= (enabled<<(cap-GL_LIGHT0)); in enable_disable()
147 c->point.smooth = enabled; in enable_disable()
150 c->line.smooth = enabled; in enable_disable()
153 c->polygonOffset.enable = enabled; in enable_disable()
156 c->cull.enable = enabled; in enable_disable()
159 c->lighting.enable = enabled; in enable_disable()
162 c->lighting.colorMaterial.enable = enabled; in enable_disable()
166 c->transforms.rescaleNormals = enabled ? cap : 0; in enable_disable()
176 c->clipPlanes.enable &= ~(1<<(cap-GL_CLIP_PLANE0)); in enable_disable()
177 c->clipPlanes.enable |= (enabled<<(cap-GL_CLIP_PLANE0)); in enable_disable()
178 ogles_invalidate_perspective(c); in enable_disable()
183 ogles_invalidate_perspective(c); in enable_disable()
193 c->rasterizer.procs.enableDisable(c, cap, enabled); in enable_disable()
196 c->rasterizer.procs.enableDisable(c, GL_TEXTURE_2D, enabled); in enable_disable()
207 ogles_error(c, GL_INVALID_ENUM); in enable_disable()
227 ogles_context_t* c = ogles_context_t::get(); in glStencilFunc() local
229 ogles_error(c, GL_INVALID_ENUM); in glStencilFunc()
238 ogles_context_t* c = ogles_context_t::get(); in glStencilOp() local
242 ogles_error(c, GL_INVALID_ENUM); in glStencilOp()
256 ogles_context_t* c = ogles_context_t::get(); in glCullFace() local
263 ogles_error(c, GL_INVALID_ENUM); in glCullFace()
265 c->cull.cullFace = mode; in glCullFace()
270 ogles_context_t* c = ogles_context_t::get(); in glFrontFace() local
276 ogles_error(c, GL_INVALID_ENUM); in glFrontFace()
279 c->cull.frontFace = mode; in glFrontFace()
284 ogles_context_t* c = ogles_context_t::get(); in glHint() local
291 c->rasterizer.procs.enableDisable(c, in glHint()
295 c->perspective = (mode == GL_NICEST) ? 1 : 0; in glHint()
298 ogles_error(c, GL_INVALID_ENUM); in glHint()
303 ogles_context_t* c = ogles_context_t::get(); in glEnable() local
304 enable_disable(c, cap, 1); in glEnable()
307 ogles_context_t* c = ogles_context_t::get(); in glDisable() local
308 enable_disable(c, cap, 0); in glDisable()
327 ogles_context_t* c = ogles_context_t::get(); in glGetError() local
328 if (c->error) { in glGetError()
329 const GLenum ret(c->error); in glGetError()
330 c->error = 0; in glGetError()
334 if (c->rasterizer.error) { in glGetError()
335 const GLenum ret(c->rasterizer.error); in glGetError()
336 c->rasterizer.error = 0; in glGetError()
351 ogles_context_t* c = ogles_context_t::get(); in glGetString() local
352 ogles_error(c, GL_INVALID_ENUM); in glGetString()
359 ogles_context_t* c = ogles_context_t::get(); in glGetIntegerv() local
370 int index = c->rasterizer.state.buffers.color.format; in glGetIntegerv()
376 int index = c->rasterizer.state.buffers.color.format; in glGetIntegerv()
382 int index = c->rasterizer.state.buffers.color.format; in glGetIntegerv()
388 int index = c->rasterizer.state.buffers.color.format; in glGetIntegerv()
410 params[0] = c->rasterizer.state.buffers.depth.format ? 0 : 16; in glGetIntegerv()
463 c->transforms.modelview.top().elements(), in glGetIntegerv()
468 c->transforms.projection.top().elements(), in glGetIntegerv()
473 c->transforms.texture[c->textures.active].top().elements(), in glGetIntegerv()
478 ogles_error(c, GL_INVALID_ENUM); in glGetIntegerv()
487 ogles_context_t* c = ogles_context_t::get(); in glPointSize() local
489 ogles_error(c, GL_INVALID_ENUM); in glPointSize()
492 c->point.size = TRI_FROM_FIXED(gglFloatToFixed(size)); in glPointSize()
497 ogles_context_t* c = ogles_context_t::get(); in glPointSizex() local
499 ogles_error(c, GL_INVALID_ENUM); in glPointSizex()
502 c->point.size = TRI_FROM_FIXED(size); in glPointSizex()
509 ogles_context_t* c = ogles_context_t::get(); in glLineWidth() local
511 ogles_error(c, GL_INVALID_ENUM); in glLineWidth()
514 c->line.width = TRI_FROM_FIXED(gglFloatToFixed(width)); in glLineWidth()
519 ogles_context_t* c = ogles_context_t::get(); in glLineWidthx() local
521 ogles_error(c, GL_INVALID_ENUM); in glLineWidthx()
524 c->line.width = TRI_FROM_FIXED(width); in glLineWidthx()
530 ogles_context_t* c = ogles_context_t::get(); in glColorMask() local
531 c->rasterizer.procs.colorMask(c, r, g, b, a); in glColorMask()
535 ogles_context_t* c = ogles_context_t::get(); in glDepthMask() local
536 c->rasterizer.procs.depthMask(c, flag); in glDepthMask()
540 ogles_context_t* c = ogles_context_t::get(); in glStencilMask() local
541 c->rasterizer.procs.stencilMask(c, mask); in glStencilMask()
545 ogles_context_t* c = ogles_context_t::get(); in glDepthFunc() local
546 c->rasterizer.procs.depthFunc(c, func); in glDepthFunc()
550 ogles_context_t* c = ogles_context_t::get(); in glLogicOp() local
551 c->rasterizer.procs.logicOp(c, opcode); in glLogicOp()
555 ogles_context_t* c = ogles_context_t::get(); in glAlphaFuncx() local
556 c->rasterizer.procs.alphaFuncx(c, func, ref); in glAlphaFuncx()
560 ogles_context_t* c = ogles_context_t::get(); in glBlendFunc() local
561 c->rasterizer.procs.blendFunc(c, sfactor, dfactor); in glBlendFunc()
565 ogles_context_t* c = ogles_context_t::get(); in glClear() local
566 c->rasterizer.procs.clear(c, mask); in glClear()
570 ogles_context_t* c = ogles_context_t::get(); in glClearColorx() local
571 c->rasterizer.procs.clearColorx(c, red, green, blue, alpha); in glClearColorx()
576 ogles_context_t* c = ogles_context_t::get(); in glClearColor() local
577 c->rasterizer.procs.clearColorx(c, in glClearColor()
585 ogles_context_t* c = ogles_context_t::get(); in glClearDepthx() local
586 c->rasterizer.procs.clearDepthx(c, depth); in glClearDepthx()
591 ogles_context_t* c = ogles_context_t::get(); in glClearDepthf() local
592 c->rasterizer.procs.clearDepthx(c, gglFloatToFixed(depth)); in glClearDepthf()
596 ogles_context_t* c = ogles_context_t::get(); in glClearStencil() local
597 c->rasterizer.procs.clearStencil(c, s); in glClearStencil()