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/winpos.c

    r2962 r3598  
    1 /* $Id: winpos.c,v 1.2 2000-03-01 18:49:40 jeroen Exp $ */
     1/* $Id: winpos.c,v 1.3 2000-05-23 20:41:04 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.
     
    5454#include "all.h"
    5555#else
    56 #include "gl.h"
    57 #endif
    58 
    59 #ifdef GL_MESA_window_pos
    60 
    61 
    62 #ifndef PC_HEADER
    63 #ifdef XFree86Server
    64 #include "GL/xf86glx.h"
    65 #endif
     56#include "glheader.h"
     57#include "context.h"
    6658#include "rastpos.h"
    6759#include "winpos.h"
     60#include "mmath.h"
     61#include "feedback.h"
    6862#endif
    6963
     
    7165
    7266/*
    73  * Mesa implementation of glWindowPos*MESA()
    74  */
    75 void gl_WindowPos4fMESA( GLcontext *ctx,
    76                          GLfloat x, GLfloat y, GLfloat z, GLfloat w )
    77 {
    78    gl_windowpos( ctx, x, y, z, w );
    79 }
    80 
    81 
    82 #else
    83 
     67 * This is a MESA extension function.  Pretty much just like glRasterPos
     68 * except we don't apply the modelview or projection matrices; specify a
     69 * window coordinate directly.
     70 * Caller:  context->API.WindowPos4fMESA pointer.
     71 */
     72void
     73_mesa_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
     74{
     75   GET_CURRENT_CONTEXT(ctx);
     76   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "glWindowPosMESA" );
     77
     78   /* set raster position */
     79   ctx->Current.RasterPos[0] = x;
     80   ctx->Current.RasterPos[1] = y;
     81   ctx->Current.RasterPos[2] = CLAMP( z, 0.0F, 1.0F );
     82   ctx->Current.RasterPos[3] = w;
     83
     84   ctx->Current.RasterPosValid = GL_TRUE;
     85   ctx->Current.RasterDistance = 0.0F;
     86
     87   /* raster color = current color or index */
     88   if (ctx->Visual->RGBAflag) {
     89      UBYTE_RGBA_TO_FLOAT_RGBA(ctx->Current.RasterColor,
     90                               ctx->Current.ByteColor);
     91   }
     92   else {
     93      ctx->Current.RasterIndex = ctx->Current.Index;
     94   }
     95
     96   /* raster texcoord = current texcoord */
     97   {
     98      GLuint texSet;
     99      for (texSet=0; texSet<MAX_TEXTURE_UNITS; texSet++) {
     100         COPY_4FV( ctx->Current.RasterMultiTexCoord[texSet],
     101                  ctx->Current.Texcoord[texSet] );
     102      }
     103   }
     104
     105   if (ctx->RenderMode==GL_SELECT) {
     106      gl_update_hitflag( ctx, ctx->Current.RasterPos[2] );
     107   }
     108}
     109
     110
     111
     112
     113void
     114_mesa_WindowPos2dMESA(GLdouble x, GLdouble y)
     115{
     116   _mesa_WindowPos4fMESA(x, y, 0.0F, 1.0F);
     117}
     118
     119void
     120_mesa_WindowPos2fMESA(GLfloat x, GLfloat y)
     121{
     122   _mesa_WindowPos4fMESA(x, y, 0.0F, 1.0F);
     123}
     124
     125void
     126_mesa_WindowPos2iMESA(GLint x, GLint y)
     127{
     128   _mesa_WindowPos4fMESA(x, y, 0.0F, 1.0F);
     129}
     130
     131void
     132_mesa_WindowPos2sMESA(GLshort x, GLshort y)
     133{
     134   _mesa_WindowPos4fMESA(x, y, 0.0F, 1.0F);
     135}
     136
     137void
     138_mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z)
     139{
     140   _mesa_WindowPos4fMESA(x, y, z, 1.0F);
     141}
     142
     143void
     144_mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z)
     145{
     146   _mesa_WindowPos4fMESA(x, y, z, 1.0F);
     147}
     148
     149void
     150_mesa_WindowPos3iMESA(GLint x, GLint y, GLint z)
     151{
     152   _mesa_WindowPos4fMESA(x, y, z, 1.0F);
     153}
     154
     155void
     156_mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z)
     157{
     158   _mesa_WindowPos4fMESA(x, y, z, 1.0F);
     159}
     160
     161void
     162_mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
     163{
     164   _mesa_WindowPos4fMESA(x, y, z, w);
     165}
     166
     167void
     168_mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
     169{
     170   _mesa_WindowPos4fMESA(x, y, z, w);
     171}
     172
     173void
     174_mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
     175{
     176   _mesa_WindowPos4fMESA(x, y, z, w);
     177}
     178
     179void
     180_mesa_WindowPos2dvMESA(const GLdouble *v)
     181{
     182   _mesa_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
     183}
     184
     185void
     186_mesa_WindowPos2fvMESA(const GLfloat *v)
     187{
     188   _mesa_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
     189}
     190
     191void
     192_mesa_WindowPos2ivMESA(const GLint *v)
     193{
     194   _mesa_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
     195}
     196
     197void
     198_mesa_WindowPos2svMESA(const GLshort *v)
     199{
     200   _mesa_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
     201}
     202
     203void
     204_mesa_WindowPos3dvMESA(const GLdouble *v)
     205{
     206   _mesa_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
     207}
     208
     209void
     210_mesa_WindowPos3fvMESA(const GLfloat *v)
     211{
     212   _mesa_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
     213}
     214
     215void
     216_mesa_WindowPos3ivMESA(const GLint *v)
     217{
     218   _mesa_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
     219}
     220
     221void
     222_mesa_WindowPos3svMESA(const GLshort *v)
     223{
     224   _mesa_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
     225}
     226
     227void
     228_mesa_WindowPos4dvMESA(const GLdouble *v)
     229{
     230   _mesa_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
     231}
     232
     233void
     234_mesa_WindowPos4fvMESA(const GLfloat *v)
     235{
     236   _mesa_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
     237}
     238
     239void
     240_mesa_WindowPos4ivMESA(const GLint *v)
     241{
     242   _mesa_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
     243}
     244
     245void
     246_mesa_WindowPos4svMESA(const GLshort *v)
     247{
     248   _mesa_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
     249}
     250
     251
     252
     253#if 0
    84254
    85255/*
     
    117287}
    118288
    119 
    120289#endif
    121 
    122 
    123 
Note: See TracChangeset for help on using the changeset viewer.