📄 mtypes.h
字号:
/** * Texture object state. Contains the array of mipmap images, border color, * wrap modes, filter modes, shadow/texcompare state, and the per-texture * color palette. */struct gl_texture_object{ _glthread_Mutex Mutex; /**< for thread safety */ GLint RefCount; /**< reference count */ GLuint Name; /**< the user-visible texture object ID */ GLenum Target; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */ GLfloat Priority; /**< in [0,1] */ GLfloat BorderColor[4]; /**< unclamped */ GLchan _BorderChan[4]; /**< clamped, as GLchan */ GLenum WrapS; /**< S-axis texture image wrap mode */ GLenum WrapT; /**< T-axis texture image wrap mode */ GLenum WrapR; /**< R-axis texture image wrap mode */ GLenum MinFilter; /**< minification filter */ GLenum MagFilter; /**< magnification filter */ GLfloat MinLod; /**< min lambda, OpenGL 1.2 */ GLfloat MaxLod; /**< max lambda, OpenGL 1.2 */ GLfloat LodBias; /**< OpenGL 1.4 */ GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */ GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */ GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ GLboolean CompareFlag; /**< GL_SGIX_shadow */ GLenum CompareOperator; /**< GL_SGIX_shadow */ GLfloat ShadowAmbient; /**< GL_ARB_shadow_ambient */ GLenum CompareMode; /**< GL_ARB_shadow */ GLenum CompareFunc; /**< GL_ARB_shadow */ GLenum DepthMode; /**< GL_ARB_depth_texture */ GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */ GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */ GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */ GLboolean Complete; /**< Is texture object complete? */ /** Actual texture images, indexed by [cube face] and [mipmap level] */ struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS]; /** GL_EXT_paletted_texture */ struct gl_color_table Palette; /** * \name For device driver. * Note: instead of attaching driver data to this pointer, it's preferable * to instead use this struct as a base class for your own texture object * class. Driver->NewTextureObject() can be used to implement the * allocation. */ void *DriverData; /**< Arbitrary device driver data */};/** * Texture combine environment state. * * \todo * If GL_NV_texture_env_combine4 is ever supported, the arrays in this * structure will need to be expanded for 4 elements. */struct gl_tex_env_combine_state{ GLenum ModeRGB; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ GLenum ModeA; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ GLenum SourceRGB[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ GLenum SourceA[3]; /**< GL_PRIMARY_COLOR, GL_TEXTURE, etc. */ GLenum OperandRGB[3]; /**< SRC_COLOR, ONE_MINUS_SRC_COLOR, etc */ GLenum OperandA[3]; /**< SRC_ALPHA, ONE_MINUS_SRC_ALPHA, etc */ GLuint ScaleShiftRGB; /**< 0, 1 or 2 */ GLuint ScaleShiftA; /**< 0, 1 or 2 */ GLuint _NumArgsRGB; /**< Number of inputs used for the combine mode. */ GLuint _NumArgsA; /**< Number of inputs used for the combine mode. */};/** * Texture unit state. Contains enable flags, texture environment/function/ * combiners, texgen state, pointers to current texture objects and * post-filter color tables. */struct gl_texture_unit{ GLbitfield Enabled; /**< bitmask of TEXTURE_*_BIT flags */ GLbitfield _ReallyEnabled; /**< 0 or exactly one of TEXTURE_*_BIT flags */ GLenum EnvMode; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */ GLfloat EnvColor[4]; GLbitfield TexGenEnabled; /**< Bitwise-OR of [STRQ]_BIT values */ /** \name Tex coord generation mode * Either GL_OBJECT_LINEAR, GL_EYE_LINEAR or GL_SPHERE_MAP. */ /*@{*/ GLenum GenModeS; GLenum GenModeT; GLenum GenModeR; GLenum GenModeQ; /*@}*/ GLbitfield _GenBitS; GLbitfield _GenBitT; GLbitfield _GenBitR; GLbitfield _GenBitQ; GLbitfield _GenFlags; /**< bitwise or of GenBit[STRQ] */ GLfloat ObjectPlaneS[4]; GLfloat ObjectPlaneT[4]; GLfloat ObjectPlaneR[4]; GLfloat ObjectPlaneQ[4]; GLfloat EyePlaneS[4]; GLfloat EyePlaneT[4]; GLfloat EyePlaneR[4]; GLfloat EyePlaneQ[4]; GLfloat LodBias; /**< for biasing mipmap levels */ /** * \name GL_EXT_texture_env_combine */ struct gl_tex_env_combine_state Combine; /** * Derived state based on \c EnvMode and the \c BaseFormat of the * currently enabled texture. */ struct gl_tex_env_combine_state _EnvMode; /** * Currently enabled combiner state. This will point to either * \c Combine or \c _EnvMode. */ struct gl_tex_env_combine_state *_CurrentCombine; struct gl_texture_object *Current1D; struct gl_texture_object *Current2D; struct gl_texture_object *Current3D; struct gl_texture_object *CurrentCubeMap; /**< GL_ARB_texture_cube_map */ struct gl_texture_object *CurrentRect; /**< GL_NV_texture_rectangle */ struct gl_texture_object *_Current; /**< Points to really enabled tex obj */ struct gl_texture_object Saved1D; /**< only used by glPush/PopAttrib */ struct gl_texture_object Saved2D; struct gl_texture_object Saved3D; struct gl_texture_object SavedCubeMap; struct gl_texture_object SavedRect; /* GL_SGI_texture_color_table */ struct gl_color_table ColorTable; struct gl_color_table ProxyColorTable; GLboolean ColorTableEnabled;};struct texenvprog_cache { GLuint hash; void *key; void *data; struct texenvprog_cache *next;};/** * Texture attribute group (GL_TEXTURE_BIT). */struct gl_texture_attrib{ /** * name multitexture */ /**@{*/ GLuint CurrentUnit; /**< Active texture unit */ GLbitfield _EnabledUnits; /**< one bit set for each really-enabled unit */ GLbitfield _EnabledCoordUnits; /**< one bit per enabled coordinate unit */ GLbitfield _GenFlags; /**< for texgen */ GLbitfield _TexGenEnabled; GLbitfield _TexMatEnabled; /**@}*/ struct gl_texture_unit Unit[MAX_TEXTURE_UNITS]; struct gl_texture_object *Proxy1D; struct gl_texture_object *Proxy2D; struct gl_texture_object *Proxy3D; struct gl_texture_object *ProxyCubeMap; struct gl_texture_object *ProxyRect; /** GL_EXT_shared_texture_palette */ GLboolean SharedPalette; struct gl_color_table Palette; /** Cached texenv fragment programs */ struct texenvprog_cache *env_fp_cache;};/** * Transformation attribute group (GL_TRANSFORM_BIT). */struct gl_transform_attrib{ GLenum MatrixMode; /**< Matrix mode */ GLfloat EyeUserPlane[MAX_CLIP_PLANES][4]; /**< User clip planes */ GLfloat _ClipUserPlane[MAX_CLIP_PLANES][4]; /**< derived */ GLbitfield ClipPlanesEnabled; /**< on/off bitmask */ GLboolean Normalize; /**< Normalize all normals? */ GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */ GLboolean RasterPositionUnclipped; /**< GL_IBM_rasterpos_clip */ GLboolean CullVertexFlag; /**< True if GL_CULL_VERTEX_EXT is enabled */ GLfloat CullEyePos[4]; GLfloat CullObjPos[4];};/** * Viewport attribute group (GL_VIEWPORT_BIT). */struct gl_viewport_attrib{ GLint X, Y; /**< position */ GLsizei Width, Height; /**< size */ GLfloat Near, Far; /**< Depth buffer range */ GLmatrix _WindowMap; /**< Mapping transformation as a matrix. */};/** * Node for the attribute stack. */struct gl_attrib_node{ GLbitfield kind; void *data; struct gl_attrib_node *next;};/** * GL_ARB_vertex/pixel_buffer_object buffer object */struct gl_buffer_object{ GLint RefCount; GLuint Name; GLenum Usage; GLenum Access; GLvoid *Pointer; /**< Only valid while buffer is mapped */ GLsizeiptrARB Size; /**< Size of storage in bytes */ GLubyte *Data; /**< Location of storage either in RAM or VRAM. */ GLboolean OnCard; /**< Is buffer in VRAM? (hardware drivers) */};/** * Client pixel packing/unpacking attributes */struct gl_pixelstore_attrib{ GLint Alignment; GLint RowLength; GLint SkipPixels; GLint SkipRows; GLint ImageHeight; /**< for GL_EXT_texture3D */ GLint SkipImages; /**< for GL_EXT_texture3D */ GLboolean SwapBytes; GLboolean LsbFirst; GLboolean ClientStorage; /**< GL_APPLE_client_storage */ GLboolean Invert; /**< GL_MESA_pack_invert */ struct gl_buffer_object *BufferObj; /**< GL_ARB_pixel_buffer_object */};#define CA_CLIENT_DATA 0x1 /**< Data not allocated by mesa *//** * Client vertex array attributes */struct gl_client_array{ GLint Size; /**< components per element (1,2,3,4) */ GLenum Type; /**< datatype: GL_FLOAT, GL_INT, etc */ GLsizei Stride; /**< user-specified stride */ GLsizei StrideB; /**< actual stride in bytes */ const GLubyte *Ptr; /**< Points to array data */ GLbitfield Enabled; /**< one of the _NEW_ARRAY_ bits */ GLboolean Normalized; /**< GL_ARB_vertex_program */ /**< GL_ARB_vertex_buffer_object */ struct gl_buffer_object *BufferObj; GLuint _MaxElement; GLbitfield Flags;};/** * Vertex array state */struct gl_array_attrib{ struct gl_client_array Vertex; /**< client data descriptors */ struct gl_client_array Normal; struct gl_client_array Color; struct gl_client_array SecondaryColor; struct gl_client_array FogCoord; struct gl_client_array Index; struct gl_client_array TexCoord[MAX_TEXTURE_COORD_UNITS]; struct gl_client_array EdgeFlag; struct gl_client_array VertexAttrib[VERT_ATTRIB_MAX]; /**< GL_NV_vertex_program */ GLint ActiveTexture; /**< Client Active Texture */ GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */ GLuint LockCount; /**< GL_EXT_compiled_vertex_array */ GLbitfield _Enabled; /**< _NEW_ARRAY_* - bit set if array enabled */ GLbitfield NewState; /**< _NEW_ARRAY_* */#if FEATURE_ARB_vertex_buffer_object struct gl_buffer_object *NullBufferObj; struct gl_buffer_object *ArrayBufferObj; struct gl_buffer_object *ElementArrayBufferObj;#endif GLuint _MaxElement; /* Min of all enabled array's maxes */};/** * Feedback buffer state */struct gl_feedback{ GLenum Type; GLbitfield _Mask; /* FB_* bits */ GLfloat *Buffer; GLuint BufferSize; GLuint Count;};/** * Selection buffer state */struct gl_selection{ GLuint *Buffer; /**< selection buffer */ GLuint BufferSize; /**< size of the selection buffer */ GLuint BufferCount; /**< number of values in the selection buffer */ GLuint Hits; /**< number of records in the selection buffer */ GLuint NameStackDepth; /**< name stack depth */ GLuint NameStack[MAX_NAME_STACK_DEPTH]; /**< name stack */ GLboolean HitFlag; /**< hit flag */ GLfloat HitMinZ; /**< minimum hit depth */ GLfloat HitMaxZ; /**< maximum hit depth */};/** * 1-D Evaluator control points */struct gl_1d_map{ GLuint Order; /**< Number of control points */ GLfloat u1, u2, du; /**< u1, u2, 1.0/(u2-u1) */ GLfloat *Points; /**< Points to contiguous control points */};/** * 2-D Evaluator control points */struct gl_2d_map{ GLuint Uorder; /**< Number of control points in U dimension */ GLuint Vorder; /**< Number of control points in V dimension */ GLfloat u1, u2, du; GLfloat v1, v2, dv; GLfloat *Points; /**< Points to contiguous control points */};/** * All evaluator control point state */struct gl_evaluators{ /** * \name 1-D maps */ /*@{*/ struct gl_1d_map Map1Vertex3; struct gl_1d_map Map1Vertex4; struct gl_1d_map Map1Index; struct gl_1d_map Map1Color4; struct gl_1d_map Map1Normal; struct gl_1d_map Map1Texture1; struct gl_1d_map Map1Texture2; struct gl_1d_map Map1Texture3; struct gl_1d_map Map1Texture4; struct gl_1d_map Map1Attrib[16]; /**< GL_NV_vertex_program */ /*@}*/ /** * \name 2-D maps */ /*@{*/ struct gl_2d_map Map2Vertex3; struct gl_2d_map Map2Vertex4; struct gl_2d_map Map2Index; struct gl_2d_map Map2Color4; struct gl_2d_map Map2Normal; struct gl_2d_map Map2Texture1; struct gl_2d_map Map2Texture2; struct gl_2d_map Map2Texture3; struct gl_2d_map Map2Texture4; struct gl_2d_map Map2Attrib[16]; /**< GL_NV_vertex_program */ /*@}*/};/** * State used during execution of fragment programs. */struct fp_machine{ GLfloat Temporaries[MAX_NV_FRAGMENT_PROGRAM_TEMPS][4]; GLfloat Inputs[MAX_NV_FRAGMENT_PROGRAM_INPUTS][4]; GLfloat Outputs[MAX_NV_FRAGMENT_PROGRAM_OUTPUTS][4]; GLuint CondCodes[4];};/** * Names of the various vertex/fragment program register files, etc. * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -