Select the types of activity you want to include in your feed.
Made GPU_MatrixStack grow as needed. Fixed some const-correctness issues with matrix functions. Renamed GPU_Multiply4x4() to GPU_MatrixMultiply(). Added GPU_LoadMatrix() to set the current matrix from a given one.
···330330#define GPU_MODELVIEW 0
331331#define GPU_PROJECTION 1
332332333333-#ifndef GPU_MATRIX_STACK_MAX
334334-#define GPU_MATRIX_STACK_MAX 5
335335-#endif
336336-337333/*! \ingroup Matrix
338334 * Matrix stack data structure for global vertex transforms. */
339335typedef struct GPU_MatrixStack
340336{
337337+ unsigned int storage_size;
341338 unsigned int size;
342342- float matrix[GPU_MATRIX_STACK_MAX][16];
339339+ float** matrix;
343340} GPU_MatrixStack;
344341345342···12371234// Basic vector operations (3D)
1238123512391236/*! Returns the magnitude (length) of the given vector. */
12401240-DECLSPEC float SDLCALL GPU_VectorLength(float* vec3);
12371237+DECLSPEC float SDLCALL GPU_VectorLength(const float* vec3);
1241123812421239/*! Modifies the given vector so that it has a new length of 1. */
12431240DECLSPEC void SDLCALL GPU_VectorNormalize(float* vec3);
1244124112451242/*! Returns the dot product of two vectors. */
12461246-DECLSPEC float SDLCALL GPU_VectorDot(float* A, float* B);
12431243+DECLSPEC float SDLCALL GPU_VectorDot(const float* A, const float* B);
1247124412481245/*! Performs the cross product of vectors A and B (result = A x B). Do not use A or B as 'result'. */
12491249-DECLSPEC void SDLCALL GPU_VectorCross(float* result, float* A, float* B);
12461246+DECLSPEC void SDLCALL GPU_VectorCross(float* result, const float* A, const float* B);
1250124712511248/*! Overwrite 'result' vector with the values from vector A. */
12521252-DECLSPEC void SDLCALL GPU_VectorCopy(float* result, float* A);
12491249+DECLSPEC void SDLCALL GPU_VectorCopy(float* result, const float* A);
1253125012541251/*! Multiplies the given matrix into the given vector (vec3 = matrix*vec3). */
12551255-DECLSPEC void SDLCALL GPU_VectorApplyMatrix(float* vec3, float* matrix_4x4);
12521252+DECLSPEC void SDLCALL GPU_VectorApplyMatrix(float* vec3, const float* matrix_4x4);
125612531257125412581255···12881285/*! Multiplies matrices A and B and stores the result in the given 'result' matrix (result = A*B). Do not use A or B as 'result'.
12891286 * \see GPU_MultiplyAndAssign
12901287*/
12911291-DECLSPEC void SDLCALL GPU_Multiply4x4(float* result, float* A, float* B);
12881288+DECLSPEC void SDLCALL GPU_MatrixMultiply(float* result, const float* A, const float* B);
1292128912931290/*! Multiplies matrices 'result' and B and stores the result in the given 'result' matrix (result = result * B). */
12941294-DECLSPEC void SDLCALL GPU_MultiplyAndAssign(float* result, float* B);
12911291+DECLSPEC void SDLCALL GPU_MultiplyAndAssign(float* result, const float* B);
129512921296129312971294// Matrix stack accessors
1298129512991296/*! Returns an internal string that represents the contents of matrix A. */
13001300-DECLSPEC const char* SDLCALL GPU_GetMatrixString(float* A);
12971297+DECLSPEC const char* SDLCALL GPU_GetMatrixString(const float* A);
1301129813021299/*! Returns the current matrix from the top of the matrix stack. Returns NULL if stack is empty. */
13031300DECLSPEC float* SDLCALL GPU_GetCurrentMatrix(void);
···1314131113151312// Matrix stack manipulators
1316131313141314+/*! Allocate new matrices for the given stack. */
13151315+DECLSPEC void SDLCALL GPU_InitMatrixStack(GPU_MatrixStack* stack);
13161316+13171317/*! Changes matrix mode to either GPU_PROJECTION or GPU_MODELVIEW. Further matrix stack operations manipulate that particular stack. */
13181318DECLSPEC void SDLCALL GPU_MatrixMode(int matrix_mode);
13191319···1325132513261326/*! Fills current matrix with the identity matrix. */
13271327DECLSPEC void SDLCALL GPU_LoadIdentity(void);
13281328+13291329+/*! Copies a given matrix to be the current matrix. */
13301330+DECLSPEC void SDLCALL GPU_LoadMatrix(const float* matrix4x4);
1328133113291332/*! Multiplies an orthographic projection matrix into the current matrix. */
13301333DECLSPEC void SDLCALL GPU_Ortho(float left, float right, float bottom, float top, float near, float far);
···13421345DECLSPEC void SDLCALL GPU_Rotate(float degrees, float x, float y, float z);
1343134613441347/*! Multiplies a given matrix into the current matrix. */
13451345-DECLSPEC void SDLCALL GPU_MultMatrix(float* matrix4x4);
13481348+DECLSPEC void SDLCALL GPU_MultMatrix(const float* matrix4x4);
1346134913471350// End of Matrix
13481351/*! @} */