gfxEnums.h

Engine/source/gfx/gfxEnums.h

More...

Public Defines

define
GFX_UNINIT_VAL() 0xDECAFBAD
define
GFX_UNSUPPORTED_VAL() 0xDEADBEEF
define
GFXVERTEXFLAG_TEXCOORD_F32(CoordIndex) (      << ( CoordIndex * 2 + 16 ) )
define
define
GFXVERTEXFLAG_TEXCOORD_POINT3F(CoordIndex) (  << ( CoordIndex * 2 + 16 ) )
define
GFXVERTEXFLAG_TEXCOORD_POINT4F(CoordIndex) (  << ( CoordIndex * 2 + 16 ) )
define
define
MAX_DYNAMIC_VERTS() (8192*2)
define
define

Public Enumerations

enum
GFXAdapterType {
  OpenGL = 0
  Direct3D11 
  Direct3D9 
  NullDevice 
  Direct3D9_360 
  GFXAdapterType_Count 
}

Constants that name each GFXDevice type.

enum
GFXBitmapFlip {
  GFXBitmapFlip_None = 0
  GFXBitmapFlip_X = 1 << 0
  GFXBitmapFlip_Y = 1 << 1
  GFXBitmapFlip_XY = GFXBitmapFlip_X | GFXBitmapFlip_Y
}
enum
GFXBlend {
  GFXBlend_FIRST = 0
  GFXBlendZero = 0
  GFXBlendOne 
  GFXBlendSrcColor 
  GFXBlendInvSrcColor 
  GFXBlendSrcAlpha 
  GFXBlendInvSrcAlpha 
  GFXBlendDestAlpha 
  GFXBlendInvDestAlpha 
  GFXBlendDestColor 
  GFXBlendInvDestColor 
  GFXBlendSrcAlphaSat 
  GFXBlend_COUNT 
}

The supported blend modes.

enum
GFXBlendOp {
  GFXBlendOp_FIRST = 0
  GFXBlendOpAdd = 0
  GFXBlendOpSubtract 
  GFXBlendOpRevSubtract 
  GFXBlendOpMin 
  GFXBlendOpMax 
  GFXBlendOp_COUNT 
}
enum
GFXBufferType {
  GFXBufferTypeStatic 
  GFXBufferTypeDynamic 
  GFXBufferTypeVolatile 
  GFXBufferTypeImmutable 
  GFXBufferType_COUNT 
}
enum
GFXClearFlags {
  GFXClearTarget = 1 << 0
  GFXClearZBuffer = 1 << 1
  GFXClearStencil = 1 << 2
}
enum
GFXCmpFunc {
  GFXCmp_FIRST = 0
  GFXCmpNever = 0
  GFXCmpLess 
  GFXCmpEqual 
  GFXCmpLessEqual 
  GFXCmpGreater 
  GFXCmpNotEqual 
  GFXCmpGreaterEqual 
  GFXCmpAlways 
  GFXCmp_COUNT 
}
enum
GFXCullMode {
  GFXCull_FIRST = 0
  GFXCullNone = 0
  GFXCullCW 
  GFXCullCCW 
  GFXCull_COUNT 
}
enum
GFXDeclType {
  GFXDeclType_FIRST = 0
  GFXDeclType_Float = 0
  GFXDeclType_Float2 
  GFXDeclType_Float3 
  GFXDeclType_Float4 
  GFXDeclType_Color 
  GFXDeclType_UByte4 
  GFXDeclType_COUNT 
}

Defines a vertex declaration type.

enum
GFXFillMode {
  GFXFill_FIRST = 1
  GFXFillPoint = 1
  GFXFillWireframe 
  GFXFillSolid 
  GFXFill_COUNT 
}
enum
GFXFormat {
  GFXFormat_FIRST = 0
  GFXFormatA8 = 0
  GFXFormatL8 
  GFXFormatA4L4 
  GFXFormatR5G6B5 
  GFXFormatR5G5B5A1 
  GFXFormatR5G5B5X1 
  GFXFormatA8L8 
  GFXFormatL16 
  GFXFormatR16F 
  GFXFormatD16 
  GFXFormatR8G8B8 
  GFXFormatR8G8B8A8 
  GFXFormatR8G8B8X8 
  GFXFormatB8G8R8A8 
  GFXFormatR32F 
  GFXFormatR16G16 
  GFXFormatR16G16F 
  GFXFormatR10G10B10A2 
  GFXFormatD32 
  GFXFormatD24X8 
  GFXFormatD24S8 
  GFXFormatD24FS8 
  GFXFormatR8G8B8A8_SRGB 
  GFXFormatR8G8B8A8_LINEAR_FORCE 
  GFXFormatR16G16B16A16 
  GFXFormatR16G16B16A16F 
  GFXFormatR32G32B32A32F 
  GFXFormatDXT1 
  GFXFormatDXT2 
  GFXFormatDXT3 
  GFXFormatDXT4 
  GFXFormatDXT5 
  GFXFormat_COUNT 
  GFXFormat_8BIT = GFXFormatA8
  GFXFormat_16BIT = GFXFormatR5G6B5
  GFXFormat_24BIT = GFXFormatR8G8B8
  GFXFormat_32BIT = GFXFormatR8G8B8A8
  GFXFormat_64BIT = GFXFormatR16G16B16A16
  GFXFormat_128BIT = GFXFormatR32G32B32A32F
  GFXFormat_UNKNOWNSIZE = GFXFormatDXT1
}
enum
GFXIndexFormat {
  GFXIndexFormat_FIRST = 0
  GFXIndexFormat16 = 0
  GFXIndexFormat32 
  GFXIndexFormat_COUNT 
}
enum
GFXMaterialColorSource {
  GFXMCSMaterial = 0
  GFXMCSColor1 
  GFXMCSColor2 
}
enum
GFXMatrixType {
  GFXMatrixWorld = 256
  GFXMatrixView = 2
  GFXMatrixProjection = 3
  GFXMatrixTexture = 16
  GFXMatrixTexture0 = 16
  GFXMatrixTexture1 = 17
  GFXMatrixTexture2 = 18
  GFXMatrixTexture3 = 19
  GFXMatrixTexture4 = 20
  GFXMatrixTexture5 = 21
  GFXMatrixTexture6 = 22
  GFXMatrixTexture7 = 23
}
enum
GFXPrimitiveType {
  GFXPT_FIRST = 0
  GFXPointList = 0
  GFXLineList 
  GFXLineStrip 
  GFXTriangleList 
  GFXTriangleStrip 
  GFXPT_COUNT 
}
enum
GFXRenderState {
  GFXRenderState_FIRST = 0
  GFXRSZEnable = 0
  GFXRSFillMode 
  GFXRSShadeMode 
  GFXRSZWriteEnable 
  GFXRSAlphaTestEnable 
  GFXRSLastPixel 
  GFXRSSrcBlend 
  GFXRSDestBlend 
  GFXRSCullMode 
  GFXRSZFunc 
  GFXRSAlphaRef 
  GFXRSAlphaFunc 
  GFXRSDitherEnable 
  GFXRSAlphaBlendEnable 
  GFXRSFogEnable 
  GFXRSSpecularEnable 
  GFXRSFogColor 
  GFXRSFogTableMode 
  GFXRSFogStart 
  GFXRSFogEnd 
  GFXRSFogDensity 
  GFXRSRangeFogEnable 
  GFXRSStencilEnable 
  GFXRSStencilFail 
  GFXRSStencilZFail 
  GFXRSStencilPass 
  GFXRSStencilFunc 
  GFXRSStencilRef 
  GFXRSStencilMask 
  GFXRSStencilWriteMask 
  GFXRSTextureFactor 
  GFXRSWrap0 
  GFXRSWrap1 
  GFXRSWrap2 
  GFXRSWrap3 
  GFXRSWrap4 
  GFXRSWrap5 
  GFXRSWrap6 
  GFXRSWrap7 
  GFXRSClipping 
  GFXRSLighting 
  GFXRSAmbient 
  GFXRSFogVertexMode 
  GFXRSColorVertex 
  GFXRSLocalViewer 
  GFXRSNormalizeNormals 
  GFXRSDiffuseMaterialSource 
  GFXRSSpecularMaterialSource 
  GFXRSAmbientMaterialSource 
  GFXRSEmissiveMaterialSource 
  GFXRSVertexBlend 
  GFXRSClipPlaneEnable 
  GFXRSPointSize 
  GFXRSPointSizeMin 
  GFXRSPointSpriteEnable 
  GFXRSPointScaleEnable 
  GFXRSPointScale_A 
  GFXRSPointScale_B 
  GFXRSPointScale_C 
  GFXRSMultiSampleantiAlias 
  GFXRSMultiSampleMask 
  GFXRSPatchEdgeStyle 
  GFXRSDebugMonitorToken 
  GFXRSPointSize_Max 
  GFXRSIndexedVertexBlendEnable 
  GFXRSColorWriteEnable 
  GFXRSTweenFactor 
  GFXRSBlendOp 
  GFXRSPositionDegree 
  GFXRSNormalDegree 
  GFXRSScissorTestEnable 
  GFXRSSlopeScaleDepthBias 
  GFXRSAntiAliasedLineEnable 
  GFXRSMinTessellationLevel 
  GFXRSMaxTessellationLevel 
  GFXRSAdaptiveTess_X 
  GFXRSAdaptiveTess_Y 
  GFXRSdaptiveTess_Z 
  GFXRSAdaptiveTess_W 
  GFXRSEnableAdaptiveTesselation 
  GFXRSTwoSidedStencilMode 
  GFXRSCCWStencilFail 
  GFXRSCCWStencilZFail 
  GFXRSCCWStencilPass 
  GFXRSCCWStencilFunc 
  GFXRSColorWriteEnable1 
  GFXRSColorWriteEnable2 
  GFXRSolorWriteEnable3 
  GFXRSBlendFactor 
  GFXRSSRGBWriteEnable 
  GFXRSDepthBias 
  GFXRSWrap8 
  GFXRSWrap9 
  GFXRSWrap10 
  GFXRSWrap11 
  GFXRSWrap12 
  GFXRSWrap13 
  GFXRSWrap14 
  GFXRSWrap15 
  GFXRSSeparateAlphaBlendEnable 
  GFXRSSrcBlendAlpha 
  GFXRSDestBlendAlpha 
  GFXRSBlendOpAlpha 
  GFXRenderState_COUNT 
}
enum
GFXSamplerState {
  GFXSAMP_FIRST = 0
  GFXSAMPAddressU = 0
  GFXSAMPAddressV 
  GFXSAMPAddressW 
  GFXSAMPBorderColor 
  GFXSAMPMagFilter 
  GFXSAMPMinFilter 
  GFXSAMPMipFilter 
  GFXSAMPMipMapLODBias 
  GFXSAMPMaxMipLevel 
  GFXSAMPMaxAnisotropy 
  GFXSAMPSRGBTexture 
  GFXSAMPElementIndex 
  GFXSAMPDMapOffset 
  GFXSAMP_COUNT 
}
enum
GFXShadeMode {
  GFXShadeFlat = 1
  GFXShadeGouraud 
  GFXShadePhong 
}
enum
GFXShaderConstType {
  GFXSCT_Float 
  GFXSCT_Float2 
  GFXSCT_Float3 
  GFXSCT_Float4 
  GFXSCT_Float2x2 
  GFXSCT_Float3x3 
  GFXSCT_Float3x4 
  GFXSCT_Float4x3 
  GFXSCT_Float4x4 
  GFXSCT_Int 
  GFXSCT_Int2 
  GFXSCT_Int3 
  GFXSCT_Int4 
  GFXSCT_Sampler 
  GFXSCT_SamplerCube 
}
enum
GFXStencilOp {
  GFXStencilOp_FIRST = 0
  GFXStencilOpKeep = 0
  GFXStencilOpZero 
  GFXStencilOpReplace 
  GFXStencilOpIncrSat 
  GFXStencilOpDecrSat 
  GFXStencilOpInvert 
  GFXStencilOpIncr 
  GFXStencilOpDecr 
  GFXStencilOp_COUNT 
}
enum
GFXTexCallbackCode {
  GFXZombify 
  GFXResurrect 
}
enum
GFXTextureAddressMode {
  GFXAddress_FIRST = 0
  GFXAddressWrap = 0
  GFXAddressMirror 
  GFXAddressClamp 
  GFXAddressBorder 
  GFXAddressMirrorOnce 
  GFXAddress_COUNT 
}
enum
GFXTextureArgument {
  GFXTA_FIRST = 0
  GFXTADiffuse = 0
  GFXTACurrent 
  GFXTATexture 
  GFXTATFactor 
  GFXTASpecular 
  GFXTATemp 
  GFXTAConstant 
  GFXTA_COUNT 
  GFXTAComplement = 0x00000010
  GFXTAAlphaReplicate = 0x00000020
}
enum
GFXTextureFilterType {
  GFXTextureFilter_FIRST = 0
  GFXTextureFilterNone = 0
  GFXTextureFilterPoint 
  GFXTextureFilterLinear 
  GFXTextureFilterAnisotropic 
  GFXTextureFilterPyramidalQuad 
  GFXTextureFilterGaussianQuad 
  GFXTextureFilter_COUNT 
}
enum
GFXTextureOp {
  GFXTOP_FIRST = 0
  GFXTOPDisable = 0
  GFXTOPSelectARG1 
  GFXTOPSelectARG2 
  GFXTOPModulate 
  GFXTOPModulate2X 
  GFXTOPModulate4X 
  GFXTOPAdd 
  GFXTOPAddSigned 
  GFXTOPAddSigned2X 
  GFXTOPSubtract 
  GFXTOPAddSmooth 
  GFXTOPBlendDiffuseAlpha 
  GFXTOPBlendTextureAlpha 
  GFXTOPBlendFactorAlpha 
  GFXTOPBlendTextureAlphaPM 
  GFXTOPBlendCURRENTALPHA 
  GFXTOPPreModulate 
  GFXTOPModulateAlphaAddColor 
  GFXTOPModulateColorAddAlpha 
  GFXTOPModulateInvAlphaAddColor 
  GFXTOPModulateInvColorAddAlpha 
  GFXTOPBumpEnvMap 
  GFXTOPBumpEnvMapLuminance 
  GFXTOPDotProduct3 
  GFXTOPLERP 
  GFXTOP_COUNT 
}
enum
GFXTextureStageState {
  GFXTSS_FIRST = 0
  GFXTSSColorOp = 0
  GFXTSSColorArg1 
  GFXTSSColorArg2 
  GFXTSSAlphaOp 
  GFXTSSAlphaArg1 
  GFXTSSAlphaArg2 
  GFXTSSBumpEnvMat00 
  GFXTSSBumpEnvMat01 
  GFXTSSBumpEnvMat10 
  GFXTSSBumpEnvMat11 
  GFXTSSTexCoordIndex 
  GFXTSSBumpEnvlScale 
  GFXTSSBumpEnvlOffset 
  GFXTSSTextureTransformFlags 
  GFXTSSColorArg0 
  GFXTSSAlphaArg0 
  GFXTSSResultArg 
  GFXTSSConstant 
  GFXTSS_COUNT 
}
enum
GFXTextureTransformFlags {
  GFXTTFFDisable = 0
  GFXTTFFCoord1D = 1
  GFXTTFFCoord2D = 2
  GFXTTFFCoord3D = 3
  GFXTTFFCoord4D = 4
  GFXTTFFProjected = 256
}
enum
GFXTextureType {
  GFXTextureType_Normal 
  GFXTextureType_KeepBitmap 
  GFXTextureType_Dynamic 
  GFXTextureType_RenderTarget 
  GFXTextureType_Count 
}

Public Functions

Returns the byte size of the pixel for non-compressed formats.

Detailed Description

Public Defines

GFX_UNINIT_VAL() 0xDECAFBAD
GFX_UNSUPPORTED_VAL() 0xDEADBEEF
GFXCOLORWRITEENABLE_ALPHA() 8
GFXCOLORWRITEENABLE_BLUE() 4
GFXCOLORWRITEENABLE_GREEN() 2
GFXCOLORWRITEENABLE_RED() 1
GFXVERTEXFLAG_F32() 3
GFXVERTEXFLAG_POINT2F() 0
GFXVERTEXFLAG_POINT3F() 1
GFXVERTEXFLAG_POINT4F() 2
GFXVERTEXFLAG_TEXCOORD_F32(CoordIndex) (      << ( CoordIndex * 2 + 16 ) )
GFXVERTEXFLAG_TEXCOORD_POINT2F(CoordIndex) (  )
GFXVERTEXFLAG_TEXCOORD_POINT3F(CoordIndex) (  << ( CoordIndex * 2 + 16 ) )
GFXVERTEXFLAG_TEXCOORD_POINT4F(CoordIndex) (  << ( CoordIndex * 2 + 16 ) )
LIGHT_STAGE_COUNT() 8
MAX_DYNAMIC_INDICES() (8192*4)
MAX_DYNAMIC_VERTS() (8192*2)
STATE_STACK_SIZE() 32
TEXTURE_STAGE_COUNT() 16
WORLD_STACK_MAX() 24

Public Enumerations

GFXAdapterType

Enumerator

OpenGL = 0
Direct3D11
Direct3D9
NullDevice
Direct3D9_360
GFXAdapterType_Count

Constants that name each GFXDevice type.

Any new GFXDevice subclass must be added to this enum. A string representing its name must also be added to GFXInit::getAdapterNameFromType().

GFXBitmapFlip

Enumerator

GFXBitmapFlip_None = 0
GFXBitmapFlip_X = 1 << 0
GFXBitmapFlip_Y = 1 << 1
GFXBitmapFlip_XY = GFXBitmapFlip_X | GFXBitmapFlip_Y
GFXBlend

Enumerator

GFXBlend_FIRST = 0
GFXBlendZero = 0
GFXBlendOne

(0, 0, 0, 0)

GFXBlendSrcColor

(1, 1, 1, 1)

GFXBlendInvSrcColor

(Rs, Gs, Bs, As)

GFXBlendSrcAlpha

(1 - Rs, 1 - Gs, 1 - Bs, 1 - As)

GFXBlendInvSrcAlpha

(As, As, As, As)

GFXBlendDestAlpha

( 1 - As, 1 - As, 1 - As, 1 - As)

GFXBlendInvDestAlpha

(Ad Ad Ad Ad)

GFXBlendDestColor

(1 - Ad 1 - Ad 1 - Ad 1 - Ad)

GFXBlendInvDestColor

(Rd, Gd, Bd, Ad)

GFXBlendSrcAlphaSat

(1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad)

GFXBlend_COUNT

(f, f, f, 1) where f = min(As, 1 - Ad)

The supported blend modes.

GFXBlendOp

Enumerator

GFXBlendOp_FIRST = 0
GFXBlendOpAdd = 0
GFXBlendOpSubtract
GFXBlendOpRevSubtract
GFXBlendOpMin
GFXBlendOpMax
GFXBlendOp_COUNT
GFXBufferType

Enumerator

GFXBufferTypeStatic

Static vertex buffers are created and rarely updated.

Updating might incur a performance penalty. Resizing a static vertex buffer is not allowed.

GFXBufferTypeDynamic

Dynamic vertex buffers are meant for vertices that can be changed.

often. Vertices written into dynamic vertex buffers will remain valid until the dynamic vertex buffer is released. Resizing a dynamic vertex buffer is not allowed.

GFXBufferTypeVolatile

Volatile vertex or index buffers are meant for vertices or indices that are essentially.

only used once. They can be resized without any performance penalty.

GFXBufferTypeImmutable

Immutable buffers must specify the data when creating the buffer. Cannot be modified.

GFXBufferType_COUNT

Number of buffer types.

GFXClearFlags

Enumerator

GFXClearTarget = 1 << 0
GFXClearZBuffer = 1 << 1
GFXClearStencil = 1 << 2
GFXCmpFunc

Enumerator

GFXCmp_FIRST = 0
GFXCmpNever = 0
GFXCmpLess
GFXCmpEqual
GFXCmpLessEqual
GFXCmpGreater
GFXCmpNotEqual
GFXCmpGreaterEqual
GFXCmpAlways
GFXCmp_COUNT
GFXCullMode

Enumerator

GFXCull_FIRST = 0
GFXCullNone = 0
GFXCullCW
GFXCullCCW
GFXCull_COUNT
GFXDeclType

Enumerator

GFXDeclType_FIRST = 0
GFXDeclType_Float = 0

A single component F32.

GFXDeclType_Float2

A two-component F32.

GFXDeclType_Float3

A three-component F32.

GFXDeclType_Float4

A four-component F32.

GFXDeclType_Color

A four-component, packed, unsigned bytes mapped to 0 to 1 range.

GFXDeclType_UByte4

Four-component, packed, unsigned bytes ranged 0-255.

GFXDeclType_COUNT

The count of total GFXDeclTypes.

Defines a vertex declaration type.

GFXFillMode

Enumerator

GFXFill_FIRST = 1
GFXFillPoint = 1
GFXFillWireframe
GFXFillSolid
GFXFill_COUNT
GFXFormat

Enumerator

GFXFormat_FIRST = 0
GFXFormatA8 = 0
GFXFormatL8
GFXFormatA4L4
GFXFormatR5G6B5
GFXFormatR5G5B5A1
GFXFormatR5G5B5X1
GFXFormatA8L8
GFXFormatL16
GFXFormatR16F
GFXFormatD16
GFXFormatR8G8B8
GFXFormatR8G8B8A8
GFXFormatR8G8B8X8
GFXFormatB8G8R8A8
GFXFormatR32F
GFXFormatR16G16
GFXFormatR16G16F
GFXFormatR10G10B10A2
GFXFormatD32
GFXFormatD24X8
GFXFormatD24S8
GFXFormatD24FS8
GFXFormatR8G8B8A8_SRGB
GFXFormatR8G8B8A8_LINEAR_FORCE
GFXFormatR16G16B16A16
GFXFormatR16G16B16A16F
GFXFormatR32G32B32A32F
GFXFormatDXT1
GFXFormatDXT2
GFXFormatDXT3
GFXFormatDXT4
GFXFormatDXT5
GFXFormat_COUNT
GFXFormat_8BIT = GFXFormatA8
GFXFormat_16BIT = GFXFormatR5G6B5
GFXFormat_24BIT = GFXFormatR8G8B8
GFXFormat_32BIT = GFXFormatR8G8B8A8
GFXFormat_64BIT = GFXFormatR16G16B16A16
GFXFormat_128BIT = GFXFormatR32G32B32A32F
GFXFormat_UNKNOWNSIZE = GFXFormatDXT1
GFXIndexFormat

Enumerator

GFXIndexFormat_FIRST = 0
GFXIndexFormat16 = 0
GFXIndexFormat32
GFXIndexFormat_COUNT
GFXMaterialColorSource

Enumerator

GFXMCSMaterial = 0
GFXMCSColor1
GFXMCSColor2
GFXMatrixType

Enumerator

GFXMatrixWorld = 256
GFXMatrixView = 2
GFXMatrixProjection = 3
GFXMatrixTexture = 16
GFXMatrixTexture0 = 16
GFXMatrixTexture1 = 17
GFXMatrixTexture2 = 18
GFXMatrixTexture3 = 19
GFXMatrixTexture4 = 20
GFXMatrixTexture5 = 21
GFXMatrixTexture6 = 22
GFXMatrixTexture7 = 23
GFXPrimitiveType

Enumerator

GFXPT_FIRST = 0
GFXPointList = 0
GFXLineList
GFXLineStrip
GFXTriangleList
GFXTriangleStrip
GFXPT_COUNT
GFXRenderState

Enumerator

GFXRenderState_FIRST = 0
GFXRSZEnable = 0
GFXRSFillMode
GFXRSShadeMode
GFXRSZWriteEnable
GFXRSAlphaTestEnable
GFXRSLastPixel
GFXRSSrcBlend
GFXRSDestBlend
GFXRSCullMode
GFXRSZFunc
GFXRSAlphaRef
GFXRSAlphaFunc
GFXRSDitherEnable
GFXRSAlphaBlendEnable
GFXRSFogEnable
GFXRSSpecularEnable
GFXRSFogColor
GFXRSFogTableMode
GFXRSFogStart
GFXRSFogEnd
GFXRSFogDensity
GFXRSRangeFogEnable
GFXRSStencilEnable
GFXRSStencilFail
GFXRSStencilZFail
GFXRSStencilPass
GFXRSStencilFunc
GFXRSStencilRef
GFXRSStencilMask
GFXRSStencilWriteMask
GFXRSTextureFactor
GFXRSWrap0
GFXRSWrap1
GFXRSWrap2
GFXRSWrap3
GFXRSWrap4
GFXRSWrap5
GFXRSWrap6
GFXRSWrap7
GFXRSClipping
GFXRSLighting
GFXRSAmbient
GFXRSFogVertexMode
GFXRSColorVertex
GFXRSLocalViewer
GFXRSNormalizeNormals
GFXRSDiffuseMaterialSource
GFXRSSpecularMaterialSource
GFXRSAmbientMaterialSource
GFXRSEmissiveMaterialSource
GFXRSVertexBlend
GFXRSClipPlaneEnable
GFXRSPointSize
GFXRSPointSizeMin
GFXRSPointSpriteEnable
GFXRSPointScaleEnable
GFXRSPointScale_A
GFXRSPointScale_B
GFXRSPointScale_C
GFXRSMultiSampleantiAlias
GFXRSMultiSampleMask
GFXRSPatchEdgeStyle
GFXRSDebugMonitorToken
GFXRSPointSize_Max
GFXRSIndexedVertexBlendEnable
GFXRSColorWriteEnable
GFXRSTweenFactor
GFXRSBlendOp
GFXRSPositionDegree
GFXRSNormalDegree
GFXRSScissorTestEnable
GFXRSSlopeScaleDepthBias
GFXRSAntiAliasedLineEnable
GFXRSMinTessellationLevel
GFXRSMaxTessellationLevel
GFXRSAdaptiveTess_X
GFXRSAdaptiveTess_Y
GFXRSdaptiveTess_Z
GFXRSAdaptiveTess_W
GFXRSEnableAdaptiveTesselation
GFXRSTwoSidedStencilMode
GFXRSCCWStencilFail
GFXRSCCWStencilZFail
GFXRSCCWStencilPass
GFXRSCCWStencilFunc
GFXRSColorWriteEnable1
GFXRSColorWriteEnable2
GFXRSolorWriteEnable3
GFXRSBlendFactor
GFXRSSRGBWriteEnable
GFXRSDepthBias
GFXRSWrap8
GFXRSWrap9
GFXRSWrap10
GFXRSWrap11
GFXRSWrap12
GFXRSWrap13
GFXRSWrap14
GFXRSWrap15
GFXRSSeparateAlphaBlendEnable
GFXRSSrcBlendAlpha
GFXRSDestBlendAlpha
GFXRSBlendOpAlpha
GFXRenderState_COUNT

Don't use this one, this is a counter.

GFXSamplerState

Enumerator

GFXSAMP_FIRST = 0
GFXSAMPAddressU = 0
GFXSAMPAddressV
GFXSAMPAddressW
GFXSAMPBorderColor
GFXSAMPMagFilter
GFXSAMPMinFilter
GFXSAMPMipFilter
GFXSAMPMipMapLODBias
GFXSAMPMaxMipLevel
GFXSAMPMaxAnisotropy
GFXSAMPSRGBTexture
GFXSAMPElementIndex
GFXSAMPDMapOffset
GFXSAMP_COUNT

Don't use this one, this is a counter.

GFXShadeMode

Enumerator

GFXShadeFlat = 1
GFXShadeGouraud
GFXShadePhong
GFXShaderConstType

Enumerator

GFXSCT_Float

GFX"S"hader"C"onstant"T"ype.

GFXSCT_Float2
GFXSCT_Float3
GFXSCT_Float4
GFXSCT_Float2x2
GFXSCT_Float3x3
GFXSCT_Float3x4
GFXSCT_Float4x3
GFXSCT_Float4x4
GFXSCT_Int
GFXSCT_Int2
GFXSCT_Int3
GFXSCT_Int4
GFXSCT_Sampler
GFXSCT_SamplerCube
GFXStencilOp

Enumerator

GFXStencilOp_FIRST = 0
GFXStencilOpKeep = 0
GFXStencilOpZero
GFXStencilOpReplace
GFXStencilOpIncrSat
GFXStencilOpDecrSat
GFXStencilOpInvert
GFXStencilOpIncr
GFXStencilOpDecr
GFXStencilOp_COUNT
GFXTexCallbackCode

Enumerator

GFXZombify
GFXResurrect
GFXTextureAddressMode

Enumerator

GFXAddress_FIRST = 0
GFXAddressWrap = 0
GFXAddressMirror
GFXAddressClamp
GFXAddressBorder
GFXAddressMirrorOnce
GFXAddress_COUNT
GFXTextureArgument

Enumerator

GFXTA_FIRST = 0
GFXTADiffuse = 0
GFXTACurrent
GFXTATexture
GFXTATFactor
GFXTASpecular
GFXTATemp
GFXTAConstant
GFXTA_COUNT
GFXTAComplement = 0x00000010
GFXTAAlphaReplicate = 0x00000020
GFXTextureFilterType

Enumerator

GFXTextureFilter_FIRST = 0
GFXTextureFilterNone = 0
GFXTextureFilterPoint
GFXTextureFilterLinear
GFXTextureFilterAnisotropic
GFXTextureFilterPyramidalQuad
GFXTextureFilterGaussianQuad
GFXTextureFilter_COUNT
GFXTextureOp

Enumerator

GFXTOP_FIRST = 0
GFXTOPDisable = 0
GFXTOPSelectARG1
GFXTOPSelectARG2
GFXTOPModulate
GFXTOPModulate2X
GFXTOPModulate4X
GFXTOPAdd
GFXTOPAddSigned
GFXTOPAddSigned2X
GFXTOPSubtract
GFXTOPAddSmooth
GFXTOPBlendDiffuseAlpha
GFXTOPBlendTextureAlpha
GFXTOPBlendFactorAlpha
GFXTOPBlendTextureAlphaPM
GFXTOPBlendCURRENTALPHA
GFXTOPPreModulate
GFXTOPModulateAlphaAddColor
GFXTOPModulateColorAddAlpha
GFXTOPModulateInvAlphaAddColor
GFXTOPModulateInvColorAddAlpha
GFXTOPBumpEnvMap
GFXTOPBumpEnvMapLuminance
GFXTOPDotProduct3
GFXTOPLERP
GFXTOP_COUNT
GFXTextureStageState

Enumerator

GFXTSS_FIRST = 0
GFXTSSColorOp = 0
GFXTSSColorArg1
GFXTSSColorArg2
GFXTSSAlphaOp
GFXTSSAlphaArg1
GFXTSSAlphaArg2
GFXTSSBumpEnvMat00
GFXTSSBumpEnvMat01
GFXTSSBumpEnvMat10
GFXTSSBumpEnvMat11
GFXTSSTexCoordIndex
GFXTSSBumpEnvlScale
GFXTSSBumpEnvlOffset
GFXTSSTextureTransformFlags
GFXTSSColorArg0
GFXTSSAlphaArg0
GFXTSSResultArg
GFXTSSConstant
GFXTSS_COUNT

Don't use this one, this is a counter.

GFXTextureTransformFlags

Enumerator

GFXTTFFDisable = 0
GFXTTFFCoord1D = 1
GFXTTFFCoord2D = 2
GFXTTFFCoord3D = 3
GFXTTFFCoord4D = 4
GFXTTFFProjected = 256
GFXTextureType

Enumerator

GFXTextureType_Normal
GFXTextureType_KeepBitmap
GFXTextureType_Dynamic
GFXTextureType_RenderTarget
GFXTextureType_Count

Public Functions

GFXFormat_getByteSize(GFXFormat format)

Returns the byte size of the pixel for non-compressed formats.

  1
  2//-----------------------------------------------------------------------------
  3// Copyright (c) 2012 GarageGames, LLC
  4//
  5// Permission is hereby granted, free of charge, to any person obtaining a copy
  6// of this software and associated documentation files (the "Software"), to
  7// deal in the Software without restriction, including without limitation the
  8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9// sell copies of the Software, and to permit persons to whom the Software is
 10// furnished to do so, subject to the following conditions:
 11//
 12// The above copyright notice and this permission notice shall be included in
 13// all copies or substantial portions of the Software.
 14//
 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 21// IN THE SOFTWARE.
 22//-----------------------------------------------------------------------------
 23
 24#ifndef _GFXENUMS_H_
 25#define _GFXENUMS_H_
 26
 27#include "core/util/fourcc.h"
 28
 29// These are for the enum translation. It will help with porting to other platforms
 30// and API's.
 31#define GFX_UNSUPPORTED_VAL 0xDEADBEEF
 32#define GFX_UNINIT_VAL 0xDECAFBAD
 33
 34// Adjust these pools to your app's needs.  Be aware dynamic vertices are much more
 35// expensive than static vertices. These are in gfxEnums because they should be
 36// consistant across all APIs/platforms so that the dynamic buffer performance
 37// and behavior is also consistant. -patw
 38#define MAX_DYNAMIC_VERTS   (8192*2)
 39#define MAX_DYNAMIC_INDICES (8192*4)
 40
 41enum GFXBufferType
 42{
 43      GFXBufferTypeStatic,   ///< Static vertex buffers are created and rarely updated.
 44                   ///< Updating might incur a performance penalty.  Resizing a static vertex buffer is not
 45                   ///< allowed.
 46      GFXBufferTypeDynamic,  ///< Dynamic vertex buffers are meant for vertices that can be changed
 47                   ///< often.  Vertices written into dynamic vertex buffers will remain valid
 48                   ///< until the dynamic vertex buffer is released.  Resizing a dynamic vertex buffer is not
 49                   ///< allowed.
 50      GFXBufferTypeVolatile, ///< Volatile vertex or index buffers are meant for vertices or indices that are essentially
 51                   ///< only used once.  They can be resized without any performance penalty.
 52
 53      GFXBufferTypeImmutable, ///< Immutable buffers must specify the data when creating the buffer. Cannot be modified.
 54
 55      GFXBufferType_COUNT ///< Number of buffer types.
 56};
 57
 58enum GFXTexCallbackCode
 59{
 60   GFXZombify,
 61   GFXResurrect,
 62};
 63
 64
 65enum GFXPrimitiveType 
 66{
 67   GFXPT_FIRST = 0,
 68   GFXPointList = 0,
 69   GFXLineList,
 70   GFXLineStrip,
 71   GFXTriangleList,
 72   GFXTriangleStrip,
 73   GFXPT_COUNT
 74};
 75
 76enum GFXTextureType 
 77{
 78   GFXTextureType_Normal,
 79   GFXTextureType_KeepBitmap,
 80   GFXTextureType_Dynamic,
 81   GFXTextureType_RenderTarget,
 82   GFXTextureType_Count
 83};
 84
 85enum GFXBitmapFlip 
 86{
 87   GFXBitmapFlip_None = 0,
 88   GFXBitmapFlip_X    = 1 << 0,
 89   GFXBitmapFlip_Y    = 1 << 1,
 90   GFXBitmapFlip_XY   = GFXBitmapFlip_X | GFXBitmapFlip_Y
 91};
 92
 93enum GFXTextureOp 
 94{
 95   GFXTOP_FIRST = 0,
 96   GFXTOPDisable = 0,
 97   GFXTOPSelectARG1,
 98   GFXTOPSelectARG2,
 99   GFXTOPModulate,
100   GFXTOPModulate2X,
101   GFXTOPModulate4X,
102   GFXTOPAdd,
103   GFXTOPAddSigned,
104   GFXTOPAddSigned2X,
105   GFXTOPSubtract,
106   GFXTOPAddSmooth, 
107   GFXTOPBlendDiffuseAlpha,
108   GFXTOPBlendTextureAlpha,
109   GFXTOPBlendFactorAlpha,
110   GFXTOPBlendTextureAlphaPM,
111   GFXTOPBlendCURRENTALPHA,
112   GFXTOPPreModulate,
113   GFXTOPModulateAlphaAddColor,
114   GFXTOPModulateColorAddAlpha,
115   GFXTOPModulateInvAlphaAddColor,
116   GFXTOPModulateInvColorAddAlpha,
117   GFXTOPBumpEnvMap,
118   GFXTOPBumpEnvMapLuminance,
119   GFXTOPDotProduct3,
120   GFXTOPLERP,
121   GFXTOP_COUNT
122};
123
124enum GFXTextureAddressMode 
125{
126   GFXAddress_FIRST = 0,
127   GFXAddressWrap = 0,
128   GFXAddressMirror,
129   GFXAddressClamp,
130   GFXAddressBorder,
131   GFXAddressMirrorOnce,
132   GFXAddress_COUNT
133};
134
135enum GFXTextureFilterType 
136{
137   GFXTextureFilter_FIRST = 0,
138   GFXTextureFilterNone = 0,
139   GFXTextureFilterPoint,
140   GFXTextureFilterLinear,
141   GFXTextureFilterAnisotropic,
142   GFXTextureFilterPyramidalQuad,
143   GFXTextureFilterGaussianQuad,
144   GFXTextureFilter_COUNT
145};
146
147enum GFXFillMode 
148{
149   GFXFill_FIRST = 1,
150   GFXFillPoint = 1,
151   GFXFillWireframe,
152   GFXFillSolid,
153   GFXFill_COUNT
154};
155
156enum GFXFormat 
157{
158   // when adding formats make sure to place
159   // them in the correct group!
160   //
161   // if displacing the first entry in the group
162   // make sure to update the GFXFormat_xBIT entries!
163   //
164   GFXFormat_FIRST = 0,
165
166   // 8 bit texture formats...
167   GFXFormatA8 = 0,// first in group...
168   GFXFormatL8,
169   GFXFormatA4L4,
170
171   // 16 bit texture formats...
172   GFXFormatR5G6B5,// first in group...
173   GFXFormatR5G5B5A1,
174   GFXFormatR5G5B5X1,
175   GFXFormatA8L8,
176   GFXFormatL16,
177   GFXFormatR16F,
178   GFXFormatD16,
179
180   // 24 bit texture formats...
181   GFXFormatR8G8B8,// first in group...
182
183   // 32 bit texture formats...
184   GFXFormatR8G8B8A8,// first in group...
185   GFXFormatR8G8B8X8,
186   GFXFormatB8G8R8A8,
187   GFXFormatR32F,
188   GFXFormatR16G16,
189   GFXFormatR16G16F,
190   GFXFormatR10G10B10A2,
191   GFXFormatD32,
192   GFXFormatD24X8,
193   GFXFormatD24S8,   
194   GFXFormatD24FS8,
195
196   // sRGB formats
197   GFXFormatR8G8B8A8_SRGB,
198
199   // Guaranteed RGBA8 (for apis which really dont like bgr)
200   GFXFormatR8G8B8A8_LINEAR_FORCE,
201
202   // 64 bit texture formats...
203   GFXFormatR16G16B16A16,// first in group...
204   GFXFormatR16G16B16A16F,
205
206   // 128 bit texture formats...
207   GFXFormatR32G32B32A32F,// first in group...
208
209   // unknown size...
210   GFXFormatDXT1,// first in group...
211   GFXFormatDXT2,
212   GFXFormatDXT3,
213   GFXFormatDXT4,
214   GFXFormatDXT5,
215
216   GFXFormat_COUNT,
217
218   GFXFormat_8BIT = GFXFormatA8,
219   GFXFormat_16BIT = GFXFormatR5G6B5,
220   GFXFormat_24BIT = GFXFormatR8G8B8,
221   GFXFormat_32BIT = GFXFormatR8G8B8A8,
222   GFXFormat_64BIT = GFXFormatR16G16B16A16,
223   GFXFormat_128BIT = GFXFormatR32G32B32A32F,
224   GFXFormat_UNKNOWNSIZE = GFXFormatDXT1,
225};
226
227/// Returns the byte size of the pixel for non-compressed formats.
228inline U32 GFXFormat_getByteSize( GFXFormat format )
229{
230   AssertFatal( format < GFXFormat_UNKNOWNSIZE, 
231      "GFXDevice::formatByteSize - Cannot size a compressed format!" );
232
233   if ( format < GFXFormat_16BIT )
234      return 1;// 8 bit...
235   else if ( format < GFXFormat_24BIT )
236      return 2;// 16 bit...
237   else if ( format < GFXFormat_32BIT )
238      return 3;// 24 bit...
239   else if ( format < GFXFormat_64BIT )
240      return 4;// 32 bit...
241   else if ( format < GFXFormat_128BIT )
242      return 8;// 64 bit...
243
244   // This should be 128bits... else its a DDS and 
245   // the assert should have gone off above.
246   return 16;
247}
248
249enum GFXShadeMode 
250{
251   GFXShadeFlat = 1,
252   GFXShadeGouraud,
253   GFXShadePhong,
254};
255
256enum GFXClearFlags 
257{
258   GFXClearTarget = 1 << 0,
259   GFXClearZBuffer = 1 << 1,
260   GFXClearStencil = 1 << 2,
261};
262
263/// The supported blend modes.
264enum GFXBlend 
265{
266   GFXBlend_FIRST = 0,
267   GFXBlendZero = 0, /// (0, 0, 0, 0)
268   GFXBlendOne, /// (1, 1, 1, 1)
269   GFXBlendSrcColor, /// (Rs, Gs, Bs, As)
270   GFXBlendInvSrcColor, /// (1 - Rs, 1 - Gs, 1 - Bs, 1 - As)
271   GFXBlendSrcAlpha, /// (As, As, As, As)
272   GFXBlendInvSrcAlpha, /// ( 1 - As, 1 - As, 1 - As, 1 - As)
273   GFXBlendDestAlpha, /// (Ad Ad Ad Ad)
274   GFXBlendInvDestAlpha, /// (1 - Ad 1 - Ad 1 - Ad 1 - Ad)
275   GFXBlendDestColor, /// (Rd, Gd, Bd, Ad)
276   GFXBlendInvDestColor, /// (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad)
277   GFXBlendSrcAlphaSat, /// (f, f, f, 1) where f = min(As, 1 - Ad)
278   GFXBlend_COUNT
279};
280
281/// Constants that name each GFXDevice type. Any new GFXDevice subclass must be
282/// added to this enum. A string representing its name must also be added to
283/// GFXInit::getAdapterNameFromType().
284enum GFXAdapterType 
285{
286   OpenGL = 0,
287   Direct3D11,
288   Direct3D9,
289   NullDevice,
290   Direct3D9_360,
291   GFXAdapterType_Count
292};
293
294enum GFXCullMode
295{
296   GFXCull_FIRST = 0,
297   GFXCullNone = 0,
298   GFXCullCW,
299   GFXCullCCW,
300   GFXCull_COUNT
301};
302
303enum GFXCmpFunc 
304{
305   GFXCmp_FIRST = 0,
306   GFXCmpNever = 0,
307   GFXCmpLess,
308   GFXCmpEqual,
309   GFXCmpLessEqual,
310   GFXCmpGreater,
311   GFXCmpNotEqual,
312   GFXCmpGreaterEqual,
313   GFXCmpAlways,
314   GFXCmp_COUNT
315};
316
317enum GFXStencilOp 
318{
319   GFXStencilOp_FIRST = 0,
320   GFXStencilOpKeep = 0,
321   GFXStencilOpZero,
322   GFXStencilOpReplace,
323   GFXStencilOpIncrSat,
324   GFXStencilOpDecrSat,
325   GFXStencilOpInvert,
326   GFXStencilOpIncr,
327   GFXStencilOpDecr,
328   GFXStencilOp_COUNT
329};
330
331enum GFXMaterialColorSource 
332{
333   GFXMCSMaterial = 0,
334   GFXMCSColor1,
335   GFXMCSColor2,
336};
337
338enum GFXBlendOp 
339{ 
340   GFXBlendOp_FIRST = 0,
341   GFXBlendOpAdd = 0,
342   GFXBlendOpSubtract,
343   GFXBlendOpRevSubtract,
344   GFXBlendOpMin,
345   GFXBlendOpMax,
346   GFXBlendOp_COUNT
347};
348
349enum GFXRenderState 
350{
351   GFXRenderState_FIRST = 0,
352   GFXRSZEnable = 0,
353   GFXRSFillMode,
354   GFXRSShadeMode,
355   GFXRSZWriteEnable,
356   GFXRSAlphaTestEnable,
357   GFXRSLastPixel,
358   GFXRSSrcBlend,
359   GFXRSDestBlend,
360   GFXRSCullMode,
361   GFXRSZFunc,
362   GFXRSAlphaRef,
363   GFXRSAlphaFunc,
364   GFXRSDitherEnable,
365   GFXRSAlphaBlendEnable,
366   GFXRSFogEnable,
367   GFXRSSpecularEnable,
368   GFXRSFogColor,
369   GFXRSFogTableMode,
370   GFXRSFogStart,
371   GFXRSFogEnd,
372   GFXRSFogDensity,
373   GFXRSRangeFogEnable,
374   GFXRSStencilEnable,
375   GFXRSStencilFail,
376   GFXRSStencilZFail,
377   GFXRSStencilPass,
378   GFXRSStencilFunc,
379   GFXRSStencilRef,
380   GFXRSStencilMask,
381   GFXRSStencilWriteMask,
382   GFXRSTextureFactor,
383   GFXRSWrap0,
384   GFXRSWrap1,
385   GFXRSWrap2,
386   GFXRSWrap3,
387   GFXRSWrap4,
388   GFXRSWrap5,
389   GFXRSWrap6,
390   GFXRSWrap7,
391   GFXRSClipping,
392   GFXRSLighting,
393   GFXRSAmbient,
394   GFXRSFogVertexMode,
395   GFXRSColorVertex,
396   GFXRSLocalViewer,
397   GFXRSNormalizeNormals,
398   GFXRSDiffuseMaterialSource,
399   GFXRSSpecularMaterialSource,
400   GFXRSAmbientMaterialSource,
401   GFXRSEmissiveMaterialSource,
402   GFXRSVertexBlend,
403   GFXRSClipPlaneEnable,
404   GFXRSPointSize,
405   GFXRSPointSizeMin,
406   GFXRSPointSpriteEnable,
407   GFXRSPointScaleEnable,
408   GFXRSPointScale_A,
409   GFXRSPointScale_B,
410   GFXRSPointScale_C,
411   GFXRSMultiSampleantiAlias,
412   GFXRSMultiSampleMask,
413   GFXRSPatchEdgeStyle,
414   GFXRSDebugMonitorToken,
415   GFXRSPointSize_Max,
416   GFXRSIndexedVertexBlendEnable,
417   GFXRSColorWriteEnable,
418   GFXRSTweenFactor,
419   GFXRSBlendOp,
420   GFXRSPositionDegree,
421   GFXRSNormalDegree,
422   GFXRSScissorTestEnable,
423   GFXRSSlopeScaleDepthBias,
424   GFXRSAntiAliasedLineEnable,
425   GFXRSMinTessellationLevel,
426   GFXRSMaxTessellationLevel,
427   GFXRSAdaptiveTess_X,
428   GFXRSAdaptiveTess_Y,
429   GFXRSdaptiveTess_Z,
430   GFXRSAdaptiveTess_W,
431   GFXRSEnableAdaptiveTesselation,
432   GFXRSTwoSidedStencilMode,
433   GFXRSCCWStencilFail,
434   GFXRSCCWStencilZFail,
435   GFXRSCCWStencilPass,
436   GFXRSCCWStencilFunc,
437   GFXRSColorWriteEnable1,
438   GFXRSColorWriteEnable2,
439   GFXRSolorWriteEnable3,
440   GFXRSBlendFactor,
441   GFXRSSRGBWriteEnable,
442   GFXRSDepthBias,
443   GFXRSWrap8,
444   GFXRSWrap9,
445   GFXRSWrap10,
446   GFXRSWrap11,
447   GFXRSWrap12,
448   GFXRSWrap13,
449   GFXRSWrap14,
450   GFXRSWrap15,
451   GFXRSSeparateAlphaBlendEnable,
452   GFXRSSrcBlendAlpha,
453   GFXRSDestBlendAlpha,
454   GFXRSBlendOpAlpha,
455   GFXRenderState_COUNT          ///< Don't use this one, this is a counter
456};
457
458#define GFXCOLORWRITEENABLE_RED     1
459#define GFXCOLORWRITEENABLE_GREEN   2
460#define GFXCOLORWRITEENABLE_BLUE    4
461#define GFXCOLORWRITEENABLE_ALPHA   8
462
463enum GFXTextureStageState 
464{
465   GFXTSS_FIRST = 0,
466   GFXTSSColorOp = 0,
467   GFXTSSColorArg1,
468   GFXTSSColorArg2,
469   GFXTSSAlphaOp,
470   GFXTSSAlphaArg1,
471   GFXTSSAlphaArg2,
472   GFXTSSBumpEnvMat00,
473   GFXTSSBumpEnvMat01,
474   GFXTSSBumpEnvMat10,
475   GFXTSSBumpEnvMat11,
476   GFXTSSTexCoordIndex,
477   GFXTSSBumpEnvlScale,
478   GFXTSSBumpEnvlOffset,
479   GFXTSSTextureTransformFlags,
480   GFXTSSColorArg0,
481   GFXTSSAlphaArg0,
482   GFXTSSResultArg,
483   GFXTSSConstant,
484   GFXTSS_COUNT            ///< Don't use this one, this is a counter
485};
486
487enum GFXTextureTransformFlags
488{
489   GFXTTFFDisable = 0,
490   GFXTTFFCoord1D = 1,
491   GFXTTFFCoord2D = 2,
492   GFXTTFFCoord3D = 3,
493   GFXTTFFCoord4D = 4,
494   GFXTTFFProjected = 256,
495};
496
497// CodeReview: This number is used for the declaration of variables, but it
498// should *not* be used for any run-time purposes [7/2/2007 Pat]
499#define TEXTURE_STAGE_COUNT 16
500
501enum GFXSamplerState 
502{
503   GFXSAMP_FIRST = 0,
504   GFXSAMPAddressU = 0,
505   GFXSAMPAddressV,
506   GFXSAMPAddressW,
507   GFXSAMPBorderColor,
508   GFXSAMPMagFilter,
509   GFXSAMPMinFilter,
510   GFXSAMPMipFilter,
511   GFXSAMPMipMapLODBias,
512   GFXSAMPMaxMipLevel,
513   GFXSAMPMaxAnisotropy,
514   GFXSAMPSRGBTexture,
515   GFXSAMPElementIndex,
516   GFXSAMPDMapOffset,
517   GFXSAMP_COUNT          ///< Don't use this one, this is a counter
518};
519
520enum GFXTextureArgument 
521{
522   GFXTA_FIRST = 0,
523   GFXTADiffuse = 0,
524   GFXTACurrent,
525   GFXTATexture,
526   GFXTATFactor,
527   GFXTASpecular,
528   GFXTATemp,
529   GFXTAConstant,
530   GFXTA_COUNT,
531   GFXTAComplement = 0x00000010,       // take 1.0 - x (read modifier)
532   GFXTAAlphaReplicate = 0x00000020,   // replicate alpha to color components (read modifier)
533};
534
535// Matrix stuff
536#define WORLD_STACK_MAX 24
537
538enum GFXMatrixType 
539{
540   GFXMatrixWorld = 256,
541   GFXMatrixView = 2,
542   GFXMatrixProjection = 3,
543   GFXMatrixTexture = 16,     // This value is texture matrix for sampler 0, can use this for offset
544   GFXMatrixTexture0 = 16,
545   GFXMatrixTexture1 = 17,
546   GFXMatrixTexture2 = 18,
547   GFXMatrixTexture3 = 19,
548   GFXMatrixTexture4 = 20,
549   GFXMatrixTexture5 = 21,
550   GFXMatrixTexture6 = 22,
551   GFXMatrixTexture7 = 23,
552};
553
554// Light define
555#define LIGHT_STAGE_COUNT 8
556
557#define GFXVERTEXFLAG_F32     3
558#define GFXVERTEXFLAG_POINT2F 0
559#define GFXVERTEXFLAG_POINT3F 1 
560#define GFXVERTEXFLAG_POINT4F 2
561
562#define GFXVERTEXFLAG_TEXCOORD_F32(CoordIndex)     ( GFXVERTEXFLAG_F32     << ( CoordIndex * 2 + 16 ) ) 
563#define GFXVERTEXFLAG_TEXCOORD_POINT2F(CoordIndex) ( GFXVERTEXFLAG_POINT2F ) 
564#define GFXVERTEXFLAG_TEXCOORD_POINT3F(CoordIndex) ( GFXVERTEXFLAG_POINT3F << ( CoordIndex * 2 + 16 ) ) 
565#define GFXVERTEXFLAG_TEXCOORD_POINT4F(CoordIndex) ( GFXVERTEXFLAG_POINT4F << ( CoordIndex * 2 + 16 ) )
566
567#define STATE_STACK_SIZE 32
568
569// Index Formats
570enum GFXIndexFormat 
571{
572   GFXIndexFormat_FIRST = 0,
573   GFXIndexFormat16 = 0,
574   GFXIndexFormat32,
575   GFXIndexFormat_COUNT
576};
577
578enum GFXShaderConstType
579{
580   /// GFX"S"hader"C"onstant"T"ype
581   // Scalar
582   GFXSCT_Float, 
583   // Vectors
584   GFXSCT_Float2, 
585   GFXSCT_Float3, 
586   GFXSCT_Float4, 
587   // Matrices
588   GFXSCT_Float2x2, 
589   GFXSCT_Float3x3,
590   GFXSCT_Float3x4,
591   GFXSCT_Float4x3,
592   GFXSCT_Float4x4, 
593   // Scalar
594   GFXSCT_Int, 
595   // Vectors
596   GFXSCT_Int2, 
597   GFXSCT_Int3, 
598   GFXSCT_Int4, 
599   // Samplers
600   GFXSCT_Sampler,
601   GFXSCT_SamplerCube
602};
603
604
605/// Defines a vertex declaration type.
606/// @see GFXVertexElement
607/// @see GFXVertexFormat
608enum GFXDeclType
609{
610   GFXDeclType_FIRST = 0,
611
612   /// A single component F32.
613   GFXDeclType_Float = 0,
614
615   /// A two-component F32.
616   /// @see Point2F
617   GFXDeclType_Float2,
618
619   /// A three-component F32. 
620   /// @see Point3F
621   GFXDeclType_Float3,
622
623   /// A four-component F32.
624   /// @see Point4F
625   GFXDeclType_Float4,
626
627   /// A four-component, packed, unsigned bytes mapped to 0 to 1 range.
628   /// @see GFXVertexColor
629   GFXDeclType_Color,
630
631   /// Four-component, packed, unsigned bytes ranged 0-255
632   GFXDeclType_UByte4,
633
634   /// The count of total GFXDeclTypes.
635   GFXDeclType_COUNT,
636};
637
638#endif // _GFXENUMS_H_
639