⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 api_noop.c

📁 Mesa is an open-source implementation of the OpenGL specification - a system for rendering interacti
💻 C
📖 第 1 页 / 共 2 页
字号:
/* * Mesa 3-D graphics library * Version:  6.5.1 * * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */#include "glheader.h"#include "api_noop.h"#include "api_validate.h"#include "api_arrayelt.h"#include "context.h"#include "light.h"#include "macros.h"#include "dlist.h"#include "glapi/dispatch.h"/** * \file * Just update the ctx->Current vertex attributes. * These functions are used when outside glBegin/glEnd or outside display * lists. */static void GLAPIENTRY _mesa_noop_EdgeFlag( GLboolean b ){   GET_CURRENT_CONTEXT(ctx);   ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] = (GLfloat)b;}static void GLAPIENTRY _mesa_noop_Indexf( GLfloat f ){   GET_CURRENT_CONTEXT(ctx);   ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0] = f;}static void GLAPIENTRY _mesa_noop_Indexfv( const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0] = *v;}static void GLAPIENTRY _mesa_noop_FogCoordfEXT( GLfloat a ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_FOG];   dest[0] = a;   dest[1] = 0.0;   dest[2] = 0.0;   dest[3] = 1.0;}static void GLAPIENTRY _mesa_noop_FogCoordfvEXT( const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_FOG];   dest[0] = v[0];   dest[1] = 0.0;   dest[2] = 0.0;   dest[3] = 1.0;}static void GLAPIENTRY _mesa_noop_Normal3f( GLfloat a, GLfloat b, GLfloat c ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];   dest[0] = a;   dest[1] = b;   dest[2] = c;   dest[3] = 1.0;}static void GLAPIENTRY _mesa_noop_Normal3fv( const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];   dest[0] = v[0];   dest[1] = v[1];   dest[2] = v[2];   dest[3] = 1.0;}static void GLAPIENTRY _mesa_noop_Color4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];   color[0] = a;   color[1] = b;   color[2] = c;   color[3] = d;}static void GLAPIENTRY _mesa_noop_Color4fv( const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];   color[0] = v[0];   color[1] = v[1];   color[2] = v[2];   color[3] = v[3];}static void GLAPIENTRY _mesa_noop_Color3f( GLfloat a, GLfloat b, GLfloat c ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];   color[0] = a;   color[1] = b;   color[2] = c;   color[3] = 1.0;}static void GLAPIENTRY _mesa_noop_Color3fv( const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];   color[0] = v[0];   color[1] = v[1];   color[2] = v[2];   color[3] = 1.0;}static void GLAPIENTRY _mesa_noop_MultiTexCoord1fARB( GLenum target, GLfloat a ){   GET_CURRENT_CONTEXT(ctx);   GLuint unit = target - GL_TEXTURE0_ARB;   /* unit is unsigned -- cannot be less than zero.    */   if (unit < MAX_TEXTURE_COORD_UNITS)   {      GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];      dest[0] = a;      dest[1] = 0;      dest[2] = 0;      dest[3] = 1;   }}static void GLAPIENTRY _mesa_noop_MultiTexCoord1fvARB( GLenum target, const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLuint unit = target - GL_TEXTURE0_ARB;   /* unit is unsigned -- cannot be less than zero.    */   if (unit < MAX_TEXTURE_COORD_UNITS)   {      GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];      dest[0] = v[0];      dest[1] = 0;      dest[2] = 0;      dest[3] = 1;   }}static void GLAPIENTRY _mesa_noop_MultiTexCoord2fARB( GLenum target, GLfloat a, GLfloat b ){   GET_CURRENT_CONTEXT(ctx);   GLuint unit = target - GL_TEXTURE0_ARB;   /* unit is unsigned -- cannot be less than zero.    */   if (unit < MAX_TEXTURE_COORD_UNITS)   {      GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];      dest[0] = a;      dest[1] = b;      dest[2] = 0;      dest[3] = 1;   }}static void GLAPIENTRY _mesa_noop_MultiTexCoord2fvARB( GLenum target, const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLuint unit = target - GL_TEXTURE0_ARB;   /* unit is unsigned -- cannot be less than zero.    */   if (unit < MAX_TEXTURE_COORD_UNITS)   {      GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];      dest[0] = v[0];      dest[1] = v[1];      dest[2] = 0;      dest[3] = 1;   }}static void GLAPIENTRY _mesa_noop_MultiTexCoord3fARB( GLenum target, GLfloat a, GLfloat b, GLfloat c){   GET_CURRENT_CONTEXT(ctx);   GLuint unit = target - GL_TEXTURE0_ARB;   /* unit is unsigned -- cannot be less than zero.    */   if (unit < MAX_TEXTURE_COORD_UNITS)   {      GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];      dest[0] = a;      dest[1] = b;      dest[2] = c;      dest[3] = 1;   }}static void GLAPIENTRY _mesa_noop_MultiTexCoord3fvARB( GLenum target, const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLuint unit = target - GL_TEXTURE0_ARB;   /* unit is unsigned -- cannot be less than zero.    */   if (unit < MAX_TEXTURE_COORD_UNITS)   {      GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];      dest[0] = v[0];      dest[1] = v[1];      dest[2] = v[2];      dest[3] = 1;   }}static void GLAPIENTRY _mesa_noop_MultiTexCoord4fARB( GLenum target, GLfloat a, GLfloat b,			      GLfloat c, GLfloat d ){   GET_CURRENT_CONTEXT(ctx);   GLuint unit = target - GL_TEXTURE0_ARB;   /* unit is unsigned -- cannot be less than zero.    */   if (unit < MAX_TEXTURE_COORD_UNITS)   {      GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];      dest[0] = a;      dest[1] = b;      dest[2] = c;      dest[3] = d;   }}static void GLAPIENTRY _mesa_noop_MultiTexCoord4fvARB( GLenum target, const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLuint unit = target - GL_TEXTURE0_ARB;   /* unit is unsigned -- cannot be less than zero.    */   if (unit < MAX_TEXTURE_COORD_UNITS)   {      GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];      dest[0] = v[0];      dest[1] = v[1];      dest[2] = v[2];      dest[3] = v[3];   }}static void GLAPIENTRY _mesa_noop_SecondaryColor3fEXT( GLfloat a, GLfloat b, GLfloat c ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];   color[0] = a;   color[1] = b;   color[2] = c;   color[3] = 1.0;}static void GLAPIENTRY _mesa_noop_SecondaryColor3fvEXT( const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];   color[0] = v[0];   color[1] = v[1];   color[2] = v[2];   color[3] = 1.0;}static void GLAPIENTRY _mesa_noop_TexCoord1f( GLfloat a ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];   dest[0] = a;   dest[1] = 0;   dest[2] = 0;   dest[3] = 1;}static void GLAPIENTRY _mesa_noop_TexCoord1fv( const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];   dest[0] = v[0];   dest[1] = 0;   dest[2] = 0;   dest[3] = 1;}static void GLAPIENTRY _mesa_noop_TexCoord2f( GLfloat a, GLfloat b ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];   dest[0] = a;   dest[1] = b;   dest[2] = 0;   dest[3] = 1;}static void GLAPIENTRY _mesa_noop_TexCoord2fv( const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];   dest[0] = v[0];   dest[1] = v[1];   dest[2] = 0;   dest[3] = 1;}static void GLAPIENTRY _mesa_noop_TexCoord3f( GLfloat a, GLfloat b, GLfloat c ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];   dest[0] = a;   dest[1] = b;   dest[2] = c;   dest[3] = 1;}static void GLAPIENTRY _mesa_noop_TexCoord3fv( const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];   dest[0] = v[0];   dest[1] = v[1];   dest[2] = v[2];   dest[3] = 1;}static void GLAPIENTRY _mesa_noop_TexCoord4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];   dest[0] = a;   dest[1] = b;   dest[2] = c;   dest[3] = d;}static void GLAPIENTRY _mesa_noop_TexCoord4fv( const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];   dest[0] = v[0];   dest[1] = v[1];   dest[2] = v[2];   dest[3] = v[3];}/** * GL_NV_vertex_program attributes. * Note that these attributes alias the conventional vertex attributes. */static void GLAPIENTRY _mesa_noop_VertexAttrib1fNV( GLuint index, GLfloat x ){   GET_CURRENT_CONTEXT(ctx);   if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {      ASSIGN_4V(ctx->Current.Attrib[index], x, 0, 0, 1);   }   else      _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fNV(index)" );}static void GLAPIENTRY _mesa_noop_VertexAttrib1fvNV( GLuint index, const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {      ASSIGN_4V(ctx->Current.Attrib[index], v[0], 0, 0, 1);   }   else      _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fvNV(index)" );}static void GLAPIENTRY _mesa_noop_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y ){   GET_CURRENT_CONTEXT(ctx);   if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {      ASSIGN_4V(ctx->Current.Attrib[index], x, y, 0, 1);   }   else      _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fNV(index)" );}static void GLAPIENTRY _mesa_noop_VertexAttrib2fvNV( GLuint index, const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {      ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], 0, 1);   }   else      _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fvNV(index)" );}static void GLAPIENTRY _mesa_noop_VertexAttrib3fNV( GLuint index, GLfloat x,                                  GLfloat y, GLfloat z ){   GET_CURRENT_CONTEXT(ctx);   if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {      ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, 1);   }   else      _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fNV(index)" );}static void GLAPIENTRY _mesa_noop_VertexAttrib3fvNV( GLuint index, const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {      ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], 1);   }   else      _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fvNV(index)" );}static void GLAPIENTRY _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x,                                  GLfloat y, GLfloat z, GLfloat w ){   GET_CURRENT_CONTEXT(ctx);   if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {      ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, w);   }   else      _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fNV(index)" );}static void GLAPIENTRY _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {      ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], v[3]);   }   else      _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fvNV(index)" );}/** * GL_ARB_vertex_program attributes. * Note that these attributes DO NOT alias the conventional vertex attributes. */static void GLAPIENTRY _mesa_noop_VertexAttrib1fARB( GLuint index, GLfloat x ){   GET_CURRENT_CONTEXT(ctx);   if (index < MAX_VERTEX_ATTRIBS) {      ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, 0, 0, 1);   }   else      _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fARB(index)" );}static void GLAPIENTRY _mesa_noop_VertexAttrib1fvARB( GLuint index, const GLfloat *v ){   GET_CURRENT_CONTEXT(ctx);   if (index < MAX_VERTEX_ATTRIBS) {      ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], 0, 0, 1);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -