[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

glScissor Subroutine

Purpose

Defines the scissor box.

Library

OpenGL C bindings library: libGL.a

C Syntax

void glScissor(GLint X,
    GLint Y, 
    GLsizei Width,
    GLsizei Height)

When the scissor test is disabled, it is as though the scissor box includes the entire window.

Parameters

X, Y Specify the lower left corner of the scissor box. Initially (0,0).
Width, Height Specify the width and height of the scissor box. When a GL context is first attached to a window, Width and Height are set to the dimensions of that window.

Description

The glScissor subroutine defines a rectangle, called the scissor box, in window coordinates. The first two arguments, X and Y, specify the lower left corner of the box. The Width and Height parameters specify the width and height of the box.

The scissor test is enabled and disabled with the glEnable and glDisable subroutines with the GL_SCISSOR_TEST argument. While the scissor test is enabled, only pixels that lie within the scissor box can be modified by drawing commands. Window coordinates have integer values at the shared corners of frame buffer pixels, so glScissor(0,0,1,1) allows only the lower left pixel in the window to be modified, and glScissor(0,0,0,0) disallows modification to all pixels in the window.

Errors

GL_INVALID_VALUE Width or Height is negative.
GL_INVALID_OPERATION The glScissor subroutine is called between a call to glBegin and the corresponding call to glEnd.

Associated Gets

Associated gets for the glScissor subroutine are as follows. (See the glGet subroutine for more information.)

glGet with argument GL_SCISSOR_BOX

glIsEnabled with argument GL_SCISSOR_TEST.

Files

/usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glBegin or glEnd subroutine, glEnable or glDisable subroutine, glViewport subroutine.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]