ReactOS 0.4.15-dev-7674-gc0b4db1
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) {
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}
static void copy_ci_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty)
Definition: copypix.c:199
static void copy_rgb_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty)
Definition: copypix.c:68
static void copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty)
Definition: copypix.c:382
static void copy_depth_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty)
Definition: copypix.c:291
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition: context.c:1421
void gl_update_state(GLcontext *ctx)
Definition: context.c:1749
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
void gl_update_hitflag(GLcontext *ctx, GLfloat z)
Definition: feedback.c:240
#define FEEDBACK_TOKEN(CTX, T)
Definition: feedback.h:39
#define GL_RENDER
Definition: gl.h:388
#define GL_INVALID_VALUE
Definition: gl.h:695
float GLfloat
Definition: gl.h:161
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define GL_INVALID_OPERATION
Definition: gl.h:696
#define GL_SELECT
Definition: gl.h:389
#define GL_COLOR
Definition: gl.h:498
#define GL_STENCIL
Definition: gl.h:500
#define GL_FEEDBACK
Definition: gl.h:387
#define GL_DEPTH
Definition: gl.h:499
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define GL_COPY_PIXEL_TOKEN
Definition: gl.h:403
int GLint
Definition: gl.h:156
GLint GLint GLsizei width
Definition: gl.h:1546
#define GL_INVALID_ENUM
Definition: gl.h:694
GLuint color
Definition: glext.h:6243
#define INSIDE_BEGIN_END(CTX)
Definition: macros.h:135

Referenced by execute_list(), and init_exec_pointers().