return;
}
- if (ctx->RenderMode==GL_RENDER) {
- GLint x, y;
- if (!ctx->Current.RasterPosValid) {
- return;
- }
+ if (!ctx->Current.RasterPosValid) {
+ return;
+ }
- if (ctx->NewState) {
- _mesa_update_state(ctx);
- }
+ if (ctx->NewState) {
+ _mesa_update_state(ctx);
+ }
+ if (ctx->RenderMode == GL_RENDER) {
/* Round, to satisfy conformance tests (matches SGI's OpenGL) */
- x = IROUND(ctx->Current.RasterPos[0]);
- y = IROUND(ctx->Current.RasterPos[1]);
-
+ GLint x = IROUND(ctx->Current.RasterPos[0]);
+ GLint y = IROUND(ctx->Current.RasterPos[1]);
ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
&ctx->Unpack, pixels);
}
- else if (ctx->RenderMode==GL_FEEDBACK) {
+ else if (ctx->RenderMode == GL_FEEDBACK) {
/* Feedback the current raster pos info */
- if (ctx->Current.RasterPosValid) {
- FLUSH_CURRENT( ctx, 0 );
- FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
- _mesa_feedback_vertex( ctx,
- ctx->Current.RasterPos,
- ctx->Current.RasterColor,
- ctx->Current.RasterIndex,
- ctx->Current.RasterTexCoords[0] );
- }
+ FLUSH_CURRENT( ctx, 0 );
+ FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
+ _mesa_feedback_vertex( ctx,
+ ctx->Current.RasterPos,
+ ctx->Current.RasterColor,
+ ctx->Current.RasterIndex,
+ ctx->Current.RasterTexCoords[0] );
}
- else if (ctx->RenderMode==GL_SELECT) {
- if (ctx->Current.RasterPosValid) {
- _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] );
- }
+ else {
+ ASSERT(ctx->RenderMode == GL_SELECT);
+ /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
}
}
GLenum type )
{
GET_CURRENT_CONTEXT(ctx);
- GLint destx, desty;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled) {
_mesa_update_state(ctx);
}
- if (ctx->RenderMode==GL_RENDER) {
- /* Destination of copy: */
- if (!ctx->Current.RasterPosValid) {
- return;
- }
-
- /* Round, to satisfy conformance tests (matches SGI's OpenGL) */
- destx = IROUND(ctx->Current.RasterPos[0]);
- desty = IROUND(ctx->Current.RasterPos[1]);
+ if (!ctx->Current.RasterPosValid) {
+ return;
+ }
+ if (ctx->RenderMode == GL_RENDER) {
+ /* Round to satisfy conformance tests (matches SGI's OpenGL) */
+ GLint destx = IROUND(ctx->Current.RasterPos[0]);
+ GLint desty = IROUND(ctx->Current.RasterPos[1]);
ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
type );
}
else if (ctx->RenderMode == GL_FEEDBACK) {
- if (ctx->Current.RasterPosValid) {
- FLUSH_CURRENT( ctx, 0 );
- FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN );
- _mesa_feedback_vertex( ctx,
- ctx->Current.RasterPos,
- ctx->Current.RasterColor,
- ctx->Current.RasterIndex,
- ctx->Current.RasterTexCoords[0] );
- }
+ FLUSH_CURRENT( ctx, 0 );
+ FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN );
+ _mesa_feedback_vertex( ctx,
+ ctx->Current.RasterPos,
+ ctx->Current.RasterColor,
+ ctx->Current.RasterIndex,
+ ctx->Current.RasterTexCoords[0] );
}
- else if (ctx->RenderMode == GL_SELECT) {
- _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] );
+ else {
+ ASSERT(ctx->RenderMode == GL_SELECT);
+ /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
}
}
return;
}
- if (ctx->Current.RasterPosValid == GL_FALSE) {
+ if (!ctx->Current.RasterPosValid) {
return; /* do nothing */
}
- if (ctx->RenderMode==GL_RENDER) {
+ if (ctx->NewState) {
+ _mesa_update_state(ctx);
+ }
+
+ if (ctx->RenderMode == GL_RENDER) {
/* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */
GLint x = IFLOOR(ctx->Current.RasterPos[0] - xorig);
GLint y = IFLOOR(ctx->Current.RasterPos[1] - yorig);
-
- if (ctx->NewState) {
- _mesa_update_state(ctx);
- }
-
ctx->Driver.Bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap );
}
#if _HAVE_FULL_GL
- else if (ctx->RenderMode==GL_FEEDBACK) {
- if (ctx->Current.RasterPosValid) {
- FLUSH_CURRENT(ctx, 0);
- FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_BITMAP_TOKEN );
- _mesa_feedback_vertex( ctx,
- ctx->Current.RasterPos,
- ctx->Current.RasterColor,
- ctx->Current.RasterIndex,
- ctx->Current.RasterTexCoords[0] );
- }
+ else if (ctx->RenderMode == GL_FEEDBACK) {
+ FLUSH_CURRENT(ctx, 0);
+ FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_BITMAP_TOKEN );
+ _mesa_feedback_vertex( ctx,
+ ctx->Current.RasterPos,
+ ctx->Current.RasterColor,
+ ctx->Current.RasterIndex,
+ ctx->Current.RasterTexCoords[0] );
}
else {
ASSERT(ctx->RenderMode == GL_SELECT);
- /* Bitmaps don't generate selection hits. See appendix B of 1.1 spec. */
+ /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
}
#endif
return;
}
- if (ctx->RenderMode==GL_RENDER) {
- GLint x, y;
- if (!colors || !depths || !ctx->Current.RasterPosValid) {
- return;
- }
+ if (!ctx->Current.RasterPosValid) {
+ return;
+ }
- if (ctx->NewState) {
- _mesa_update_state(ctx);
- }
+ if (ctx->NewState) {
+ _mesa_update_state(ctx);
+ }
+ if (ctx->RenderMode == GL_RENDER) {
/* Round, to satisfy conformance tests (matches SGI's OpenGL) */
- x = IROUND(ctx->Current.RasterPos[0]);
- y = IROUND(ctx->Current.RasterPos[1]);
-
+ GLint x = IROUND(ctx->Current.RasterPos[0]);
+ GLint y = IROUND(ctx->Current.RasterPos[1]);
ctx->Driver.DrawDepthPixelsMESA(ctx, x, y, width, height,
colorFormat, colorType, colors,
depthType, depths, &ctx->Unpack);
}
- else if (ctx->RenderMode==GL_FEEDBACK) {
+ else if (ctx->RenderMode == GL_FEEDBACK) {
/* Feedback the current raster pos info */
- if (ctx->Current.RasterPosValid) {
- FLUSH_CURRENT( ctx, 0 );
- FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
- _mesa_feedback_vertex( ctx,
- ctx->Current.RasterPos,
- ctx->Current.RasterColor,
- ctx->Current.RasterIndex,
- ctx->Current.RasterTexCoords[0] );
- }
+ FLUSH_CURRENT( ctx, 0 );
+ FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN );
+ _mesa_feedback_vertex( ctx,
+ ctx->Current.RasterPos,
+ ctx->Current.RasterColor,
+ ctx->Current.RasterIndex,
+ ctx->Current.RasterTexCoords[0] );
}
- else if (ctx->RenderMode==GL_SELECT) {
- if (ctx->Current.RasterPosValid) {
- _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] );
- }
+ else {
+ ASSERT(ctx->RenderMode == GL_SELECT);
+ /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */
}
}