ReactOS  0.4.13-dev-79-gcd489d8
copypix.h File Reference
#include "types.h"
Include dependency graph for copypix.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void gl_CopyPixels (GLcontext *ctx, GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLenum type)
 

Function Documentation

◆ gl_CopyPixels()

void gl_CopyPixels ( GLcontext ctx,
GLint  srcx,
GLint  srcy,
GLsizei  width,
GLsizei  height,
GLenum  type 
)

Definition at line 454 of file copypix.c.

456 {
457  GLint destx, desty;
458 
459  if (INSIDE_BEGIN_END(ctx)) {
460  gl_error( ctx, GL_INVALID_OPERATION, "glCopyPixels" );
461  return;
462  }
463 
464  if (width<0 || height<0) {
465  gl_error( ctx, GL_INVALID_VALUE, "glCopyPixels" );
466  return;
467  }
468 
469  if (ctx->NewState) {
470  gl_update_state(ctx);
471  }
472 
473  if (ctx->RenderMode==GL_RENDER) {
474  /* Destination of copy: */
475  if (!ctx->Current.RasterPosValid) {
476  return;
477  }
478  destx = (GLint) (ctx->Current.RasterPos[0] + 0.5F);
479  desty = (GLint) (ctx->Current.RasterPos[1] + 0.5F);
480 
481  if (type==GL_COLOR && ctx->Visual->RGBAflag) {
482  copy_rgb_pixels( ctx, srcx, srcy, width, height, destx, desty );
483  }
484  else if (type==GL_COLOR && !ctx->Visual->RGBAflag) {
485  copy_ci_pixels( ctx, srcx, srcy, width, height, destx, desty );
486  }
487  else if (type==GL_DEPTH) {
488  copy_depth_pixels( ctx, srcx, srcy, width, height, destx, desty );
489  }
490  else if (type==GL_STENCIL) {
491  copy_stencil_pixels( ctx, srcx, srcy, width, height, destx, desty );
492  }
493  else {
494  gl_error( ctx, GL_INVALID_ENUM, "glCopyPixels" );
495  }
496  }
497  else if (ctx->RenderMode==GL_FEEDBACK) {
498  GLfloat color[4];
499  color[0] = ctx->Current.ByteColor[0] * ctx->Visual->InvRedScale;
500  color[1] = ctx->Current.ByteColor[1] * ctx->Visual->InvGreenScale;
501  color[2] = ctx->Current.ByteColor[2] * ctx->Visual->InvBlueScale;
502  color[3] = ctx->Current.ByteColor[3] * ctx->Visual->InvAlphaScale;
504  gl_feedback_vertex( ctx, ctx->Current.RasterPos[0],
505  ctx->Current.RasterPos[1],
506  ctx->Current.RasterPos[2],
507  ctx->Current.RasterPos[3],
508  color, ctx->Current.Index,
509  ctx->Current.TexCoord );
510  }
511  else if (ctx->RenderMode==GL_SELECT) {
512  gl_update_hitflag( ctx, ctx->Current.RasterPos[2] );
513  }
514 
515 }
GLint GLint GLsizei width
Definition: gl.h:1546
GLuint NewState
Definition: types.h:1355
#define GL_COLOR
Definition: gl.h:498
static void copy_ci_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty)
Definition: copypix.c:199
GLboolean RGBAflag
Definition: types.h:1137
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
struct gl_current_attrib Current
Definition: types.h:1320
GLvisual * Visual
Definition: types.h:1272
#define FEEDBACK_TOKEN(CTX, T)
Definition: feedback.h:39
#define INSIDE_BEGIN_END(CTX)
Definition: macros.h:135
GLuint color
Definition: glext.h:6243
#define GL_STENCIL
Definition: gl.h:500
void gl_update_hitflag(GLcontext *ctx, GLfloat z)
Definition: feedback.c:240
static void copy_depth_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty)
Definition: copypix.c:291
static void copy_rgb_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty)
Definition: copypix.c:68
GLenum RenderMode
Definition: types.h:1356
GLfloat InvRedScale
Definition: types.h:1148
#define GL_DEPTH
Definition: gl.h:499
static void copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty)
Definition: copypix.c:382
#define GL_INVALID_VALUE
Definition: gl.h:695
#define GL_INVALID_OPERATION
Definition: gl.h:696
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition: context.c:1421
#define GL_SELECT
Definition: gl.h:389
void gl_update_state(GLcontext *ctx)
Definition: context.c:1749
#define GL_FEEDBACK
Definition: gl.h:387
GLfloat InvBlueScale
Definition: types.h:1150
#define GL_INVALID_ENUM
Definition: gl.h:694
#define GL_COPY_PIXEL_TOKEN
Definition: gl.h:403
float GLfloat
Definition: gl.h:161
GLfloat InvGreenScale
Definition: types.h:1149
int GLint
Definition: gl.h:156
#define GL_RENDER
Definition: gl.h:388
GLfloat InvAlphaScale
Definition: types.h:1151
void gl_feedback_vertex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w, const GLfloat color[4], GLfloat index, const GLfloat texcoord[4])
Definition: feedback.c:161

Referenced by execute_list(), and init_exec_pointers().