Skip to content

Commit 65404ae

Browse files
committed
docs: inital effect documentation
1 parent 4327f78 commit 65404ae

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

include/c3d/effect.h

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,83 @@
1+
/**
2+
* @file effect.h
3+
* @brief Configure GPU state
4+
*/
15
#pragma once
26
#include "types.h"
37

8+
/**
9+
* @brief Specify mapping of depth values from normalized device coordinates to window coordinates.
10+
* @param[in] bIsZBuffer Enables or disables depth range. The initial value is true.
11+
* @param[in] zScale Specifies mapping of depth values from normalized device coordinates to window coordinates (nearVal - farVal). The initial value is -1.0f.
12+
* @param[in] zOffset Sets the scale and units used to calculate depth values (nearVal + polygonOffset). The initial value is 0.0f.
13+
*/
414
void C3D_DepthMap(bool bIsZBuffer, float zScale, float zOffset);
15+
16+
/**
17+
* @brief Specify whether front-facing or back-facing facets can be culled.
18+
* @param[in] mode Specifies whether front-facing or back-facing facets are candidates for culling. The inital value is GPU_CULL_BACK_CCW.
19+
*/
520
void C3D_CullFace(GPU_CULLMODE mode);
21+
22+
/**
23+
* @brief Set front and back function and reference value for stencil testing
24+
* @param[in] enable Enables or disables stencil test. The initial value is false.
25+
* @param[in] function Specifies the test function. The initial value is GPU_ALWAYS.
26+
* @param[in] ref Specifies the reference value for the stencil test. ref is clamped to the range 02^n - 1 , where n is the number of bitplanes in the stencil buffer. The initial value is 0.
27+
* @param[in] inputMask Specifies a mask that is ANDed with both the reference value and the stored stencil value when the test is done. The initial value is all 1's.
28+
* @param[in] writeMask Specifies a bit mask to enable and disable writing of individual bits in the stencil planes. Initially, the mask is all 0's.
29+
*/
630
void C3D_StencilTest(bool enable, GPU_TESTFUNC function, int ref, int inputMask, int writeMask);
31+
32+
/**
33+
* @brief Set front and back stencil test actions
34+
* @param[in] sfail Specifies the action to take when the stencil test fails. The initial value is GPU_STENCIL_KEEP.
35+
* @param[in] dfail Specifies the stencil action when the stencil test passes, but the depth test fails. The initial value is GPU_STENCIL_KEEP.
36+
* @param[in] pass Specifies the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled. The initial value is GPU_STENCIL_KEEP.
37+
*/
738
void C3D_StencilOp(GPU_STENCILOP sfail, GPU_STENCILOP dfail, GPU_STENCILOP pass);
39+
40+
/**
41+
* @brief Set the blend color
42+
* @param[in] color Specifies the RGBA blend color. The initial value is 0.
43+
*/
844
void C3D_BlendingColor(u32 color);
45+
46+
//TODO:Docs
947
void C3D_EarlyDepthTest(bool enable, GPU_EARLYDEPTHFUNC function, u32 ref);
48+
49+
/**
50+
* @brief Configure depth testing
51+
* @param[in] enable Enables or disables depth test. The initial value is true.
52+
* @param[in] function Specifies the depth comparison function. The initial value is GPU_GREATER.
53+
* @param[in] writemask Configures depth buffer writing mode (0 disables depth buffer writing). The initial value is GPU_WRITE_ALL.
54+
*/
1055
void C3D_DepthTest(bool enable, GPU_TESTFUNC function, GPU_WRITEMASK writemask);
56+
57+
/**
58+
* @brief Configure Alpha testing
59+
* @param[in] enable Enables or disables alpha test. The initial value is false.
60+
* @param[in] function Specifies the alpha comparison function. The initial value is GPU_ALWAYS.
61+
* @param[in] ref Specifies the reference value that incoming alpha values are compared to (0 disables depth buffer writing). The intial value is 0.
62+
*/
1163
void C3D_AlphaTest(bool enable, GPU_TESTFUNC function, int ref);
64+
65+
/**
66+
* @brief Configure blend functions
67+
* @param[in] colorEq Specifies how source and destination colors are combined. The initial value is GPU_BLEND_ADD.
68+
* @param[in] alphaEq Specifies how source and destination alphas are combined. The initial value is GPU_BLEND_ADD.
69+
* @param[in] srcClr Specifies how the red, green, and blue source blending factors are computed. The initial value is GPU_SRC_ALPHA.
70+
* @param[in] dstClr Specifies how the red, green, and blue destination blending factors are computed. The initial value is GPU_ONE_MINUS_SRC_ALPHA.
71+
* @param[in] srcAlpha Specifies how the alpha source blending factors are computed. The initial value is GPU_SRC_ALPHA.
72+
* @param[in] dstAlpha Specifies how the alpha destination blending factors are computed. The initial value is GPU_ONE_MINUS_SRC_ALPHA.
73+
*/
1274
void C3D_AlphaBlend(GPU_BLENDEQUATION colorEq, GPU_BLENDEQUATION alphaEq, GPU_BLENDFACTOR srcClr, GPU_BLENDFACTOR dstClr, GPU_BLENDFACTOR srcAlpha, GPU_BLENDFACTOR dstAlpha);
75+
76+
//TODO:Docs
1377
void C3D_ColorLogicOp(GPU_LOGICOP op);
78+
79+
//TODO:Docs
1480
void C3D_FragOpMode(GPU_FRAGOPMODE mode);
81+
82+
//TODO:Docs
1583
void C3D_FragOpShadow(float scale, float bias);

0 commit comments

Comments
 (0)