📄 mtypes.h
字号:
FetchTexelFuncF FetchTexel2Df; FetchTexelFuncF FetchTexel3Df; /*@}*/ StoreTexelFunc StoreTexel;};/** * Texture image state. Describes the dimensions of a texture image, * the texel format and pointers to Texel Fetch functions. */struct gl_texture_image{ GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA, * GL_LUMINANCE, GL_LUMINANCE_ALPHA, * GL_INTENSITY, GL_COLOR_INDEX, * GL_DEPTH_COMPONENT or GL_DEPTH_STENCIL_EXT * only. Used for choosing TexEnv arithmetic. */ GLint InternalFormat; /**< Internal format as given by the user */ GLuint Border; /**< 0 or 1 */ GLuint Width; /**< = 2^WidthLog2 + 2*Border */ GLuint Height; /**< = 2^HeightLog2 + 2*Border */ GLuint Depth; /**< = 2^DepthLog2 + 2*Border */ GLuint Width2; /**< = Width - 2*Border */ GLuint Height2; /**< = Height - 2*Border */ GLuint Depth2; /**< = Depth - 2*Border */ GLuint WidthLog2; /**< = log2(Width2) */ GLuint HeightLog2; /**< = log2(Height2) */ GLuint DepthLog2; /**< = log2(Depth2) */ GLuint MaxLog2; /**< = MAX(WidthLog2, HeightLog2) */ GLfloat WidthScale; /**< used for mipmap LOD computation */ GLfloat HeightScale; /**< used for mipmap LOD computation */ GLfloat DepthScale; /**< used for mipmap LOD computation */ GLboolean IsClientData; /**< Data owned by client? */ GLboolean _IsPowerOfTwo; /**< Are all dimensions powers of two? */ const struct gl_texture_format *TexFormat; struct gl_texture_object *TexObject; /**< Pointer back to parent object */ FetchTexelFuncC FetchTexelc; /**< GLchan texel fetch function pointer */ FetchTexelFuncF FetchTexelf; /**< Float texel fetch function pointer */ GLboolean IsCompressed; /**< GL_ARB_texture_compression */ GLuint CompressedSize; /**< GL_ARB_texture_compression */ GLuint RowStride; /**< Padded width in units of texels */ GLuint *ImageOffsets; /**< if 3D texture: array [Depth] of offsets to each 2D slice in 'Data', in texels */ GLvoid *Data; /**< Image data, accessed via FetchTexel() */ /** * \name For device driver: */ /*@{*/ void *DriverData; /**< Arbitrary device driver data */ /*@}*/};/** * Indexes for cube map faces. *//*@{*/#define FACE_POS_X 0#define FACE_NEG_X 1#define FACE_POS_Y 2#define FACE_NEG_Y 3#define FACE_POS_Z 4#define FACE_NEG_Z 5#define MAX_FACES 6/*@}*//** * 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 _Function; /**< Comparison function derived from * \c CompareOperator, \c CompareMode, and * \c CompareFunc. */ 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 *Current1DArray; /**< GL_MESA_texture_array */ struct gl_texture_object *Current2DArray; /**< GL_MESA_texture_array */ struct gl_texture_object *_Current; /**< Points to really enabled tex obj */ /** GL_SGI_texture_color_table */ /*@{*/ struct gl_color_table ColorTable; struct gl_color_table ProxyColorTable; GLboolean ColorTableEnabled; /*@}*/};struct texenvprog_cache_item;struct texenvprog_cache{ struct texenvprog_cache_item **items; GLuint size, n_items; GLcontext *ctx;};/** * 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]; /** Proxy texture objects */ struct gl_texture_object *ProxyTex[NUM_TEXTURE_TARGETS]; /** 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 */};/** * 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 */ GLboolean Enabled; /**< Enabled flag is a boolean */ GLboolean Normalized; /**< GL_ARB_vertex_program */ /**< GL_ARB_vertex_buffer_object */ struct gl_buffer_object *BufferObj; GLuint _MaxElement;};/** * Collection of vertex arrays. Defined by the GL_APPLE_vertex_array_object * extension, but a nice encapsulation in any case. */struct gl_array_object{ /** Name of the array object as received from glGenVertexArrayAPPLE. */ GLuint Name; /** Conventional vertex arrays */ /*@{*/ struct gl_client_array Vertex; 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 EdgeFlag; struct gl_client_array TexCoord[MAX_TEXTURE_COORD_UNITS]; /*@}*/ /** Generic arrays for vertex programs/shaders */ struct gl_client_array VertexAttrib[VERT_ATTRIB_MAX]; /** Mask of _NEW_ARRAY_* values indicating which arrays are enabled */ GLbitfield _Enabled;};/** * Vertex array state */struct gl_array_attrib{ struct gl_array_object *ArrayObj; struct gl_array_object *DefaultArrayObj; GLint ActiveTexture; /**< Client Active Texture */ GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */ GLuint LockCount; /**< GL_EXT_compiled_vertex_array */ GLbitfield NewState; /**< mask of _NEW_ARRAY_* values */#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 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -