1 /* originally from from https://github.com/smealum/ctrulib */
2 
3 /**
4  * @file gpu-old.h
5  * @brief Deprecated GPU functions which should not be used in new code.
6  * @description These functions have been superseeded by direct GPU register writes, or external GPU libraries.
7  * @deprecated
8  */
9 #pragma once
10 
11 #include <3ds/gpu/gpu.h>
12 
13 /**
14  * @brief Initializes the GPU.
15  * @param gsphandle GSP handle to use.
16  * @deprecated
17  */
18 void GPU_Init(Handle *gsphandle) DEPRECATED;
19 
20 /**
21  * @brief Resets the GPU.
22  * @param gxbuf GX command buffer to use.
23  * @param gpuBuf GPU command buffer to use.
24  * @param gpuBufSize GPU command buffer size.
25  * @deprecated
26  */
27 void GPU_Reset(u32* gxbuf, u32* gpuBuf, u32 gpuBufSize) DEPRECATED;
28 
29 /**
30  * @brief Sets a shader float uniform.
31  * @param type Type of shader to set the uniform of.
32  * @param startreg Start of the uniform register to set.
33  * @param data Data to set.
34  * @param numreg Number of registers to set.
35  * @deprecated
36  */
37 void GPU_SetFloatUniform(GPU_SHADER_TYPE type, u32 startreg, u32* data, u32 numreg) DEPRECATED;
38 
39 /**
40  * @brief Sets the viewport.
41  * @param depthBuffer Buffer to output depth data to.
42  * @param colorBuffer Buffer to output color data to.
43  * @param x X of the viewport.
44  * @param y Y of the viewport.
45  * @param w Width of the viewport.
46  * @param h Height of the viewport.
47  * @deprecated
48  */
49 void GPU_SetViewport(u32* depthBuffer, u32* colorBuffer, u32 x, u32 y, u32 w, u32 h) DEPRECATED;
50 
51 /**
52  * @brief Sets the current scissor test mode.
53  * @param mode Scissor test mode to use.
54  * @param x X of the scissor region.
55  * @param y Y of the scissor region.
56  * @param w Width of the scissor region.
57  * @param h Height of the scissor region.
58  * @deprecated
59  */
60 void GPU_SetScissorTest(GPU_SCISSORMODE mode, u32 left, u32 bottom, u32 right, u32 top) DEPRECATED;
61 
62 /**
63  * @brief Sets the depth map.
64  * @param zScale Z scale to use.
65  * @param zOffset Z offset to use.
66  * @deprecated
67  */
68 void GPU_DepthMap(float zScale, float zOffset) DEPRECATED;
69 
70 /**
71  * @brief Sets the alpha test parameters.
72  * @param enable Whether to enable alpha testing.
73  * @param function Test function to use.
74  * @param ref Reference value to use.
75  * @deprecated
76  */
77 void GPU_SetAlphaTest(bool enable, GPU_TESTFUNC function, u8 ref) DEPRECATED;
78 
79 /**
80  * @brief Sets the depth test parameters and pixel write mask.
81  * @note GPU_WRITEMASK values can be ORed together.
82  * @param enable Whether to enable depth testing.
83  * @param function Test function to use.
84  * @param writemask Pixel write mask to use.
85  * @deprecated
86  */
87 void GPU_SetDepthTestAndWriteMask(bool enable, GPU_TESTFUNC function, GPU_WRITEMASK writemask) DEPRECATED;
88 
89 /**
90  * @brief Sets the stencil test parameters.
91  * @param enable Whether to enable stencil testing.
92  * @param function Test function to use.
93  * @param ref Reference value to use.
94  * @param input_mask Input mask to use.
95  * @param write_mask Write mask to use.
96  * @deprecated
97  */
98 void GPU_SetStencilTest(bool enable, GPU_TESTFUNC function, u8 ref, u8 input_mask, u8 write_mask) DEPRECATED;
99 
100 /**
101  * @brief Sets the stencil test operators.
102  * @param sfail Operator to use on source test failure.
103  * @param dfail Operator to use on destination test failure.
104  * @param pass Operator to use on test passing.
105  * @deprecated
106  */
107 void GPU_SetStencilOp(GPU_STENCILOP sfail, GPU_STENCILOP dfail, GPU_STENCILOP pass) DEPRECATED;
108 
109 /**
110  * @brief Sets the face culling mode.
111  * @param mode Face culling mode to use.
112  * @deprecated
113  */
114 void GPU_SetFaceCulling(GPU_CULLMODE mode) DEPRECATED;
115 
116 /**
117  * @brief Sets the combiner buffer write parameters.
118  * @note Use GPU_TEV_BUFFER_WRITE_CONFIG to build the parameters.
119  * @note Only the first four TEV stages can write to the combiner buffer.
120  * @param rgb_config RGB configuration to use.
121  * @param alpha_config Alpha configuration to use.
122  * @deprecated
123  */
124 void GPU_SetCombinerBufferWrite(u8 rgb_config, u8 alpha_config) DEPRECATED;
125 
126 /**
127  * @brief Sets the alpha blending parameters.
128  * @note Cannot be used with GPU_SetColorLogicOp.
129  * @param colorEquation Blend equation to use for color components.
130  * @param alphaEquation Blend equation to use for the alpha component.
131  * @param colorSrc Source factor of color components.
132  * @param colorDst Destination factor of color components.
133  * @param alphaSrc Source factor of the alpha component.
134  * @param alphaDst Destination factor of the alpha component.
135  * @deprecated
136  */
137 void GPU_SetAlphaBlending(GPU_BLENDEQUATION colorEquation, GPU_BLENDEQUATION alphaEquation,
138 	GPU_BLENDFACTOR colorSrc, GPU_BLENDFACTOR colorDst,
139 	GPU_BLENDFACTOR alphaSrc, GPU_BLENDFACTOR alphaDst) DEPRECATED;
140 
141 /**
142  * @brief Sets the color logic operator.
143  * @note Cannot be used with GPU_SetAlphaBlending.
144  * @param op Operator to set.
145  * @deprecated
146  */
147 void GPU_SetColorLogicOp(GPU_LOGICOP op) DEPRECATED;
148 
149 /**
150  * @brief Sets the blending color.
151  * @param r Red component.
152  * @param g Green component.
153  * @param b Blue component.
154  * @param a Alpha component.
155  * @deprecated
156  */
157 void GPU_SetBlendingColor(u8 r, u8 g, u8 b, u8 a) DEPRECATED;
158 
159 /**
160  * @brief Sets the VBO attribute buffers.
161  * @param totalAttributes Total number of attributes.
162  * @param baseAddress Base address of the VBO.
163  * @param attributeFormats Attribute format data.
164  * @param attributeMask Attribute mask.
165  * @param attributePermutation Attribute permutations.
166  * @param numBuffers Number of buffers.
167  * @param bufferOffsets Offsets of the buffers.
168  * @param bufferPermutations Buffer permutations.
169  * @param bufferNumAttributes Numbers of attributes of the buffers.
170  * @deprecated
171  */
172 void GPU_SetAttributeBuffers(u8 totalAttributes, u32* baseAddress, u64 attributeFormats, u16 attributeMask, u64 attributePermutation, u8 numBuffers, u32 bufferOffsets[], u64 bufferPermutations[], u8 bufferNumAttributes[]) DEPRECATED;
173 
174 /**
175  * @brief Sets the enabled texture units.
176  * @param units Units to enable. OR texture unit values together to create this value.
177  * @deprecated
178  */
179 void GPU_SetTextureEnable(GPU_TEXUNIT units) DEPRECATED;
180 
181 /**
182  * @brief Sets the texture data of a texture unit.
183  * @param unit Texture unit to use.
184  * @param data Data to load. Must be in linear memory or VRAM.
185  * @param width Width of the texture.
186  * @param height Height of the texture.
187  * @param Parameters of the texture, such as filters and wrap modes.
188  * @param colorType Color type of the texture.
189  * @deprecated
190  */
191 void GPU_SetTexture(GPU_TEXUNIT unit, u32* data, u16 width, u16 height, u32 param, GPU_TEXCOLOR colorType) DEPRECATED;
192 
193 /**
194  * @brief Sets the border color of a texture unit.
195  * @param unit Texture unit to use.
196  * @param borderColor The color used for the border when using the @ref GPU_CLAMP_TO_BORDER wrap mode.
197  * @deprecated
198  */
199 void GPU_SetTextureBorderColor(GPU_TEXUNIT unit,u32 borderColor) DEPRECATED;
200 
201 /**
202  * @brief Sets the parameters of a texture combiner.
203  * @param id ID of the combiner.
204  * @param rgbSources RGB source configuration.
205  * @param alphaSources Alpha source configuration.
206  * @param rgbOperands RGB operand configuration.
207  * @param alphaOperands Alpha operand configuration.
208  * @param rgbCombine RGB combiner function.
209  * @param alphaCombine Alpha combiner function.
210  * @param constantColor Constant color to provide.
211  * @deprecated
212  */
213 void GPU_SetTexEnv(u8 id, u16 rgbSources, u16 alphaSources, u16 rgbOperands, u16 alphaOperands, GPU_COMBINEFUNC rgbCombine, GPU_COMBINEFUNC alphaCombine, u32 constantColor) DEPRECATED;
214 
215 /**
216  * @brief Draws an array of vertex data.
217  * @param primitive Primitive to draw.
218  * @param first First vertex to draw.
219  * @param count Number of vertices to draw.
220  * @deprecated
221  */
222 void GPU_DrawArray(GPU_Primitive_t primitive, u32 first, u32 count) DEPRECATED;
223 
224 /**
225  * @brief Draws vertex elements.
226  * @param primitive Primitive to draw.
227  * @param indexArray Array of vertex indices to use.
228  * @param n Number of vertices to draw.
229  * @deprecated
230  */
231 void GPU_DrawElements(GPU_Primitive_t primitive, u32* indexArray, u32 n) DEPRECATED;
232 
233 /**
234  * @brief Finishes drawing.
235  * @deprecated
236  */
237 void GPU_FinishDrawing() DEPRECATED;
238 
239 void GPU_Finalize(void) DEPRECATED;
240