3D (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

Classes | Namespaces | Defines | Enumerations | Enumerator | Functions | Variables
3D
Graphics

## Classes
struct | csAlphaMode
| Describes how to deal with alpha values in textures. More...
class | csRenderBufferHolder
| Holder of standard renderbuffers. More...
class | csShaderVariable
| Storage class for "shader vars", inheritable variables in the shader system. More...
struct | iFireTexture
| Interface to the 'fire' procedural texture. More...
struct | iHalo
| iHalo: used to render halos (aka "light globes"). More...
struct | iMaterial
| This class represents a material as seen from the engine view. More...
struct | iProcTexture
| Interface to a texture factory. More...
struct | iRenderBuffer
| This is a general buffer. More...
struct | iRenderBufferAccessor
| Interface for renderbuffer accessor. More...
struct | iRenderBufferCallback
| Callback function used upon destruction of render buffer. More...
struct | iShaderVariableAccessor
| Interface to an accessorcallback for shadervariables. More...
struct | iTextureFactory
| Interface to a texture factory. More...
struct | iTextureHandle
| A texture handle as returned by iTextureManager. More...
struct | iTextureManager
| This is the standard texture manager interface. More...
struct | iTextureType
| Texture type. More...
class | CS::StructuredTextureFormat
| Structured representation of a texture format. More...
class | CS::TextureFormatStrings
| Texture format string parser routines. More...
## Namespaces
namespace | CS
| Main namespace for CrystalSpace.
## Defines
#define | CS_MATERIAL_TEXTURE_DIFFUSE "tex diffuse"
| Name string for the material "diffuse" texture.
## Enumerations
enum | { CS_MIXMODE_FACT_ZERO = 0x0, CS_MIXMODE_FACT_ONE = 0x1, CS_MIXMODE_FACT_SRCCOLOR = 0x2, CS_MIXMODE_FACT_SRCCOLOR_INV = 0x3, CS_MIXMODE_FACT_DSTCOLOR = 0x4, CS_MIXMODE_FACT_DSTCOLOR_INV = 0x5, CS_MIXMODE_FACT_SRCALPHA = 0x6, CS_MIXMODE_FACT_SRCALPHA_INV = 0x7, CS_MIXMODE_FACT_DSTALPHA = 0x8, CS_MIXMODE_FACT_DSTALPHA_INV = 0x9, CS_MIXMODE_FACT_COUNT = 0xa, CS_MIXMODE_FACT_MASK = 0xf }
| Mix mode: Blending op factors. More...
enum | { CS::StructuredTextureFormat::compR = 0x01, CS::StructuredTextureFormat::compG = 0x02, CS::StructuredTextureFormat::compB = 0x04, CS::StructuredTextureFormat::compA = 0x08, CS::StructuredTextureFormat::compX = 0x10, CS::StructuredTextureFormat::compL = 0x20, CS::StructuredTextureFormat::compD = 0x40, CS::StructuredTextureFormat::compS = 0x80, CS::StructuredTextureFormat::compRGB = compR | compB | compG, CS::StructuredTextureFormat::compRGBA = compR | compB | compG | compA, CS::StructuredTextureFormat::compLumA = compL | compA, CS::StructuredTextureFormat::compDepthStencil = compD | compS, CS::StructuredTextureFormat::compUnknown = 0x80000000 }
| Bit flags for components present in a format. More...
enum | csRenderBufferComponentType { CS_BUFCOMP_BYTE = 0, CS_BUFCOMP_UNSIGNED_BYTE, CS_BUFCOMP_SHORT, CS_BUFCOMP_UNSIGNED_SHORT, CS_BUFCOMP_INT, CS_BUFCOMP_UNSIGNED_INT, CS_BUFCOMP_FLOAT, CS_BUFCOMP_DOUBLE, CS_BUFCOMP_HALF , CS_BUFCOMP_NORMALIZED = 0x10, CS_BUFCOMP_BYTE_NORM = CS_BUFCOMP_BYTE | CS_BUFCOMP_NORMALIZED, CS_BUFCOMP_UNSIGNED_BYTE_NORM, CS_BUFCOMP_SHORT_NORM, CS_BUFCOMP_UNSIGNED_SHORT_NORM, CS_BUFCOMP_INT_NORM = CS_BUFCOMP_INT | CS_BUFCOMP_NORMALIZED, CS_BUFCOMP_UNSIGNED_INT_NORM }
| Type of components. More...
enum | csRenderBufferLockType { CS_BUF_LOCK_READ = 1, CS_BUF_LOCK_NORMAL }
| Type of lock of a render buffer. More...
enum | csRenderBufferName { , CS_BUFFER_INDEX, CS_BUFFER_POSITION, CS_BUFFER_NORMAL, CS_BUFFER_COLOR, CS_BUFFER_COLOR_UNLIT, CS_BUFFER_TEXCOORD0, CS_BUFFER_TEXCOORD1, CS_BUFFER_TEXCOORD2, CS_BUFFER_TEXCOORD3, CS_BUFFER_TEXCOORD_LIGHTMAP, CS_BUFFER_GENERIC0, CS_BUFFER_GENERIC1, CS_BUFFER_GENERIC2, CS_BUFFER_GENERIC3, CS_BUFFER_TANGENT, CS_BUFFER_BINORMAL, CS_BUFFER_COUNT }
| Defines the names of the renderbuffers as provided by the meshes. More...
enum | csRenderBufferNameMask { CS_BUFFER_INDEX_MASK = 1 << CS_BUFFER_INDEX, CS_BUFFER_POSITION_MASK = 1 << CS_BUFFER_POSITION, CS_BUFFER_NORMAL_MASK = 1 << CS_BUFFER_NORMAL, CS_BUFFER_COLOR_MASK = 1 << CS_BUFFER_COLOR, CS_BUFFER_COLOR_LIGHTING_MASK = 1 << CS_BUFFER_COLOR_UNLIT, CS_BUFFER_TEXCOORD0_MASK = 1 << CS_BUFFER_TEXCOORD0, CS_BUFFER_TEXCOORD1_MASK = 1 << CS_BUFFER_TEXCOORD1, CS_BUFFER_TEXCOORD2_MASK = 1 << CS_BUFFER_TEXCOORD2, CS_BUFFER_TEXCOORD3_MASK = 1 << CS_BUFFER_TEXCOORD3, CS_BUFFER_TEXCOORD_LIGHTMAP_MASK = 1 << CS_BUFFER_TEXCOORD_LIGHTMAP, CS_BUFFER_GENERIC0_MASK = 1 << CS_BUFFER_GENERIC0, CS_BUFFER_GENERIC1_MASK = 1 << CS_BUFFER_GENERIC1, CS_BUFFER_GENERIC2_MASK = 1 << CS_BUFFER_GENERIC2, CS_BUFFER_GENERIC3_MASK = 1 << CS_BUFFER_GENERIC3, CS_BUFFER_TANGENT_MASK = 1 << CS_BUFFER_TANGENT, CS_BUFFER_BINORMAL_MASK = 1 << CS_BUFFER_BINORMAL, CS_BUFFER_ALL_MASK = ~0 }
| Masks for renderbuffer accessors. More...
enum | csRenderBufferType { CS_BUF_DYNAMIC, CS_BUF_STATIC, CS_BUF_STREAM }
| Buffer usage type. More...
enum | csVertexAttrib { CS_VATTRIB_UNUSED = -2, CS_VATTRIB_INVALID = -1, CS_VATTRIB_POSITION = CS_VATTRIB_SPECIFIC_FIRST + 0, CS_VATTRIB_WEIGHT = CS_VATTRIB_SPECIFIC_FIRST + 1, CS_VATTRIB_NORMAL = CS_VATTRIB_SPECIFIC_FIRST + 2, CS_VATTRIB_COLOR = CS_VATTRIB_SPECIFIC_FIRST + 3, CS_VATTRIB_PRIMARY_COLOR = CS_VATTRIB_SPECIFIC_FIRST + 3, CS_VATTRIB_SECONDARY_COLOR = CS_VATTRIB_SPECIFIC_FIRST + 4, CS_VATTRIB_FOGCOORD = CS_VATTRIB_SPECIFIC_FIRST + 5, CS_VATTRIB_TEXCOORD = CS_VATTRIB_SPECIFIC_FIRST + 8, CS_VATTRIB_TEXCOORD0 = CS_VATTRIB_SPECIFIC_FIRST + 8, CS_VATTRIB_TEXCOORD1 = CS_VATTRIB_SPECIFIC_FIRST + 9, CS_VATTRIB_TEXCOORD2 = CS_VATTRIB_SPECIFIC_FIRST + 10, CS_VATTRIB_TEXCOORD3 = CS_VATTRIB_SPECIFIC_FIRST + 11, CS_VATTRIB_TEXCOORD4 = CS_VATTRIB_SPECIFIC_FIRST + 12, CS_VATTRIB_TEXCOORD5 = CS_VATTRIB_SPECIFIC_FIRST + 13, CS_VATTRIB_TEXCOORD6 = CS_VATTRIB_SPECIFIC_FIRST + 14, CS_VATTRIB_TEXCOORD7 = CS_VATTRIB_SPECIFIC_FIRST + 15, CS_VATTRIB_0 = CS_VATTRIB_GENERIC_FIRST + 0, CS_VATTRIB_1 = CS_VATTRIB_GENERIC_FIRST + 1, CS_VATTRIB_2 = CS_VATTRIB_GENERIC_FIRST + 2, CS_VATTRIB_3 = CS_VATTRIB_GENERIC_FIRST + 3, CS_VATTRIB_4 = CS_VATTRIB_GENERIC_FIRST + 4, CS_VATTRIB_5 = CS_VATTRIB_GENERIC_FIRST + 5, CS_VATTRIB_6 = CS_VATTRIB_GENERIC_FIRST + 6, CS_VATTRIB_7 = CS_VATTRIB_GENERIC_FIRST + 7, CS_VATTRIB_8 = CS_VATTRIB_GENERIC_FIRST + 8, CS_VATTRIB_9 = CS_VATTRIB_GENERIC_FIRST + 9, CS_VATTRIB_10 = CS_VATTRIB_GENERIC_FIRST + 10, CS_VATTRIB_11 = CS_VATTRIB_GENERIC_FIRST + 11, CS_VATTRIB_12 = CS_VATTRIB_GENERIC_FIRST + 12, CS_VATTRIB_13 = CS_VATTRIB_GENERIC_FIRST + 13, CS_VATTRIB_14 = CS_VATTRIB_GENERIC_FIRST + 14, CS_VATTRIB_15 = CS_VATTRIB_GENERIC_FIRST + 15, CS_IATTRIB_OBJECT2WORLD = CS_IATTRIB_FIRST + 0 }
| Vertex attributes. More...
enum | csZBufMode { CS_ZBUF_NONE = 0x00000000, CS_ZBUF_FILL = 0x00000001, CS_ZBUF_TEST = 0x00000002, CS_ZBUF_USE = 0x00000003, CS_ZBUF_EQUAL = 0x00000004, CS_ZBUF_INVERT = 0x00000005, CS_ZBUF_MESH = 0x80000000, CS_ZBUF_MESH2 = 0x80000001 }
| Z-buffer modes. More...
enum | CS::StructuredTextureFormat::TextureFormat { CS::StructuredTextureFormat::Invalid = '-', CS::StructuredTextureFormat::Integer = 'i', CS::StructuredTextureFormat::Float = 'f', CS::StructuredTextureFormat::Special = '*' }
| Texture storage format. More...
## Functions
bool | CS::StructuredTextureFormat::AddComponent (char cmp, int size)
| Add a new component to the texture format.
static csString | CS::TextureFormatStrings::ConvertCanonical (const char *in)
| Convert a texture format to a canonical form.
static StructuredTextureFormat | CS::TextureFormatStrings::ConvertStructured (const char *in)
| Convert a (canonical or not) texture format to a structured form.
void | CS::StructuredTextureFormat::FixSizes (int size)
| Fix the unset sizes (i.e.
csString | CS::StructuredTextureFormat::GetCanonical ()
| Convert this structured format to canonical format.
char | CS::StructuredTextureFormat::GetComponent (int n) const
| Get the nth component.
int | CS::StructuredTextureFormat::GetComponentCount () const
| Returns the number of components in this format.
uint | CS::StructuredTextureFormat::GetComponentMask () const
| Return a bit mask that identifies the contained components, regardless of their order.
char | CS::StructuredTextureFormat::GetComponentSize (int n) const
| Get size of the nth component.
TextureFormat | CS::StructuredTextureFormat::GetFormat () const
| Returns the basic storage type for this texture format.
const char * | CS::StructuredTextureFormat::GetSpecial () const
| Return the special format string.
bool | CS::StructuredTextureFormat::IsValid ()
| Returns whether the contained format is a valid texture format.
void | CS::StructuredTextureFormat::SetFormat (TextureFormat format)
| Set the format.
void | CS::StructuredTextureFormat::SetSpecial (const char *special)
| A special format (like '*dxt1').
| CS::StructuredTextureFormat::StructuredTextureFormat ()
| Construct an invalid texture format.
| CS::StructuredTextureFormat::StructuredTextureFormat (char cmp1, int size1, char cmp2=0, int size2=0, char cmp3=0, int size3=0, char cmp4=0, int size4=0, TextureFormat fmt=Integer)
| Construct a texture format with the given components and sizes.
| CS::StructuredTextureFormat::StructuredTextureFormat (const StructuredTextureFormat &other)
| Copy constructor.
| CS::StructuredTextureFormat::~StructuredTextureFormat ()
| Destruct texture format.
## Variables
static const size_t | csRenderBufferComponentSizes [CS_BUFCOMP_BASE_TYPECOUNT]
| Sizes of individual buffer components in bytes.
## iGraphics3D::BeginDraw() flags
#define | CSDRAW_2DGRAPHICS 0x00000001
| We're going to draw 2D graphics.
#define | CSDRAW_3DGRAPHICS 0x00000002
| We're going to draw 3D graphics.
#define | CSDRAW_CLEARZBUFFER 0x00000010
| Clear Z-buffer ?
#define | CSDRAW_CLEARSCREEN 0x00000020
| Clear frame buffer ?
#define | CSDRAW_NOCLIPCLEAR 0x00000040
| Ignore clipping rectangle when clearing?
#define | CSDRAW_READBACK 0x00000080
| Trigger a read back of the render target once drawing is finished.
## Type of clipper (for iGraphics3D::SetClipper())
#define | CS_CLIPPER_NONE -1
| There is no clipper.
#define | CS_CLIPPER_OPTIONAL 0
| Clipper is optional.
#define | CS_CLIPPER_TOPLEVEL 1
| Clipper is top-level.
#define | CS_CLIPPER_REQUIRED 2
| Clipper is required.
## Clipping requirement for DrawTriangleMesh
#define | CS_CLIP_NOT 0
| No clipping required.
#define | CS_CLIP_NEEDED 1
| Clipping may be needed.
## Mix mode: Types
The mix mode specifies how a shaded fragment (denoted as `SRC`) is mixed (or blended) with the framebuffer fragment (`DST`).
#define | CS_MIXMODE_TYPE_AUTO (0x00000000)
| Automatic blending mode.
#define | CS_MIXMODE_TYPE_BLENDOP (0x40000000)
| Blend with a blending operation.
#define | CS_MIXMODE_FLAG_BLENDOP_ALPHA (0x08000000)
| When blending with a blending operation, signinify that separate factors for the alpha channel are present.
#define | CS_MIXMODE_TYPE_MESH (0x80000000)
| Use the mix mode of the mesh mix mode.
#define | CS_MIXMODE_TYPE_MASK (0xc0000000)
| Bit mask to extract the type from a mixmode specifier.
## Mix mode: Alpha test flags
Enabled alpha test (or binary alpha) means that a fragment is only drawn when its alpha component is above a certain threshold, and discarded otherwise.
#define | CS_MIXMODE_ALPHATEST_AUTO (0x00000000)
| Automatic alpha test.
#define | CS_MIXMODE_ALPHATEST_ENABLE (0x10000000)
| Unconditionally enable alpha test.
#define | CS_MIXMODE_ALPHATEST_DISABLE (0x20000000)
| Unconditionally disable alpha test.
#define | CS_MIXMODE_ALPHATEST_MASK (0x30000000)
| Bit mask to extract the alpha test flag from a mixmode specifier.
## Mix mode: Blending mode helpers
#define | CS_MIXMODE_BLEND(Src, Dst)
| Helper macro to construct a blending operation mixmode Src and Dst are blending op factors , however sans the CS_MIXMODE_FACT_ prefix.
#define | CS_MIXMODE_BLENDOP_SRC(mode) ((mode >> 20) & CS_MIXMODE_FACT_MASK)
| Helper macro to extract the `srcFactor` from a blending op mixmode.
#define | CS_MIXMODE_BLENDOP_DST(mode) ((mode >> 16) & CS_MIXMODE_FACT_MASK)
| Helper macro to extract the `dstFactor` from a blending op mixmode.
#define | CS_MIXMODE_BLEND_ALPHA(Src, Dst)
| Helper macro to construct alpha factoes for a blending operation mixmode Src and Dst are blending op factors , however sans the CS_MIXMODE_FACT_ prefix.
#define | CS_MIXMODE_BLENDOP_ALPHA_SRC(mode) ((mode >> 12) & CS_MIXMODE_FACT_MASK)
| Helper macro to extract the alpha `srcFactor` from a blending op mixmode.
#define | CS_MIXMODE_BLENDOP_ALPHA_DST(mode) ((mode >> 8) & CS_MIXMODE_FACT_MASK)
| Helper macro to extract the alpha `dstFactor` from a blending op mixmode.
## Mix mode: Default modes
A set of commonly used mix modes.
#define | CS_FX_COPY (CS_MIXMODE_TYPE_AUTO | CS_MIXMODE_ALPHATEST_AUTO)
| This mixmode uses alpha smooth blending, binary blending (ie enabled alpha test) and no blending depending on the contents of csRenderMesh::alphaMode.
#define | CS_FX_MULTIPLY (CS_MIXMODE_BLEND(DSTCOLOR, ZERO) | CS_MIXMODE_ALPHATEST_DISABLE)
| Multiplicative blending. Formula: `=SRC*DST`
#define | CS_FX_MULTIPLY2 (CS_MIXMODE_BLEND(DSTCOLOR, SRCCOLOR) | CS_MIXMODE_ALPHATEST_DISABLE)
| Multiplicative doubling blending. Formula: `=2*SRC*DST`
#define | CS_FX_ADD (CS_MIXMODE_BLEND(ONE, ONE) | CS_MIXMODE_ALPHATEST_DISABLE)
| Additive blending. Formula: `=SRC+DST`
#define | CS_FX_ALPHA
| Alpha blending.
#define | CS_FX_TRANSPARENT (CS_MIXMODE_BLEND(ZERO, ONE) | CS_MIXMODE_ALPHATEST_DISABLE)
| Transparent blending (keep framebuffer unmodified).
#define | CS_FX_DESTALPHAADD (CS_MIXMODE_BLEND(DSTALPHA, ONE) | CS_MIXMODE_ALPHATEST_DISABLE)
| Multiply source color with destination alpha and add.
#define | CS_FX_SRCALPHAADD (CS_MIXMODE_BLEND(SRCALPHA, ONE) | CS_MIXMODE_ALPHATEST_DISABLE)
| Multiply source color with source alpha and add.
#define | CS_FX_PREMULTALPHA
| Multiply destination color with inverse source alpha and add source color.
#define | CS_FX_MESH (CS_MIXMODE_TYPE_MESH)
| Use the mix mode of the mesh mix mode.
#define | CS_FX_FLAT (0x04000000)
| Flat shading flag.
#define | CS_FX_MASK_ALPHA (0x000000FF)
| Mixmode alpha part.
#define | CS_FX_MASK_MIXMODE (0xf8ffff00)
| Bit mask for bits relevant to mix mode comparison; contains type, alpha test flags and blending op factors.
## Mix mode: alpha helpers
#define | CS_FX_SETALPHA(alpha) (CS_FX_ALPHA | uint ((alpha) * CS_FX_MASK_ALPHA))
| Macro for setting of alpha bits into mixmode (alpha between 0 and 1).
#define | CS_FX_SETALPHA_INT(alpha) (CS_FX_ALPHA | uint ((alpha) & CS_FX_MASK_ALPHA))
| Macro for setting of alpha bits into mixmode (alpha between 0 and 255).
## Texture registration flags.
During texture registration you should tell the manager which way you're going to use the texture: whenever you're going to use it for 2D (DrawPixmap ()), for 3D (DrawPolygon ()), whenever the texture will be dynamically modified.
#define | CS_TEXTURE_2D 0x00000001
| You're going to use the texture for 2D drawing.
#define | CS_TEXTURE_3D 0x00000002
| You're going to use the texture for 3D drawing.
#define | CS_TEXTURE_NOMIPMAPS 0x00000008
| Create mipmaps for this texture? Sometimes we know in advance that some texture will need just one mipmap (or we just don't care about the mipmapping artifacts because of, say, how texture is looking (smoothed etc)).
#define | CS_TEXTURE_CLAMP 0x00000010
| This texture will not be tiled, and color lookups outside the 0..1 range will be clamped to the edge of the texture.
#define | CS_TEXTURE_NOFILTER 0x00000020
| This texture will not be filtered, even if texture filtering is available.
#define | CS_TEXTURE_NPOTS 0x00000040
| Store texture as non-power-of-two sized (NPOTS) if possible.
#define | CS_TEXTURE_SCALE_UP 0x00000080
| Texture resizing control flag.
#define | CS_TEXTURE_SCALE_DOWN 0x00000100
| Texture resizing control flag.
#define | CS_TEXTURE_CREATE_CLEAR 0x00000200
| Create cleared texture.
#define | CS_TEXTURE_CUBEMAP_DISABLE_SEAMLESS 0x00000400
| Disable filtering across edges for a cubemap.

### Texture format strings

## Special formats

Special formats are simple: they're designated by a string starting with `*`, everything else afterwards is arbitrary.

Examples:

- `*dxt1` DXT1 compressed texture
- `*3dc` 3Dc compressed texture

## General formats

The general syntax is (in dog EBNF):

     format := components {components} [_ format]
     components := component {component} size

whereas `component` is the component type, summarized below, `size` is the width of the component, in bit, and `format` is an optional specifier for the component format.

### Component types

- `r` Red
- `g` Green
- `b` Blue
- `a` Alpha
- `x` Junk (unused)
- `l` Luminance
- `d` Depth
- `s` Stencil

### Format

Format optionally specifies how the data is encoded.

- `f` Float
- `i` Unsigned integer

Examples:

- `abgr32_f:` Red, green, blue, alpha are stored as 32-bit floats.

### Matching components and sizes

A component has the size as specified by the next size specifier right of it.

Examples:

- `argb8, a8r8g8b8:` Red, green, blue, alpha are all 8 bit wide.
- `r5g6b5:` Red is 5 bit wide, green 6 bit, blue 5bit.
- `x1rgb5, x1r5g5b5:` Red, green, blue are all 5 bit wide. One bit is unused.

### Storage

The leftmost component is stored in the most significant bits; the rightmost component in the least significant bits. A tuple of components is interpreted as a word with the size being the sum of all component sizes, rounded up to the next multiple of 8. These words are then stored in little-endian.

This means that for formats with 8-bit components, the bytes in memory are swapped in comparison to their order in the format string. See the examples.

Examples:

- `argb8` When interpreted as 32-bit words, blue is in bits 0-7, green in 8-15, red in 16-23, alpha 24-31. When interpreted as bytes, it's four bytes, the first stores blue, the second green, the third red, the fourth alpha.
- `r5g6b5:` Red is stored in the 5 most significant bits of the second byte, green in the 3 least significant bits of the second byte and 3 most significant bits of the first byte, blue in the 5 least significant bits of the first byte.

### Canonical Format

Canonical format strings, in comparison to "normal" format strings, require all "optional" parts to be present. That is,

- after each component a size must appear,
- a format specifier must appear.

Examples:

- `rgba32_f` becomes `r32g32b32a32_f`
- `r5g6b5` becomes `r5g6b6_i`
- `b8g8r8_i` becomes `b8g8r8_i`
- `d24` becomes `d24_i`
- `d24s8` becomes `d24s8_i`
- `*dxt1`, as a special format, stays `*dxt1`
- Any invalid format becomes `-`

### More examples

- `d24:` 24-bit depth texture.
- `d24s8:` Combined 24-bit depth and 8-bit stencil texture.

## Define Documentation

#define CS_CLIP_NEEDED 1

Clipping may be needed.

Depending on the type of the clipper (one of the CS_CLIPPER_??? flags) the renderer has to clip or not. (setting for clip_portal, clip_plane, or clip_z_plane).

Definition at line 121 of file graph3d.h.

#define CS_CLIP_NOT 0

No clipping required.

(setting for clip_portal, clip_plane, or clip_z_plane).

Definition at line 115 of file graph3d.h.

#define CS_CLIPPER_NONE -1

There is no clipper.

Definition at line 94 of file graph3d.h.

#define CS_CLIPPER_OPTIONAL 0

Clipper is optional.

Definition at line 98 of file graph3d.h.

#define CS_CLIPPER_REQUIRED 2

Clipper is required.

Definition at line 106 of file graph3d.h.

#define CS_CLIPPER_TOPLEVEL 1

Clipper is top-level.

Definition at line 102 of file graph3d.h.

#define CS_FX_ADD (CS_MIXMODE_BLEND(ONE, ONE) | CS_MIXMODE_ALPHATEST_DISABLE)

Additive blending. Formula: `=SRC+DST`

Definition at line 390 of file graph3d.h.

#define CS_FX_ALPHA

Value:

    (CS_MIXMODE_BLEND(SRCALPHA, SRCALPHA_INV) \
        | CS_MIXMODE_BLEND_ALPHA(ONE, SRCALPHA_INV) | CS_MIXMODE_ALPHATEST_DISABLE)

Alpha blending.

Formula: `=srcAlpha*SRC + (1-srcAlpha)*DST`

Remarks:
  Usually used with a non-zero alpha part.

See also:
  CS_FX_MASK_ALPHA,
  CS_FX_SETALPHA

Definition at line 397 of file graph3d.h.

#define CS_FX_COPY (CS_MIXMODE_TYPE_AUTO | CS_MIXMODE_ALPHATEST_AUTO)

This mixmode uses alpha smooth blending, binary blending (ie enabled alpha test) and no blending depending on the contents of csRenderMesh::alphaMode.

Remarks:
  For a "true" copy mixmode that just writes the source fragment color to the frame buffer, you can use:

         CS_MIXMODE_BLEND(ONE, ZERO) | CS_MIXMODE_ALPHATEST_DISABLE

Definition at line 382 of file graph3d.h.

#define CS_FX_DESTALPHAADD (CS_MIXMODE_BLEND(DSTALPHA, ONE) | CS_MIXMODE_ALPHATEST_DISABLE)

Multiply source color with destination alpha and add.

Formula: `=(dstalpha)*SRC + DST`

Definition at line 411 of file graph3d.h.

#define CS_FX_FLAT (0x04000000)

Flat shading flag.

Definition at line 438 of file graph3d.h.

#define CS_FX_MASK_ALPHA (0x000000FF)

Mixmode alpha part.

Values range from 0(opaque) to 255 (transparent) (note that this is the reverse of the "common" alpha meaning). When this part is non-null, the renderer will scale the incoming color buffer alpha components by the (inverse of) this value.

Remarks:
  The scaling may be relatively expensive, it is recommended to scale the vertex alpha by other means, e.g. through a vertex program.

Definition at line 448 of file graph3d.h.

#define CS_FX_MASK_MIXMODE (0xf8ffff00)

Bit mask for bits relevant to mix mode comparison; contains type, alpha test flags and blending op factors.

Definition at line 454 of file graph3d.h.

#define CS_FX_MESH (CS_MIXMODE_TYPE_MESH)

Use the mix mode of the mesh mix mode.

Warning:
  NOT VALID AS MESH MIXMODE - only for shader pass mixmodes.

Definition at line 435 of file graph3d.h.

#define CS_FX_MULTIPLY (CS_MIXMODE_BLEND(DSTCOLOR, ZERO) | CS_MIXMODE_ALPHATEST_DISABLE)

Multiplicative blending. Formula: `=SRC*DST`

Definition at line 384 of file graph3d.h.

#define CS_FX_MULTIPLY2 (CS_MIXMODE_BLEND(DSTCOLOR, SRCCOLOR) | CS_MIXMODE_ALPHATEST_DISABLE)

Multiplicative doubling blending. Formula: `=2*SRC*DST`

Definition at line 387 of file graph3d.h.

#define CS_FX_PREMULTALPHA

Value:

    (CS_MIXMODE_BLEND(ONE, SRCALPHA_INV) | \
        CS_MIXMODE_BLEND_ALPHA(ONE, SRCALPHA_INV) | CS_MIXMODE_ALPHATEST_DISABLE)

Multiply destination color with inverse source alpha and add source color.

Formula: `=SRC + DST*(1-srcalpha)`

Remarks:
  When the `SRC` alpha component was multiplied into the source color, this acts like alpha blending; if it was not, it acts like additive blending. Hence, this mixmode can be used to use both additive and alpha blending on the same triangle even and interpolate between those two "extremes" by appropriate choice of the color and alpha values.

Definition at line 428 of file graph3d.h.

#define CS_FX_SETALPHA | ( |  | alpha | ) | (CS_FX_ALPHA | uint ((alpha) * CS_FX_MASK_ALPHA))

Macro for setting of alpha bits into mixmode (alpha between 0 and 1).

Definition at line 460 of file graph3d.h.

#define CS_FX_SETALPHA_INT | ( |  | alpha | ) | (CS_FX_ALPHA | uint ((alpha) & CS_FX_MASK_ALPHA))

Macro for setting of alpha bits into mixmode (alpha between 0 and 255).

Definition at line 463 of file graph3d.h.

#define CS_FX_SRCALPHAADD (CS_MIXMODE_BLEND(SRCALPHA, ONE) | CS_MIXMODE_ALPHATEST_DISABLE)

Multiply source color with source alpha and add.

Formula: `=(srcalpha)*SRC + DST`

Definition at line 417 of file graph3d.h.

#define CS_FX_TRANSPARENT (CS_MIXMODE_BLEND(ZERO, ONE) | CS_MIXMODE_ALPHATEST_DISABLE)

Transparent blending (keep framebuffer unmodified).

Formula: `=DST`

Remarks:
  The Z buffer will still be modified!

Definition at line 405 of file graph3d.h.

#define CS_MATERIAL_TEXTURE_DIFFUSE "tex diffuse"

Name string for the material "diffuse" texture.

Definition at line 36 of file material.h.

#define CS_MIXMODE_ALPHATEST_AUTO (0x00000000)

Automatic alpha test.

Whether the texture is alpha-blended binarily is taken from csRenderMesh::alphaMode and whether the alpha part of the mixmode is non-zero.

Definition at line 318 of file graph3d.h.

#define CS_MIXMODE_ALPHATEST_DISABLE (0x20000000)

Unconditionally disable alpha test.

Definition at line 322 of file graph3d.h.

#define CS_MIXMODE_ALPHATEST_ENABLE (0x10000000)

Unconditionally enable alpha test.

Definition at line 320 of file graph3d.h.

#define CS_MIXMODE_ALPHATEST_MASK (0x30000000)

Bit mask to extract the alpha test flag from a mixmode specifier.

Definition at line 325 of file graph3d.h.

#define CS_MIXMODE_BLEND | ( |  | Src,
|  |  | Dst
| ) |  |

Value:

    (CS_MIXMODE_TYPE_BLENDOP                                                \
      | (CS_MIXMODE_FACT_ ## Src << 20) | (CS_MIXMODE_FACT_ ## Dst << 16))

Helper macro to construct a blending operation mixmode Src and Dst are blending op factors , however sans the CS_MIXMODE_FACT_ prefix.

E.g.:

     uint mixmode = CS_MIXMODE_BLEND(SRCALPHA, SRCALPHA_INV);

will generate a blending operation for alpha blending.

Definition at line 340 of file graph3d.h.

#define CS_MIXMODE_BLEND_ALPHA | ( |  | Src,
|  |  | Dst
| ) |  |

Value:

    (CS_MIXMODE_FLAG_BLENDOP_ALPHA                                  \
      | (CS_MIXMODE_FACT_ ## Src << 12) | (CS_MIXMODE_FACT_ ## Dst << 8))

Helper macro to construct alpha factoes for a blending operation mixmode Src and Dst are blending op factors , however sans the CS_MIXMODE_FACT_ prefix.

E.g.:

     uint mixmode = CS_MIXMODE_BLEND(SRCALPHA, SRCALPHA_INV)
       | CS_MIXMODE_BLEND_ALPHA(ONE, SRCALPHA_INV);

will generate a blending operation for alpha blending with the written destination alpha values suitable for use for premultiplied alpha blending.

Definition at line 360 of file graph3d.h.

#define CS_MIXMODE_BLENDOP_ALPHA_DST | ( |  | mode | ) | ((mode >> 8) & CS_MIXMODE_FACT_MASK)

Helper macro to extract the alpha `dstFactor` from a blending op mixmode.

Definition at line 366 of file graph3d.h.

#define CS_MIXMODE_BLENDOP_ALPHA_SRC | ( |  | mode | ) | ((mode >> 12) & CS_MIXMODE_FACT_MASK)

Helper macro to extract the alpha `srcFactor` from a blending op mixmode.

Definition at line 364 of file graph3d.h.

#define CS_MIXMODE_BLENDOP_DST | ( |  | mode | ) | ((mode >> 16) & CS_MIXMODE_FACT_MASK)

Helper macro to extract the `dstFactor` from a blending op mixmode.

Definition at line 346 of file graph3d.h.

#define CS_MIXMODE_BLENDOP_SRC | ( |  | mode | ) | ((mode >> 20) & CS_MIXMODE_FACT_MASK)

Helper macro to extract the `srcFactor` from a blending op mixmode.

Definition at line 344 of file graph3d.h.

#define CS_MIXMODE_FLAG_BLENDOP_ALPHA (0x08000000)

When blending with a blending operation, signinify that separate factors for the alpha channel are present.

Definition at line 266 of file graph3d.h.

#define CS_MIXMODE_TYPE_AUTO (0x00000000)

Automatic blending mode.

Whether the texture is alpha-blended or not is taken from csRenderMesh::alphaMode and whether the alpha part of the mixmode is non-zero.

Definition at line 252 of file graph3d.h.

#define CS_MIXMODE_TYPE_BLENDOP (0x40000000)

Blend with a blending operation.

The fragment value written to the framebuffer is computed from the formula `SRC` * `srcFactor` + `DST` * `dstFactor`. `srcFactor` and `dstFactor` are one of CS_MIXMODE_FACT_xxx , encoded into the mixmode specifier with CS_MIXMODE_BLEND.

Definition at line 261 of file graph3d.h.

#define CS_MIXMODE_TYPE_MASK (0xc0000000)

Bit mask to extract the type from a mixmode specifier.

Definition at line 274 of file graph3d.h.

#define CS_MIXMODE_TYPE_MESH (0x80000000)

Use the mix mode of the mesh mix mode.

Warning:
  NOT VALID AS MESH MIXMODE - only for shader pass mixmodes.

Definition at line 271 of file graph3d.h.

#define CS_TEXTURE_2D 0x00000001

You're going to use the texture for 2D drawing.

Definition at line 53 of file txtmgr.h.

#define CS_TEXTURE_3D 0x00000002

You're going to use the texture for 3D drawing.

Definition at line 55 of file txtmgr.h.

#define CS_TEXTURE_CLAMP 0x00000010

This texture will not be tiled, and color lookups outside the 0..1 range will be clamped to the edge of the texture.

Definition at line 70 of file txtmgr.h.

#define CS_TEXTURE_CREATE_CLEAR 0x00000200

Create cleared texture.

When creating a texture with iTextureManager::CreateTexture() its contents are by default undefined. Setting this flag will clear the texture. It only has an effect when used with iTextureManager::CreateTexture().

Definition at line 117 of file txtmgr.h.

#define CS_TEXTURE_CUBEMAP_DISABLE_SEAMLESS 0x00000400

Disable filtering across edges for a cubemap.

By default, cubemaps are seamless (when filtering near an edge of a face, pixels from neighboring faces are sampled as well). However, this may be undesireable in certain cases (e.g. lookup textures). In that case, seamless filtering can be selectively disabled.

Remarks:
  Seamless filtering is subject to hardware/driver support. On some hardware/drivers, seamless filtering is a global flag. "Disable seamless" takes precedence, so if one texture with seamless disabled is used, seamless filtering is disabled globally.

Definition at line 129 of file txtmgr.h.

#define CS_TEXTURE_NOFILTER 0x00000020

This texture will not be filtered, even if texture filtering is available.

Definition at line 74 of file txtmgr.h.

#define CS_TEXTURE_NOMIPMAPS 0x00000008

Create mipmaps for this texture? Sometimes we know in advance that some texture will need just one mipmap (or we just don't care about the mipmapping artifacts because of, say, how texture is looking (smoothed etc)).

This flag is a hint for texture manager so that it will know this.

Note that if texture is not registered for 3D usage (i.e. if CS_TEXTURE_3D is not set) this flag does not matter - 2D textures do not use mipmaps.

Definition at line 65 of file txtmgr.h.

#define CS_TEXTURE_NPOTS 0x00000040

Store texture as non-power-of-two sized (NPOTS) if possible.

Remarks:
  On a lot of hardware, support for NPOTS-texture is rather limited; for example, commonly only clamped and textures without mipmaps are supported, hence a texture may only be considered for NPOTS use if the CS_TEXTURE_CLAMP and CS_TEXTURE_NOMIPMAPS flags are also set. Some hardware may not support NPOTS textures at all. It is at the discretion of the renderer to decide whether a texture really becomes NPOTS or not. This flag serves merely as an expression of the wish that a texture should be NPOTS, if possible. If that cannot be granted, the flag will be removed (thus you can query whether a texture was stored NPOTS or not by checking if this flag is set on it).

Definition at line 88 of file txtmgr.h.

#define CS_TEXTURE_SCALE_DOWN 0x00000100

Texture resizing control flag.

If a texture needs to be resized to power-of-two dimensions (either because non-power-of-two textures are not supported or just not requested), specify that powers of two smaller than or equal to the original dimensions should be selected.

See also:
  CS_TEXTURE_SCALE_UP

Remarks:
  If none or both texture scale flags are specified, the renderer will decide whether a dimension is scaled up or down.

Definition at line 110 of file txtmgr.h.

#define CS_TEXTURE_SCALE_UP 0x00000080

Texture resizing control flag.

If a texture needs to be resized to power-of-two dimensions (either because non-power-of-two textures are not supported or just not requested), specify that powers of two larger than or equal to the original dimensions should be selected.

See also:
  CS_TEXTURE_SCALE_DOWN

Remarks:
  If none or both texture scale flags are specified, the renderer will decide whether a dimension is scaled up or down.

Definition at line 99 of file txtmgr.h.

#define CSDRAW_2DGRAPHICS 0x00000001

We're going to draw 2D graphics.

Definition at line 72 of file graph3d.h.

#define CSDRAW_3DGRAPHICS 0x00000002

We're going to draw 3D graphics.

Definition at line 74 of file graph3d.h.

#define CSDRAW_CLEARSCREEN 0x00000020

Clear frame buffer ?

Definition at line 78 of file graph3d.h.

#define CSDRAW_CLEARZBUFFER 0x00000010

Clear Z-buffer ?

Definition at line 76 of file graph3d.h.

#define CSDRAW_NOCLIPCLEAR 0x00000040

Ignore clipping rectangle when clearing?

Definition at line 80 of file graph3d.h.

#define CSDRAW_READBACK 0x00000080

Trigger a read back of the render target once drawing is finished.

The read back data must be retrieved with iTextureHandle::Readback(). Has no effect if no render target is set.

Definition at line 86 of file graph3d.h.

## Enumeration Type Documentation

anonymous enum

Mix mode: Blending op factors.

Enumerator:

  CS_MIXMODE_FACT_ZERO | 0
  CS_MIXMODE_FACT_ONE | -(e^(i*Pi))
  CS_MIXMODE_FACT_SRCCOLOR | Source fragment (R,G,B,A) components.
  CS_MIXMODE_FACT_SRCCOLOR_INV | Source fragment (1-R,1-G,1-B,-1A) components.
  CS_MIXMODE_FACT_DSTCOLOR | Destination fragment (R,G,B,A) components.
  CS_MIXMODE_FACT_DSTCOLOR_INV | Destination fragment (1-R,1-G,1-B,-1A) components.
  CS_MIXMODE_FACT_SRCALPHA | Source fragment alpha.
  CS_MIXMODE_FACT_SRCALPHA_INV | Source fragment 1-alpha.
  CS_MIXMODE_FACT_DSTALPHA | Destination fragment alpha.
  CS_MIXMODE_FACT_DSTALPHA_INV | Destination fragment 1-alpha.
  CS_MIXMODE_FACT_COUNT | Number of available mixmodes.
  CS_MIXMODE_FACT_MASK | Mask to extract factors.

Definition at line 278 of file graph3d.h.

anonymous enum

Bit flags for components present in a format.

See also:
  Component types

Enumerator:

  compR | 'r' component
  compG | 'g' component
  compB | 'b' component
  compA | 'a' component
  compX | 'x' component
  compL | 'l' component
  compD | 'd' component
  compS | 's' component
  compRGB | 'r', 'g' and 'b' components
  compRGBA | 'r', 'g', 'b' and 'a' components
  compLumA | 'l' and 'a' components
  compDepthStencil | 'd' and 's' components
  compUnknown | One or more components are unknown.

Definition at line 325 of file textureformatstrings.h.

enum csRenderBufferComponentType

Type of components.

Enumerator:

  CS_BUFCOMP_BYTE | Signed byte.
  CS_BUFCOMP_UNSIGNED_BYTE | Unsigned byte.
  CS_BUFCOMP_SHORT | Signed short.
  CS_BUFCOMP_UNSIGNED_SHORT | Unsigned short.
  CS_BUFCOMP_INT | Signed integer.
  CS_BUFCOMP_UNSIGNED_INT | Unsigned integer.
  CS_BUFCOMP_FLOAT | Float (aka "single precision floating point number")
  CS_BUFCOMP_DOUBLE | Double (aka "double precision floating point number")
  CS_BUFCOMP_HALF | Half float (aka "half precision floating point number")
  CS_BUFCOMP_NORMALIZED | Normalization flag.
  CS_BUFCOMP_BYTE_NORM | Signed byte, normalized to [-1;1].
  CS_BUFCOMP_UNSIGNED_BYTE_NORM | Unsigned byte, normalized to [0;1].
  CS_BUFCOMP_SHORT_NORM | Signed short, normalized to [-1;1].
  CS_BUFCOMP_UNSIGNED_SHORT_NORM | Unsigned short, normalized to [0;1].
  CS_BUFCOMP_INT_NORM | Signed integer, normalized to [-1;1].
  CS_BUFCOMP_UNSIGNED_INT_NORM | Unsigned integer, normalized to [0;1].

Definition at line 61 of file rndbuf.h.

enum csRenderBufferLockType

Type of lock of a render buffer.

Enumerator:

  CS_BUF_LOCK_READ | Lock used for reading only from the buffer.
  CS_BUF_LOCK_NORMAL | Get a (writeable) pointer to the buffer.

Definition at line 108 of file rndbuf.h.

enum csRenderBufferName

Defines the names of the renderbuffers as provided by the meshes.

Remarks:
  These constants are used to generate a mask (see csRenderBufferNameMask), hence their number should be kept below 32.

Enumerator:

  CS_BUFFER_INDEX | Index buffer.
  CS_BUFFER_POSITION | Vertex positions.
  CS_BUFFER_NORMAL | Normals.
  CS_BUFFER_COLOR | Primary color multiplied with lighting.
  CS_BUFFER_COLOR_UNLIT | Primary color.
  CS_BUFFER_TEXCOORD0 | Texture coordinate 0.
  CS_BUFFER_TEXCOORD1 | Texture coordinate 1.
  CS_BUFFER_TEXCOORD2 | Texture coordinate 2.
  CS_BUFFER_TEXCOORD3 | Texture coordinate 3.
  CS_BUFFER_TEXCOORD_LIGHTMAP | Texture coordinates for lightmap.
  CS_BUFFER_GENERIC0 | Generic buffer 0, can be used for example for matrix-palette skinning etc.
  CS_BUFFER_GENERIC1 | Generic buffer 1, can be used for example for matrix-palette skinning etc.
  CS_BUFFER_GENERIC2 | Generic buffer 2, can be used for example for matrix-palette skinning etc.
  CS_BUFFER_GENERIC3 | Generic buffer 3, can be used for example for matrix-palette skinning etc.
  CS_BUFFER_TANGENT | Tangents.
  CS_BUFFER_BINORMAL | Binormals.
  CS_BUFFER_COUNT | Not really a renderbuffer. Use to determine the number of available default buffer names.

Definition at line 266 of file rndbuf.h.

enum csRenderBufferNameMask

Masks for renderbuffer accessors.

Enumerator:

  CS_BUFFER_INDEX_MASK | Index buffer.
  CS_BUFFER_POSITION_MASK | Vertex positions.
  CS_BUFFER_NORMAL_MASK | Normals.
  CS_BUFFER_COLOR_MASK | Primary color.
  CS_BUFFER_COLOR_LIGHTING_MASK | Primary color multiplied with lighting.
  CS_BUFFER_TEXCOORD0_MASK | Texture coordinate 0.
  CS_BUFFER_TEXCOORD1_MASK | Texture coordinate 1.
  CS_BUFFER_TEXCOORD2_MASK | Texture coordinate 2.
  CS_BUFFER_TEXCOORD3_MASK | Texture coordinate 3.
  CS_BUFFER_TEXCOORD_LIGHTMAP_MASK | Texture coordinates for lightmap.
  CS_BUFFER_GENERIC0_MASK | Generic buffer 0, can be used for example for matrix-palette skinning etc.
  CS_BUFFER_GENERIC1_MASK | Generic buffer 1, can be used for example for matrix-palette skinning etc.
  CS_BUFFER_GENERIC2_MASK | Generic buffer 2, can be used for example for matrix-palette skinning etc.
  CS_BUFFER_GENERIC3_MASK | Generic buffer 3, can be used for example for matrix-palette skinning etc.
  CS_BUFFER_TANGENT_MASK | Tangents.
  CS_BUFFER_BINORMAL_MASK | Binormals.
  CS_BUFFER_ALL_MASK | All buffers.

Definition at line 312 of file rndbuf.h.

enum csRenderBufferType

Buffer usage type.

Drivers may do some optimizations based on this value. Use a type that most closely matches the intended use.

Enumerator:

  CS_BUF_DYNAMIC | Data that changes every couple of frames and is drawn repeatedly.
  CS_BUF_STATIC | Data that is seldom modified and often drawn.
  CS_BUF_STREAM | Data that changes every time it is drawn.

Definition at line 48 of file rndbuf.h.

enum csVertexAttrib

Vertex attributes.

Enumerator:

  CS_VATTRIB_UNUSED | An attribute is valid, but unused by a shader program and can be discarded.
  CS_VATTRIB_INVALID | Invalid attribute.
  CS_VATTRIB_POSITION | Position vertex attribute.
  CS_VATTRIB_WEIGHT | Vertex weight attribute.
  CS_VATTRIB_NORMAL | Normal attribute.
  CS_VATTRIB_COLOR | Primary color attribute.
  CS_VATTRIB_PRIMARY_COLOR | Primary color attribute.
  CS_VATTRIB_SECONDARY_COLOR | Secondary color attribute.
  CS_VATTRIB_FOGCOORD | Fog coordinate attribute.
  CS_VATTRIB_TEXCOORD | TU 0 texture coordinates.
  CS_VATTRIB_TEXCOORD0 | TU 0 texture coordinates.
  CS_VATTRIB_TEXCOORD1 | TU 1 texture coordinates.
  CS_VATTRIB_TEXCOORD2 | TU 2 texture coordinates.
  CS_VATTRIB_TEXCOORD3 | TU 3 texture coordinates.
  CS_VATTRIB_TEXCOORD4 | TU 4 texture coordinates.
  CS_VATTRIB_TEXCOORD5 | TU 5 texture coordinates.
  CS_VATTRIB_TEXCOORD6 | TU 6 texture coordinates.
  CS_VATTRIB_TEXCOORD7 | TU 7 texture coordinates.
  CS_VATTRIB_0 | General vertex attribute.
  CS_VATTRIB_1 | General vertex attribute.
  CS_VATTRIB_2 | General vertex attribute.
  CS_VATTRIB_3 | General vertex attribute.
  CS_VATTRIB_4 | General vertex attribute.
  CS_VATTRIB_5 | General vertex attribute.
  CS_VATTRIB_6 | General vertex attribute.
  CS_VATTRIB_7 | General vertex attribute.
  CS_VATTRIB_8 | General vertex attribute.
  CS_VATTRIB_9 | General vertex attribute.
  CS_VATTRIB_10 | General vertex attribute.
  CS_VATTRIB_11 | General vertex attribute.
  CS_VATTRIB_12 | General vertex attribute.
  CS_VATTRIB_13 | General vertex attribute.
  CS_VATTRIB_14 | General vertex attribute.
  CS_VATTRIB_15 | General vertex attribute.
  CS_IATTRIB_OBJECT2WORLD | Pseudo-instancing attribute: object-to-world matrix.

Definition at line 177 of file graph3d.h.

enum csZBufMode

Z-buffer modes.

Enumerator:

  CS_ZBUF_NONE | Don't test or write.
  CS_ZBUF_FILL | Write unconditionally.
  CS_ZBUF_TEST | Test only.
  CS_ZBUF_USE | Test, write if successful.
  CS_ZBUF_EQUAL | Test if equal.
  CS_ZBUF_INVERT | Inverted test.
  CS_ZBUF_MESH | Use the z mode of the render mesh (NOTE: NOT VALID AS MESH ZMODE)
  CS_ZBUF_MESH2 | Use a "pass 2" z mode depending on the render mesh zmode. The mesh zmode is used a to choose a zmode that makes sure only pixels that are changed by the mesh zmode can be touched, e.g. if the mesh has a zmode of "zuse", zmesh2 will resolve to "ztest". This is useful for multi- pass stuff. (NOTE: NOT VALID AS MESH ZMODE)

Definition at line 125 of file graph3d.h.

enum CS::StructuredTextureFormat::TextureFormat

Texture storage format.

Enumerator:

  Invalid | Invalid format.
  Integer | Components are stored as integer tuples.
  Float | Components are stored as float tuples.
  Special | "Special" format (e.g. compressed formats)

Definition at line 130 of file textureformatstrings.h.

## Function Documentation

bool CS::StructuredTextureFormat::AddComponent | ( | char | cmp,
|  | int | size
| ) |  |

Add a new component to the texture format.

Parameters:

  cmp | One of the 'Component types' listed in Component types.
  size | Size of that component. Can be 0, but then it will have to be set later using FixSizes().

Remarks:
  No effect for special formats.

Returns:
  Whether the component could be added or not.

static csString CS::TextureFormatStrings::ConvertCanonical | ( | const char * | in | ) | `[static]`

Convert a texture format to a canonical form.

See also:
  Texture format strings, Canonical Format

static StructuredTextureFormat CS::TextureFormatStrings::ConvertStructured | ( | const char * | in | ) | `[static]`

Convert a (canonical or not) texture format to a structured form.

See also:
  Texture format strings

void CS::StructuredTextureFormat::FixSizes | ( | int | size | ) |

Fix the unset sizes (i.e.

0 sizes) so that they are filled with the given size.

csString CS::StructuredTextureFormat::GetCanonical | ( |  | ) |

Convert this structured format to canonical format.

See also:
  Canonical Format

char CS::StructuredTextureFormat::GetComponent | ( | int | n | ) | const`[inline]`

Get the nth component.

Returns 0 if there is no such component.

Definition at line 282 of file textureformatstrings.h.

int CS::StructuredTextureFormat::GetComponentCount | ( |  | ) | const`[inline]`

Returns the number of components in this format.

Returns 0 for special or invalid formats.

Definition at line 264 of file textureformatstrings.h.

uint CS::StructuredTextureFormat::GetComponentMask | ( |  | ) | const

Return a bit mask that identifies the contained components, regardless of their order.

This can be used to "classify" a texture format. The bit flags are compR, compG etc.

Example: Testing whether a format is an RGB format:

     const char* formatString = "rgb8";
     CS::StructuredTextureFormat format =
       CS::TextureFormatStrings::ConvertStructured (formatString);
     // Succeeds
     if (format.GetComponentMask() == CS::StructuredTextureFormat::compRGB)
     { ... }
     // Would also succeed for formatString = "bgr8" or even wierd formats like
     // "gbr4" and more, but not if an additional component such as alpha is
     // present.

char CS::StructuredTextureFormat::GetComponentSize | ( | int | n | ) | const`[inline]`

Get size of the nth component.

Remarks:
  If there is no such component 0 is returned. However, this return value does not imply that a component doesn not exist, as 0-sized components can be added by AddComponent(). Only the return values of GetComponent() and GetComponentCount() can be used for existance checkes.

Definition at line 297 of file textureformatstrings.h.

TextureFormat CS::StructuredTextureFormat::GetFormat | ( |  | ) | const`[inline]`

Returns the basic storage type for this texture format.

See also:
  Format

Definition at line 308 of file textureformatstrings.h.

const char* CS::StructuredTextureFormat::GetSpecial | ( |  | ) | const`[inline]`

Return the special format string.

Definition at line 312 of file textureformatstrings.h.

bool CS::StructuredTextureFormat::IsValid | ( |  | ) | `[inline]`

Returns whether the contained format is a valid texture format.

Definition at line 258 of file textureformatstrings.h.

void CS::StructuredTextureFormat::SetFormat | ( | TextureFormat | format | ) | `[inline]`

Set the format.

Remarks:
  You can't use this method to set 'Special' formats. Use SetSpecial() instead.

Definition at line 200 of file textureformatstrings.h.

void CS::StructuredTextureFormat::SetSpecial | ( | const char * | special | ) |

A special format (like '*dxt1').

CS::StructuredTextureFormat::StructuredTextureFormat | ( |  | ) |

Construct an invalid texture format.

CS::StructuredTextureFormat::StructuredTextureFormat | ( | char | cmp1,
|  | int | size1,
|  | char | cmp2 = `0`,
|  | int | size2 = `0`,
|  | char | cmp3 = `0`,
|  | int | size3 = `0`,
|  | char | cmp4 = `0`,
|  | int | size4 = `0`,
|  | TextureFormat | fmt = `Integer`
| ) |  |

Construct a texture format with the given components and sizes.

CS::StructuredTextureFormat::StructuredTextureFormat | ( | const StructuredTextureFormat & | other | ) |

Copy constructor.

CS::StructuredTextureFormat::~StructuredTextureFormat | ( |  | ) |

Destruct texture format.

## Variable Documentation

const size_t csRenderBufferComponentSizes[CS_BUFCOMP_BASE_TYPECOUNT]`[static]`

Initial value:

    {
      sizeof (char), sizeof (unsigned char),
      sizeof (short), sizeof (unsigned short),
      sizeof (int), sizeof (unsigned int),
      sizeof (float),
      sizeof (double),
      sizeof (uint16)
    }

Sizes of individual buffer components in bytes.

Definition at line 138 of file rndbuf.h.