citro3d
Data Structures | Macros | Enumerations | Functions
texenv.h File Reference

Configure texture combiner stages (TexEnv) More...

#include "types.h"

Go to the source code of this file.

Data Structures

struct  C3D_TexEnv
 TexEnv stage configuration. More...
 

Macros

#define _C3D_DEFAULT(x)
 

Enumerations

enum  C3D_TexEnvMode {
  C3D_RGB = BIT(0) ,
  C3D_Alpha = BIT(1) ,
  C3D_Both = C3D_RGB | C3D_Alpha
}
 TexEnv operation mode. More...
 

Functions

C3D_TexEnvC3D_GetTexEnv (int id)
 Gets the global TexEnv for a given stage. More...
 
void C3D_SetTexEnv (int id, C3D_TexEnv *env)
 Sets the global TexEnv for a given stage. More...
 
void C3D_DirtyTexEnv (C3D_TexEnv *env)
 Marks a TexEnv as needing to be updated. More...
 
void C3D_TexEnvBufUpdate (int mode, int mask)
 Configures the stages where the GPU_PREVIOUS_BUFFER source value should be updated with the output of that stage. More...
 
void C3D_TexEnvBufColor (u32 color)
 Configure the initial value of GPU_PREVIOUS_BUFFER. This value will be kept until it is updated; see C3D_TexEnvBufUpdate(). More...
 
static void C3D_TexEnvInit (C3D_TexEnv *env)
 Resets a TexEnv to its default values. More...
 
static void C3D_TexEnvSrc (C3D_TexEnv *env, C3D_TexEnvMode mode, GPU_TEVSRC s1, GPU_TEVSRC s2, GPU_TEVSRC s3)
 Sets the input source of a TexEnv. More...
 
static void C3D_TexEnvOpRgb (C3D_TexEnv *env, GPU_TEVOP_RGB o1, GPU_TEVOP_RGB o2, GPU_TEVOP_RGB o3)
 Configures the operation to be applied to the input color of a TexEnv before the function is applied. More...
 
static void C3D_TexEnvOpAlpha (C3D_TexEnv *env, GPU_TEVOP_A o1, GPU_TEVOP_A o2, GPU_TEVOP_A o3)
 Configures the operation to be applied to the input alpha of a TexEnv before the function is applied. More...
 
static void C3D_TexEnvFunc (C3D_TexEnv *env, C3D_TexEnvMode mode, GPU_COMBINEFUNC param)
 Sets the combiner function to perform in this TexEnv. More...
 
static void C3D_TexEnvColor (C3D_TexEnv *env, u32 color)
 Sets the value of the GPU_CONSTANT source for a TexEnv stage. More...
 
static void C3D_TexEnvScale (C3D_TexEnv *env, int mode, GPU_TEVSCALE param)
 Configures the scaling to be applied to the output of a TexEnv. More...
 

Detailed Description

Configure texture combiner stages (TexEnv)

See also
https://www.khronos.org/opengl/wiki/Texture_Combiners
https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glTexEnv.xml

Enumeration Type Documentation

◆ C3D_TexEnvMode

TexEnv operation mode.

Enumerator
C3D_RGB 

RGB mode.

C3D_Alpha 

Alpha mode.

C3D_Both 

Both.

Function Documentation

◆ C3D_DirtyTexEnv()

void C3D_DirtyTexEnv ( C3D_TexEnv env)

Marks a TexEnv as needing to be updated.

Note
One must use this if they are continuing to use a TexEnv pointer they got from C3D_GetTexEnv() after performing an action that flushes state.
Parameters
[in]envPointer to a TexEnv struct.

◆ C3D_GetTexEnv()

C3D_TexEnv* C3D_GetTexEnv ( int  id)

Gets the global TexEnv for a given stage.

Parameters
[in]idTexEnv stage between 0-5 to return.
Returns
TexEnv of the given stage.

◆ C3D_SetTexEnv()

void C3D_SetTexEnv ( int  id,
C3D_TexEnv env 
)

Sets the global TexEnv for a given stage.

Parameters
[in]idTexEnv stage between 0-5 to set.
[in]envPointer to user TexEnv.

◆ C3D_TexEnvBufColor()

void C3D_TexEnvBufColor ( u32  color)

Configure the initial value of GPU_PREVIOUS_BUFFER. This value will be kept until it is updated; see C3D_TexEnvBufUpdate().

Parameters
[in]colorColor value.

◆ C3D_TexEnvBufUpdate()

void C3D_TexEnvBufUpdate ( int  mode,
int  mask 
)

Configures the stages where the GPU_PREVIOUS_BUFFER source value should be updated with the output of that stage.

Parameters
[in]modeTexEnv update modes (see C3D_TexEnvMode)
[in]maskBitmask containing which stages update GPU_PREVIOUS_BUFFER (bitmask can be created using GPU_TEV_BUFFER_WRITE_CONFIG())

◆ C3D_TexEnvColor()

static void C3D_TexEnvColor ( C3D_TexEnv env,
u32  color 
)
inlinestatic

Sets the value of the GPU_CONSTANT source for a TexEnv stage.

Parameters
[out]envPointer to TexEnv struct.
[in]colorRGBA color value to apply.

◆ C3D_TexEnvFunc()

static void C3D_TexEnvFunc ( C3D_TexEnv env,
C3D_TexEnvMode  mode,
GPU_COMBINEFUNC  param 
)
inlinestatic

Sets the combiner function to perform in this TexEnv.

Parameters
[out]envPointer to TexEnv struct.
[in]modeTexEnv update modes (see C3D_TexEnvMode)
[in]paramFunction to use.

◆ C3D_TexEnvInit()

static void C3D_TexEnvInit ( C3D_TexEnv env)
inlinestatic

Resets a TexEnv to its default values.

Parameters
[out]envTexEnv to initialize.

◆ C3D_TexEnvOpAlpha()

static void C3D_TexEnvOpAlpha ( C3D_TexEnv env,
GPU_TEVOP_A  o1,
GPU_TEVOP_A  o2,
GPU_TEVOP_A  o3 
)
inlinestatic

Configures the operation to be applied to the input alpha of a TexEnv before the function is applied.

Parameters
[out]envPointer to TexEnv struct.
[in]o1Operation to perform on the first source.
[in]o2Operation to perform on the second source.
[in]o3Operation to perform on the third source.

◆ C3D_TexEnvOpRgb()

static void C3D_TexEnvOpRgb ( C3D_TexEnv env,
GPU_TEVOP_RGB  o1,
GPU_TEVOP_RGB  o2,
GPU_TEVOP_RGB  o3 
)
inlinestatic

Configures the operation to be applied to the input color of a TexEnv before the function is applied.

Parameters
[out]envPointer to TexEnv struct.
[in]o1Operation to perform on the first source.
[in]o2Operation to perform on the second source.
[in]o3Operation to perform on the third source.

◆ C3D_TexEnvScale()

static void C3D_TexEnvScale ( C3D_TexEnv env,
int  mode,
GPU_TEVSCALE  param 
)
inlinestatic

Configures the scaling to be applied to the output of a TexEnv.

Parameters
[out]envPointer to TexEnv struct.
[in]modeTexEnv update modes (see C3D_TexEnvMode)
[in]paramScale factor to apply.

◆ C3D_TexEnvSrc()

static void C3D_TexEnvSrc ( C3D_TexEnv env,
C3D_TexEnvMode  mode,
GPU_TEVSRC  s1,
GPU_TEVSRC  s2,
GPU_TEVSRC  s3 
)
inlinestatic

Sets the input source of a TexEnv.

Parameters
[out]envPointer to TexEnv struct.
[in]modeTexEnv update modes (see C3D_TexEnvMode)
[in]s1First source.
[in]s2Second source.
[in]s3Third source.