this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Moved matrix functions into SDL_gpu.h.

+90 -46
+1 -3
SDL_gpu/CMakeLists.txt
··· 3 3 SDL_gpu.c 4 4 SDL_gpuShapes.c 5 5 SDL_gpu_Renderer.c 6 - GL_common/SDL_gpu_GL_matrix.c 6 + SDL_gpu_matrix.c 7 7 OpenGL_1_BASE/SDL_gpu_OpenGL_1_BASE.c 8 8 OpenGL_1/SDL_gpu_OpenGL_1.c 9 9 OpenGL_2/SDL_gpu_OpenGL_2.c ··· 16 16 ${SDL_gpu_HDRS} 17 17 SDL_gpu.h 18 18 SDL_gpu_RendererImpl.h 19 - GL_common/SDL_gpu_GL_matrix.h 20 19 GL_common/SDL_gpu_GL_common.inl 21 20 GL_common/SDL_gpuShapes_GL_common.inl 22 21 OpenGL_1_BASE/SDL_gpu_OpenGL_1_BASE.h ··· 46 45 47 46 set(SDL_gpu_install_HDRS 48 47 SDL_gpu.h 49 - GL_common/SDL_gpu_GL_matrix.h 50 48 OpenGL_1_BASE/SDL_gpu_OpenGL_1_BASE.h 51 49 OpenGL_1/SDL_gpu_OpenGL_1.h 52 50 OpenGL_2/SDL_gpu_OpenGL_2.h
-1
SDL_gpu/GL_common/SDL_gpu_GL_common.inl
··· 41 41 #endif 42 42 43 43 44 - #include "SDL_gpu_GL_matrix.h" 45 44 #include "SDL_platform.h" 46 45 47 46 #include "stb_image.h"
-1
SDL_gpu/GL_common/SDL_gpu_GL_matrix.c SDL_gpu/SDL_gpu_matrix.c
··· 1 1 #include "SDL_gpu.h" 2 - #include "SDL_gpu_GL_matrix.h" 3 2 #include <math.h> 4 3 #include <string.h> 5 4
-39
SDL_gpu/GL_common/SDL_gpu_GL_matrix.h
··· 1 - #ifndef _SDL_GPU_GL_MATRIX_H__ 2 - #define _SDL_GPU_GL_MATRIX_H__ 3 - 4 - #ifdef __cplusplus 5 - extern "C" { 6 - #endif 7 - 8 - // Basic matrix operations 9 - void GPU_MatrixCopy(float* result, const float* A); 10 - void GPU_MatrixIdentity(float* result); 11 - void GPU_Multiply4x4(float* result, float* A, float* B); 12 - void GPU_MultiplyAndAssign(float* result, float* A); 13 - 14 - 15 - // State-specific operations 16 - #define GPU_MODELVIEW 0 17 - #define GPU_PROJECTION 1 18 - 19 - const char* GPU_GetMatrixString(float* A); 20 - void GPU_MatrixMode(int matrix_mode); 21 - float* GPU_GetCurrentMatrix(void); 22 - float* GPU_GetModelView(void); 23 - float* GPU_GetProjection(void); 24 - void GPU_GetModelViewProjection(float* result); 25 - void GPU_PushMatrix(void); 26 - void GPU_PopMatrix(void); 27 - void GPU_LoadIdentity(void); 28 - void GPU_Ortho(float left, float right, float bottom, float top, float near, float far); 29 - void GPU_Frustum(float right, float left, float bottom, float top, float near, float far); 30 - void GPU_Translate(float x, float y, float z); 31 - void GPU_Scale(float sx, float sy, float sz); 32 - void GPU_Rotate(float degrees, float x, float y, float z); 33 - void GPU_MultMatrix(float* matrix4x4); 34 - 35 - #ifdef __cplusplus 36 - } 37 - #endif 38 - 39 - #endif
+89 -2
SDL_gpu/SDL_gpu.h
··· 33 33 * \defgroup SurfaceControls Surface Controls 34 34 * \defgroup ImageControls Image Controls 35 35 * \defgroup Conversions Surface, Image, and Target Conversions 36 + * \defgroup Matrix Matrix Controls 36 37 * \defgroup Rendering Rendering 37 38 * \defgroup Shapes Shapes 38 39 * \defgroup ShaderInterface Shader Interface ··· 258 259 259 260 260 261 262 + 263 + #define GPU_MODELVIEW 0 264 + #define GPU_PROJECTION 1 265 + 261 266 #ifndef GPU_MATRIX_STACK_MAX 262 267 #define GPU_MATRIX_STACK_MAX 5 263 268 #endif 264 269 265 - /*! \ingroup Rendering 266 - * Matrix stack data structure for replacing the old OpenGL matrix stack. */ 270 + /*! \ingroup Matrix 271 + * Matrix stack data structure for global vertex transforms. */ 267 272 typedef struct GPU_MatrixStack 268 273 { 269 274 unsigned int size; ··· 984 989 985 990 // End of Conversions 986 991 /*! @} */ 992 + 993 + 994 + 995 + 996 + 997 + /*! \ingroup Matrix 998 + * @{ */ 999 + 1000 + 1001 + // Basic matrix operations (4x4) 1002 + 1003 + /*! Copy matrix A to the given 'result' matrix. */ 1004 + void GPU_MatrixCopy(float* result, const float* A); 1005 + 1006 + /*! Fills 'result' matrix with the identity matrix. */ 1007 + void GPU_MatrixIdentity(float* result); 1008 + 1009 + /*! 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'. 1010 + * \see GPU_MultiplyAndAssign 1011 + */ 1012 + void GPU_Multiply4x4(float* result, float* A, float* B); 1013 + 1014 + /*! Multiplies matrices 'result' and A and stores the result in the given 'result' matrix (result = result * A). */ 1015 + void GPU_MultiplyAndAssign(float* result, float* A); 1016 + 1017 + 1018 + // Matrix stack accessors 1019 + 1020 + /*! Returns an internal string that represents the contents of matrix A. */ 1021 + const char* GPU_GetMatrixString(float* A); 1022 + 1023 + /*! Returns the current matrix from the top of the matrix stack. Returns NULL if stack is empty. */ 1024 + float* GPU_GetCurrentMatrix(void); 1025 + 1026 + /*! Returns the current modelview matrix from the top of the matrix stack. Returns NULL if stack is empty. */ 1027 + float* GPU_GetModelView(void); 1028 + 1029 + /*! Returns the current projection matrix from the top of the matrix stack. Returns NULL if stack is empty. */ 1030 + float* GPU_GetProjection(void); 1031 + 1032 + /*! Copies the current modelview-projection matrix into the given 'result' matrix (result = P*M). */ 1033 + void GPU_GetModelViewProjection(float* result); 1034 + 1035 + 1036 + // Matrix stack manipulators 1037 + 1038 + /*! Changes matrix mode to either GPU_PROJECTION or GPU_MODELVIEW. Further matrix stack operations manipulate that particular stack. */ 1039 + void GPU_MatrixMode(int matrix_mode); 1040 + 1041 + /*! Pushes the current matrix as a new matrix stack item. */ 1042 + void GPU_PushMatrix(void); 1043 + 1044 + /*! Removes the current matrix from the stack. */ 1045 + void GPU_PopMatrix(void); 1046 + 1047 + /*! Fills current matrix with the identity matrix. */ 1048 + void GPU_LoadIdentity(void); 1049 + 1050 + /*! Multiplies an orthographic projection matrix into the current matrix. */ 1051 + void GPU_Ortho(float left, float right, float bottom, float top, float near, float far); 1052 + 1053 + /*! Multiplies a perspective projection matrix into the current matrix. */ 1054 + void GPU_Frustum(float right, float left, float bottom, float top, float near, float far); 1055 + 1056 + /*! Adds a translation into the current matrix. */ 1057 + void GPU_Translate(float x, float y, float z); 1058 + 1059 + /*! Multiplies a scaling matrix into the current matrix. */ 1060 + void GPU_Scale(float sx, float sy, float sz); 1061 + 1062 + /*! Multiplies a rotation matrix into the current matrix. */ 1063 + void GPU_Rotate(float degrees, float x, float y, float z); 1064 + 1065 + /*! Multiplies a given matrix into the current matrix. */ 1066 + void GPU_MultMatrix(float* matrix4x4); 1067 + 1068 + // End of Matrix 1069 + /*! @} */ 1070 + 1071 + 1072 + 1073 + 987 1074 988 1075 989 1076 /*! \ingroup Rendering