Lines Matching refs:to
14 void crStateDiffContext( CRContext *from, CRContext *to )
23 crStateTransformDiff( &(sb->transform), bitID, from, to );
27 crStatePixelDiff( &(sb->pixel), bitID, from, to );
31 crStateViewportDiff( &(sb->viewport), bitID, from, to );
35 crStateFogDiff( &(sb->fog), bitID, from, to );
39 crStateTextureDiff( &(sb->texture), bitID, from, to );
43 crStateListsDiff( &(sb->lists), bitID, from, to );
47 crStateBufferDiff( &(sb->buffer), bitID, from, to );
52 crStateBufferObjectDiff( &(sb->bufferobject), bitID, from, to );
57 crStateClientDiff(&(sb->client), bitID, from, to );
61 crStateHintDiff( &(sb->hint), bitID, from, to );
65 crStateLightingDiff( &(sb->lighting), bitID, from, to );
69 crStateLineDiff( &(sb->line), bitID, from, to );
73 crStateOcclusionDiff( &(sb->occlusion), bitID, from, to );
77 crStatePointDiff( &(sb->point), bitID, from, to );
81 crStatePolygonDiff( &(sb->polygon), bitID, from, to );
85 crStateProgramDiff( &(sb->program), bitID, from, to );
89 crStateStencilDiff( &(sb->stencil), bitID, from, to );
93 crStateEvaluatorDiff( &(sb->eval), bitID, from, to );
98 crStateImagingDiff( &(sb->imaging), bitID, from, to );
104 crStateSelectionDiff( &(sb->selection), bitID, from, to );
108 if (CHECKDIRTY(sb->regcombiner.dirty, bitID) && to->extensions.NV_register_combiners)
110 crStateRegCombinerDiff( &(sb->regcombiner), bitID, from, to );
117 crStateMultisampleDiff( &(sb->multisample), bitID, from, to );
122 crStateCurrentDiff( &(sb->current), bitID, from, to );
126 void crStateFreeFBImageLegacy(CRContext *to)
128 if (to->buffer.pFrontImg)
130 crFree(to->buffer.pFrontImg);
131 to->buffer.pFrontImg = NULL;
133 if (to->buffer.pBackImg)
135 crFree(to->buffer.pBackImg);
136 to->buffer.pBackImg = NULL;
139 to->buffer.storedWidth = 0;
140 to->buffer.storedHeight = 0;
143 int crStateAcquireFBImage(CRContext *to, CRFBData *data)
145 CRBufferState *pBuf = &to->buffer;
146 CRPixelPackState packing = to->client.pack;
158 if (to->bufferobject.packBuffer->hwid>0)
169 if (!to->buffer.depthTest)
173 if (to->pixel.depthScale != 1.0f)
177 if (to->pixel.depthBias != 0.0f)
184 if (!to->stencil.stencilTest)
188 if (to->pixel.mapStencil)
192 if (to->pixel.indexOffset)
196 if (to->pixel.indexShift)
212 if (to->pixel.depthScale != 1.0f)
214 diff_api.PixelTransferf (GL_DEPTH_SCALE, to->pixel.depthScale);
216 if (to->pixel.depthBias != 0.0f)
218 diff_api.PixelTransferf (GL_DEPTH_BIAS, to->pixel.depthBias);
220 if (!to->buffer.depthTest)
227 if (to->pixel.indexOffset)
229 diff_api.PixelTransferi (GL_INDEX_OFFSET, to->pixel.indexOffset);
231 if (to->pixel.indexShift)
233 diff_api.PixelTransferi (GL_INDEX_SHIFT, to->pixel.indexShift);
235 if (to->pixel.mapStencil)
239 if (!to->stencil.stencilTest)
246 if (to->bufferobject.packBuffer->hwid>0)
248 diff_api.BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, to->bufferobject.packBuffer->hwid);
250 if (to->framebufferobject.readFB)
252 CRASSERT(to->framebufferobject.readFB->hwid);
253 diff_api.BindFramebufferEXT(GL_READ_FRAMEBUFFER, to->framebufferobject.readFB->hwid);
254 diff_api.ReadBuffer(to->framebufferobject.readFB->readbuffer);
265 diff_api.ReadBuffer(to->buffer.readBuffer);
279 void crStateApplyFBImage(CRContext *to, CRFBData *data)
282 CRBufferState *pBuf = &to->buffer;
283 CRPixelPackState unpack = to->client.unpack;
295 if (to->bufferobject.unpackBuffer->hwid>0)
312 sprintf(fname, "./img_apply_%p_%d_%d.tga", to, i, el->enmFormat);
319 if (to->pixel.depthScale != 1.0f)
323 if (to->pixel.depthBias != 0.0f)
331 if (to->pixel.mapStencil)
335 if (to->pixel.indexOffset)
339 if (to->pixel.indexShift)
356 if (to->pixel.depthScale != 1.0f)
358 diff_api.PixelTransferf (GL_DEPTH_SCALE, to->pixel.depthScale);
360 if (to->pixel.depthBias != 0.0f)
362 diff_api.PixelTransferf (GL_DEPTH_BIAS, to->pixel.depthBias);
368 if (to->pixel.indexOffset)
370 diff_api.PixelTransferi (GL_INDEX_OFFSET, to->pixel.indexOffset);
372 if (to->pixel.indexShift)
374 diff_api.PixelTransferi (GL_INDEX_SHIFT, to->pixel.indexShift);
376 if (to->pixel.mapStencil)
384 diff_api.WindowPos3fvARB(to->current.rasterAttrib[VERT_ATTRIB_POS]);
385 if (to->bufferobject.unpackBuffer->hwid>0)
387 diff_api.BindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, to->bufferobject.unpackBuffer->hwid);
389 if (to->framebufferobject.drawFB)
391 CRASSERT(to->framebufferobject.drawFB->hwid);
392 diff_api.BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, to->framebufferobject.drawFB->hwid);
393 diff_api.DrawBuffer(to->framebufferobject.drawFB->drawbuffer[0]);
403 diff_api.DrawBuffer(to->buffer.drawBuffer);
405 if (to->buffer.alphaTest)
409 if (to->viewport.scissorTest)
413 if (to->buffer.blend)
417 if (to->buffer.logicOp)
421 if (to->buffer.depthTest)
425 if (to->stencil.stencilTest)
443 void crStateSwitchContext( CRContext *from, CRContext *to )
445 CRbitvalue *bitID = to->bitid;
450 crStateAttribSwitch(&(sb->attrib), bitID, from, to );
454 crStateTransformSwitch( &(sb->transform), bitID, from, to );
458 crStatePixelSwitch(&(sb->pixel), bitID, from, to );
462 crStateViewportSwitch(&(sb->viewport), bitID, from, to );
466 crStateFogSwitch(&(sb->fog), bitID, from, to );
470 crStateTextureSwitch( &(sb->texture), bitID, from, to );
474 crStateListsSwitch(&(sb->lists), bitID, from, to );
478 crStateBufferSwitch( &(sb->buffer), bitID, from, to );
483 crStateBufferObjectSwitch( &(sb->bufferobject), bitID, from, to );
488 crStateClientSwitch( &(sb->client), bitID, from, to );
493 crStateHintSwitch( &(sb->hint), bitID, from, to );
498 crStateLightingSwitch( &(sb->lighting), bitID, from, to );
502 crStateOcclusionSwitch( &(sb->occlusion), bitID, from, to );
506 crStateLineSwitch( &(sb->line), bitID, from, to );
510 crStatePointSwitch( &(sb->point), bitID, from, to );
514 crStatePolygonSwitch( &(sb->polygon), bitID, from, to );
518 crStateProgramSwitch( &(sb->program), bitID, from, to );
522 crStateStencilSwitch( &(sb->stencil), bitID, from, to );
526 crStateEvaluatorSwitch( &(sb->eval), bitID, from, to );
531 crStateImagingSwitch( &(sb->imaging), bitID, from, to );
537 crStateSelectionSwitch( &(sb->selection), bitID, from, to );
541 if (CHECKDIRTY(sb->regcombiner.dirty, bitID) && to->extensions.NV_register_combiners)
543 crStateRegCombinerSwitch( &(sb->regcombiner), bitID, from, to );
549 crStateMultisampleSwitch( &(sb->multisample), bitID, from, to );
555 crStateMultisampleSwitch(&(sb->multisample), bitID, from, to );
560 crStateFramebufferObjectSwitch(from, to);
563 crStateGLSLSwitch(from, to);
567 crStateCurrentSwitch( &(sb->current), bitID, from, to );
571 if (to->buffer.pFrontImg)
573 CRFBData *pLazyData = (CRFBData *)to->buffer.pFrontImg;
574 crStateApplyFBImage(to, pLazyData);
575 crStateFreeFBImageLegacy(to);