📄 mtypes.h
字号:
#define MAT_BIT_FRONT_AMBIENT (1<<MAT_ATTRIB_FRONT_AMBIENT)#define MAT_BIT_BACK_AMBIENT (1<<MAT_ATTRIB_BACK_AMBIENT)#define MAT_BIT_FRONT_DIFFUSE (1<<MAT_ATTRIB_FRONT_DIFFUSE)#define MAT_BIT_BACK_DIFFUSE (1<<MAT_ATTRIB_BACK_DIFFUSE)#define MAT_BIT_FRONT_SPECULAR (1<<MAT_ATTRIB_FRONT_SPECULAR)#define MAT_BIT_BACK_SPECULAR (1<<MAT_ATTRIB_BACK_SPECULAR)#define MAT_BIT_FRONT_EMISSION (1<<MAT_ATTRIB_FRONT_EMISSION)#define MAT_BIT_BACK_EMISSION (1<<MAT_ATTRIB_BACK_EMISSION)#define MAT_BIT_FRONT_SHININESS (1<<MAT_ATTRIB_FRONT_SHININESS)#define MAT_BIT_BACK_SHININESS (1<<MAT_ATTRIB_BACK_SHININESS)#define MAT_BIT_FRONT_INDEXES (1<<MAT_ATTRIB_FRONT_INDEXES)#define MAT_BIT_BACK_INDEXES (1<<MAT_ATTRIB_BACK_INDEXES)#define FRONT_MATERIAL_BITS (MAT_BIT_FRONT_EMISSION | \ MAT_BIT_FRONT_AMBIENT | \ MAT_BIT_FRONT_DIFFUSE | \ MAT_BIT_FRONT_SPECULAR | \ MAT_BIT_FRONT_SHININESS | \ MAT_BIT_FRONT_INDEXES)#define BACK_MATERIAL_BITS (MAT_BIT_BACK_EMISSION | \ MAT_BIT_BACK_AMBIENT | \ MAT_BIT_BACK_DIFFUSE | \ MAT_BIT_BACK_SPECULAR | \ MAT_BIT_BACK_SHININESS | \ MAT_BIT_BACK_INDEXES)#define ALL_MATERIAL_BITS (FRONT_MATERIAL_BITS | BACK_MATERIAL_BITS)/*@}*/#define EXP_TABLE_SIZE 512 /**< Specular exponent lookup table sizes */#define SHINE_TABLE_SIZE 256 /**< Material shininess lookup table sizes *//** * Material shininess lookup table. */struct gl_shine_tab{ struct gl_shine_tab *next, *prev; GLfloat tab[SHINE_TABLE_SIZE+1]; GLfloat shininess; GLuint refcount;};/** * Light source state. */struct gl_light{ struct gl_light *next; /**< double linked list with sentinel */ struct gl_light *prev; GLfloat Ambient[4]; /**< ambient color */ GLfloat Diffuse[4]; /**< diffuse color */ GLfloat Specular[4]; /**< specular color */ GLfloat EyePosition[4]; /**< position in eye coordinates */ GLfloat EyeDirection[4]; /**< spotlight dir in eye coordinates */ GLfloat SpotExponent; GLfloat SpotCutoff; /**< in degrees */ GLfloat _CosCutoffNeg; /**< = cos(SpotCutoff) */ GLfloat _CosCutoff; /**< = MAX(0, cos(SpotCutoff)) */ GLfloat ConstantAttenuation; GLfloat LinearAttenuation; GLfloat QuadraticAttenuation; GLboolean Enabled; /**< On/off flag */ /** * \name Derived fields */ /*@{*/ GLbitfield _Flags; /**< State */ GLfloat _Position[4]; /**< position in eye/obj coordinates */ GLfloat _VP_inf_norm[3]; /**< Norm direction to infinite light */ GLfloat _h_inf_norm[3]; /**< Norm( _VP_inf_norm + <0,0,1> ) */ GLfloat _NormDirection[4]; /**< normalized spotlight direction */ GLfloat _VP_inf_spot_attenuation; GLfloat _SpotExpTable[EXP_TABLE_SIZE][2]; /**< to replace a pow() call */ GLfloat _MatAmbient[2][3]; /**< material ambient * light ambient */ GLfloat _MatDiffuse[2][3]; /**< material diffuse * light diffuse */ GLfloat _MatSpecular[2][3]; /**< material spec * light specular */ GLfloat _dli; /**< CI diffuse light intensity */ GLfloat _sli; /**< CI specular light intensity */ /*@}*/};/** * Light model state. */struct gl_lightmodel{ GLfloat Ambient[4]; /**< ambient color */ GLboolean LocalViewer; /**< Local (or infinite) view point? */ GLboolean TwoSide; /**< Two (or one) sided lighting? */ GLenum ColorControl; /**< either GL_SINGLE_COLOR * or GL_SEPARATE_SPECULAR_COLOR */};/** * Material state. */struct gl_material{ GLfloat Attrib[MAT_ATTRIB_MAX][4];};/** * Accumulation buffer attribute group (GL_ACCUM_BUFFER_BIT) */struct gl_accum_attrib{ GLfloat ClearColor[4]; /**< Accumulation buffer clear color */};/** * Color buffer attribute group (GL_COLOR_BUFFER_BIT). */struct gl_colorbuffer_attrib{ GLuint ClearIndex; /**< Index to use for glClear */ GLclampf ClearColor[4]; /**< Color to use for glClear */ GLuint IndexMask; /**< Color index write mask */ GLubyte ColorMask[4]; /**< Each flag is 0xff or 0x0 */ GLenum DrawBuffer[MAX_DRAW_BUFFERS]; /**< Which buffer to draw into */ /** * \name alpha testing */ /*@{*/ GLboolean AlphaEnabled; /**< Alpha test enabled flag */ GLenum AlphaFunc; /**< Alpha test function */ GLclampf AlphaRef; /**< Alpha reference value */ /*@}*/ /** * \name Blending */ /*@{*/ GLboolean BlendEnabled; /**< Blending enabled flag */ GLenum BlendSrcRGB; /**< Blending source operator */ GLenum BlendDstRGB; /**< Blending destination operator */ GLenum BlendSrcA; /**< GL_INGR_blend_func_separate */ GLenum BlendDstA; /**< GL_INGR_blend_func_separate */ GLenum BlendEquationRGB; /**< Blending equation */ GLenum BlendEquationA; /**< GL_EXT_blend_equation_separate */ GLfloat BlendColor[4]; /**< Blending color */ /*@}*/ /** * \name Logic op */ /*@{*/ GLenum LogicOp; /**< Logic operator */ GLboolean IndexLogicOpEnabled; /**< Color index logic op enabled flag */ GLboolean ColorLogicOpEnabled; /**< RGBA logic op enabled flag */ GLboolean _LogicOpEnabled; /**< RGBA logic op + EXT_blend_logic_op enabled flag */ /*@}*/ GLboolean DitherFlag; /**< Dither enable flag */ GLenum ClampFragmentColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */ GLenum ClampReadColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */};/** * Current attribute group (GL_CURRENT_BIT). */struct gl_current_attrib{ /** * \name Current vertex attributes. * \note Values are valid only after FLUSH_VERTICES has been called. * \note Index and Edgeflag current values are stored as floats in the * SIX and SEVEN attribute slots. */ /*@{*/ GLfloat Attrib[VERT_ATTRIB_MAX][4]; /**< Position, color, texcoords, etc */ /*@}*/ /** * \name Current raster position attributes (always valid). * \note This set of attributes is very similar to the SWvertex struct. */ /*@{*/ GLfloat RasterPos[4]; GLfloat RasterDistance; GLfloat RasterColor[4]; GLfloat RasterSecondaryColor[4]; GLfloat RasterIndex; GLfloat RasterTexCoords[MAX_TEXTURE_COORD_UNITS][4]; GLboolean RasterPosValid; /*@}*/};/** * Depth buffer attribute group (GL_DEPTH_BUFFER_BIT). */struct gl_depthbuffer_attrib{ GLenum Func; /**< Function for depth buffer compare */ GLclampd Clear; /**< Value to clear depth buffer to */ GLboolean Test; /**< Depth buffering enabled flag */ GLboolean Mask; /**< Depth buffer writable? */ GLboolean BoundsTest; /**< GL_EXT_depth_bounds_test */ GLfloat BoundsMin, BoundsMax;/**< GL_EXT_depth_bounds_test */};/** * glEnable()/glDisable() attribute group (GL_ENABLE_BIT). */struct gl_enable_attrib{ GLboolean AlphaTest; GLboolean AutoNormal; GLboolean Blend; GLbitfield ClipPlanes; GLboolean ColorMaterial; GLboolean ColorTable[COLORTABLE_MAX]; GLboolean Convolution1D; GLboolean Convolution2D; GLboolean Separable2D; GLboolean CullFace; GLboolean DepthTest; GLboolean Dither; GLboolean Fog; GLboolean Histogram; GLboolean Light[MAX_LIGHTS]; GLboolean Lighting; GLboolean LineSmooth; GLboolean LineStipple; GLboolean IndexLogicOp; GLboolean ColorLogicOp; GLboolean Map1Color4; GLboolean Map1Index; GLboolean Map1Normal; GLboolean Map1TextureCoord1; GLboolean Map1TextureCoord2; GLboolean Map1TextureCoord3; GLboolean Map1TextureCoord4; GLboolean Map1Vertex3; GLboolean Map1Vertex4; GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */ GLboolean Map2Color4; GLboolean Map2Index; GLboolean Map2Normal; GLboolean Map2TextureCoord1; GLboolean Map2TextureCoord2; GLboolean Map2TextureCoord3; GLboolean Map2TextureCoord4; GLboolean Map2Vertex3; GLboolean Map2Vertex4; GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */ GLboolean MinMax; GLboolean Normalize; GLboolean PixelTexture; GLboolean PointSmooth; GLboolean PolygonOffsetPoint; GLboolean PolygonOffsetLine; GLboolean PolygonOffsetFill; GLboolean PolygonSmooth; GLboolean PolygonStipple; GLboolean RescaleNormals; GLboolean Scissor; GLboolean Stencil; GLboolean StencilTwoSide; /* GL_EXT_stencil_two_side */ GLboolean MultisampleEnabled; /* GL_ARB_multisample */ GLboolean SampleAlphaToCoverage; /* GL_ARB_multisample */ GLboolean SampleAlphaToOne; /* GL_ARB_multisample */ GLboolean SampleCoverage; /* GL_ARB_multisample */ GLboolean SampleCoverageInvert; /* GL_ARB_multisample */ GLboolean RasterPositionUnclipped; /* GL_IBM_rasterpos_clip */ GLuint Texture[MAX_TEXTURE_IMAGE_UNITS]; GLuint TexGen[MAX_TEXTURE_COORD_UNITS]; /* SGI_texture_color_table */ GLboolean TextureColorTable[MAX_TEXTURE_IMAGE_UNITS]; /* GL_ARB_vertex_program / GL_NV_vertex_program */ GLboolean VertexProgram; GLboolean VertexProgramPointSize; GLboolean VertexProgramTwoSide; /* GL_ARB_point_sprite / GL_NV_point_sprite */ GLboolean PointSprite; GLboolean FragmentShaderATI;};/** * Evaluator attribute group (GL_EVAL_BIT). */struct gl_eval_attrib{ /** * \name Enable bits */ /*@{*/ GLboolean Map1Color4; GLboolean Map1Index; GLboolean Map1Normal; GLboolean Map1TextureCoord1; GLboolean Map1TextureCoord2; GLboolean Map1TextureCoord3; GLboolean Map1TextureCoord4; GLboolean Map1Vertex3; GLboolean Map1Vertex4; GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */ GLboolean Map2Color4; GLboolean Map2Index; GLboolean Map2Normal; GLboolean Map2TextureCoord1; GLboolean Map2TextureCoord2; GLboolean Map2TextureCoord3; GLboolean Map2TextureCoord4; GLboolean Map2Vertex3; GLboolean Map2Vertex4; GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */ GLboolean AutoNormal; /*@}*/ /** * \name Map Grid endpoints and divisions and calculated du values */ /*@{*/ GLint MapGrid1un; GLfloat MapGrid1u1, MapGrid1u2, MapGrid1du; GLint MapGrid2un, MapGrid2vn; GLfloat MapGrid2u1, MapGrid2u2, MapGrid2du; GLfloat MapGrid2v1, MapGrid2v2, MapGrid2dv; /*@}*/};/** * Fog attribute group (GL_FOG_BIT). */struct gl_fog_attrib{ GLboolean Enabled; /**< Fog enabled flag */ GLfloat Color[4]; /**< Fog color */ GLfloat Density; /**< Density >= 0.0 */ GLfloat Start; /**< Start distance in eye coords */ GLfloat End; /**< End distance in eye coords */ GLfloat Index; /**< Fog index */ GLenum Mode; /**< Fog mode */ GLboolean ColorSumEnabled; GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */ GLfloat _Scale; /**< (End == Start) ? 1.0 : 1.0 / (End - Start) */};/** * Hint attribute group (GL_HINT_BIT). * * Values are always one of GL_FASTEST, GL_NICEST, or GL_DONT_CARE. */struct gl_hint_attrib{ GLenum PerspectiveCorrection; GLenum PointSmooth; GLenum LineSmooth; GLenum PolygonSmooth; GLenum Fog; GLenum ClipVolumeClipping; /**< GL_EXT_clip_volume_hint */ GLenum TextureCompression; /**< GL_ARB_texture_compression */ GLenum GenerateMipmap; /**< GL_SGIS_generate_mipmap */ GLenum FragmentShaderDerivative; /**< GL_ARB_fragment_shader */};/** * Histogram attributes. */struct gl_histogram_attrib{ GLuint Width; /**< number of table entries */ GLint Format; /**< GL_ALPHA, GL_RGB, etc */ GLuint Count[HISTOGRAM_TABLE_SIZE][4]; /**< the histogram */ GLboolean Sink; /**< terminate image transfer? */ GLubyte RedSize; /**< Bits per counter */ GLubyte GreenSize; GLubyte BlueSize; GLubyte AlphaSize; GLubyte LuminanceSize;};/** * Color Min/max state. */struct gl_minmax_attrib{ GLenum Format; GLboolean Sink; GLfloat Min[4], Max[4]; /**< RGBA */};/** * Image convolution state. */struct gl_convolution_attrib{ GLenum Format; GLenum InternalFormat; GLuint Width; GLuint Height; GLfloat Filter[MAX_CONVOLUTION_WIDTH * MAX_CONVOLUTION_HEIGHT * 4];};/** * Light state flags. *//*@{*/#define LIGHT_SPOT 0x1#define LIGHT_LOCAL_VIEWER 0x2#define LIGHT_POSITIONAL 0x4#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)/*@}*//** * Lighting attribute group (GL_LIGHT_BIT). */struct gl_light_attrib{ struct gl_light Light[MAX_LIGHTS]; /**< Array of light sources */ struct gl_lightmodel Model; /**< Lighting model */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -