Changeset 3598 for trunk/src/opengl/mesa/winpos.c
- Timestamp:
- May 23, 2000, 10:41:28 PM (25 years ago)
- File:
-
- 1 edited
-
trunk/src/opengl/mesa/winpos.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/winpos.c
r2962 r3598 1 /* $Id: winpos.c,v 1. 2 2000-03-01 18:49:40jeroen Exp $ */1 /* $Id: winpos.c,v 1.3 2000-05-23 20:41:04 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 54 54 #include "all.h" 55 55 #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" 66 58 #include "rastpos.h" 67 59 #include "winpos.h" 60 #include "mmath.h" 61 #include "feedback.h" 68 62 #endif 69 63 … … 71 65 72 66 /* 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 */ 72 void 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 113 void 114 _mesa_WindowPos2dMESA(GLdouble x, GLdouble y) 115 { 116 _mesa_WindowPos4fMESA(x, y, 0.0F, 1.0F); 117 } 118 119 void 120 _mesa_WindowPos2fMESA(GLfloat x, GLfloat y) 121 { 122 _mesa_WindowPos4fMESA(x, y, 0.0F, 1.0F); 123 } 124 125 void 126 _mesa_WindowPos2iMESA(GLint x, GLint y) 127 { 128 _mesa_WindowPos4fMESA(x, y, 0.0F, 1.0F); 129 } 130 131 void 132 _mesa_WindowPos2sMESA(GLshort x, GLshort y) 133 { 134 _mesa_WindowPos4fMESA(x, y, 0.0F, 1.0F); 135 } 136 137 void 138 _mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) 139 { 140 _mesa_WindowPos4fMESA(x, y, z, 1.0F); 141 } 142 143 void 144 _mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) 145 { 146 _mesa_WindowPos4fMESA(x, y, z, 1.0F); 147 } 148 149 void 150 _mesa_WindowPos3iMESA(GLint x, GLint y, GLint z) 151 { 152 _mesa_WindowPos4fMESA(x, y, z, 1.0F); 153 } 154 155 void 156 _mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z) 157 { 158 _mesa_WindowPos4fMESA(x, y, z, 1.0F); 159 } 160 161 void 162 _mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w) 163 { 164 _mesa_WindowPos4fMESA(x, y, z, w); 165 } 166 167 void 168 _mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w) 169 { 170 _mesa_WindowPos4fMESA(x, y, z, w); 171 } 172 173 void 174 _mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) 175 { 176 _mesa_WindowPos4fMESA(x, y, z, w); 177 } 178 179 void 180 _mesa_WindowPos2dvMESA(const GLdouble *v) 181 { 182 _mesa_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F); 183 } 184 185 void 186 _mesa_WindowPos2fvMESA(const GLfloat *v) 187 { 188 _mesa_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F); 189 } 190 191 void 192 _mesa_WindowPos2ivMESA(const GLint *v) 193 { 194 _mesa_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F); 195 } 196 197 void 198 _mesa_WindowPos2svMESA(const GLshort *v) 199 { 200 _mesa_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F); 201 } 202 203 void 204 _mesa_WindowPos3dvMESA(const GLdouble *v) 205 { 206 _mesa_WindowPos4fMESA(v[0], v[1], v[2], 1.0F); 207 } 208 209 void 210 _mesa_WindowPos3fvMESA(const GLfloat *v) 211 { 212 _mesa_WindowPos4fMESA(v[0], v[1], v[2], 1.0F); 213 } 214 215 void 216 _mesa_WindowPos3ivMESA(const GLint *v) 217 { 218 _mesa_WindowPos4fMESA(v[0], v[1], v[2], 1.0F); 219 } 220 221 void 222 _mesa_WindowPos3svMESA(const GLshort *v) 223 { 224 _mesa_WindowPos4fMESA(v[0], v[1], v[2], 1.0F); 225 } 226 227 void 228 _mesa_WindowPos4dvMESA(const GLdouble *v) 229 { 230 _mesa_WindowPos4fMESA(v[0], v[1], v[2], v[3]); 231 } 232 233 void 234 _mesa_WindowPos4fvMESA(const GLfloat *v) 235 { 236 _mesa_WindowPos4fMESA(v[0], v[1], v[2], v[3]); 237 } 238 239 void 240 _mesa_WindowPos4ivMESA(const GLint *v) 241 { 242 _mesa_WindowPos4fMESA(v[0], v[1], v[2], v[3]); 243 } 244 245 void 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 84 254 85 255 /* … … 117 287 } 118 288 119 120 289 #endif 121 122 123
Note:
See TracChangeset
for help on using the changeset viewer.
