Ignore:
Timestamp:
May 23, 2000, 10:41:28 PM (25 years ago)
Author:
jeroen
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/opengl/mesa/scissor.c

    r2962 r3598  
    1 /* $Id: scissor.c,v 1.2 2000-03-01 18:49:35 jeroen Exp $ */
     1/* $Id: scissor.c,v 1.3 2000-05-23 20:40:53 jeroen Exp $ */
    22
    33/*
    44 * Mesa 3-D graphics library
    5  * Version:  3.1
     5 * Version:  3.3
    66 *
    77 * Copyright (C) 1999  Brian Paul   All Rights Reserved.
     
    3333#include "all.h"
    3434#else
    35 #ifndef XFree86Server
    36 #include <stdio.h>
    37 #else
    38 #include "GL/xf86glx.h"
    39 #endif
     35#include "glheader.h"
    4036#include "types.h"
    4137#include "context.h"
     
    4541
    4642
    47 void gl_Scissor( GLcontext *ctx,
    48                 GLint x, GLint y, GLsizei width, GLsizei height )
     43void
     44_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
    4945{
    50    if (width<0 || height<0) {
     46   GET_CURRENT_CONTEXT(ctx);
     47   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glScissor");
     48
     49   if (width < 0 || height < 0) {
    5150      gl_error( ctx, GL_INVALID_VALUE, "glScissor" );
    5251      return;
    5352   }
    54    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBegin");
    5553
    5654   if (MESA_VERBOSE & VERBOSE_API)
    5755      fprintf(stderr, "glScissor %d %d %d %d\n", x, y, width, height);
    5856
    59    if (x!=ctx->Scissor.X || y!=ctx->Scissor.Y ||
    60        width!=ctx->Scissor.Width || height!=ctx->Scissor.Height) {
     57   if (x != ctx->Scissor.X ||
     58       y != ctx->Scissor.Y ||
     59       width != ctx->Scissor.Width ||
     60       height != ctx->Scissor.Height) {
    6161      ctx->Scissor.X = x;
    6262      ctx->Scissor.Y = y;
     
    8181{
    8282   /* first check if whole span is outside the scissor box */
    83    if (y<ctx->Buffer->Ymin || y>ctx->Buffer->Ymax
    84        || x>ctx->Buffer->Xmax || x+(GLint)n-1<ctx->Buffer->Xmin) {
     83   if (y < ctx->DrawBuffer->Ymin
     84       || y > ctx->DrawBuffer->Ymax
     85       || x > ctx->DrawBuffer->Xmax
     86       || x + (GLint) n - 1 < ctx->DrawBuffer->Xmin) {
    8587      return 0;
    8688   }
    8789   else {
     90      const GLint xMin = ctx->DrawBuffer->Xmin;
     91      const GLint xMax = ctx->DrawBuffer->Xmax;
    8892      GLint i;
    89       GLint xMin = ctx->Buffer->Xmin;
    90       GLint xMax = ctx->Buffer->Xmax;
    91       for (i=0; x+i < xMin; i++) {
     93      for (i = 0; x + i < xMin; i++) {
    9294         mask[i] = 0;
    9395      }
    94       for (i=(GLint)n-1; x+i > xMax; i--) {
     96      for (i = (GLint) n - 1; x + i > xMax; i--) {
    9597         mask[i] = 0;
    9698      }
     
    110112                          GLubyte mask[] )
    111113{
    112    GLint xmin = ctx->Buffer->Xmin;
    113    GLint xmax = ctx->Buffer->Xmax;
    114    GLint ymin = ctx->Buffer->Ymin;
    115    GLint ymax = ctx->Buffer->Ymax;
     114   const GLint xmin = ctx->DrawBuffer->Xmin;
     115   const GLint xmax = ctx->DrawBuffer->Xmax;
     116   const GLint ymin = ctx->DrawBuffer->Ymin;
     117   const GLint ymax = ctx->DrawBuffer->Ymax;
    116118   GLuint i;
    117119
Note: See TracChangeset for help on using the changeset viewer.