Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/GPU_matrix.h
| Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
| typedef enum { | typedef enum { | ||||
| MATRIX_MODE_INACTIVE, | MATRIX_MODE_INACTIVE, | ||||
| MATRIX_MODE_2D, | MATRIX_MODE_2D, | ||||
| MATRIX_MODE_3D | MATRIX_MODE_3D | ||||
| } MatrixMode; | } MatrixMode; | ||||
| MatrixMode gpuMatrixMode(void); | MatrixMode gpuMatrixMode(void); | ||||
| void gpuMatrixBegin2D(void); | |||||
| void gpuMatrixBegin3D(void); | |||||
| void gpuMatrixEnd(void); | |||||
| /* TODO: gpuMatrixResume2D & gpuMatrixResume3D to switch modes but not reset stack */ | |||||
| /* ModelView Matrix (2D or 3D) */ | /* ModelView Matrix (2D or 3D) */ | ||||
| void gpuPushMatrix(void); /* TODO: PushCopy vs PushIdentity? */ | void gpuPushMatrix(void); /* TODO: PushCopy vs PushIdentity? */ | ||||
| void gpuPopMatrix(void); | void gpuPopMatrix(void); | ||||
| void gpuLoadIdentity(void); | void gpuLoadIdentity(void); | ||||
| void gpuScaleUniform(float factor); | void gpuScaleUniform(float factor); | ||||
| Show All 14 Lines | |||||
| void gpuRotateAxis(float deg, char axis); /* TODO: enum for axis? */ | void gpuRotateAxis(float deg, char axis); /* TODO: enum for axis? */ | ||||
| void gpuLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ); | void gpuLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ); | ||||
| /* TODO: variant that takes eye[3], center[3], up[3] */ | /* TODO: variant that takes eye[3], center[3], up[3] */ | ||||
| /* 2D ModelView Matrix */ | /* 2D ModelView Matrix */ | ||||
| #if MATRIX_2D_4x4 | |||||
| void gpuMultMatrix2D(const float m[4][4]); | void gpuMultMatrix2D(const float m[4][4]); | ||||
| #else | |||||
| void gpuLoadMatrix2D(const float m[3][3]); | |||||
| void gpuMultMatrix2D(const float m[3][3]); | |||||
| #endif | |||||
| void gpuTranslate2f(float x, float y); | void gpuTranslate2f(float x, float y); | ||||
| void gpuTranslate2fv(const float vec[2]); | void gpuTranslate2fv(const float vec[2]); | ||||
| void gpuScale2f(float x, float y); | void gpuScale2f(float x, float y); | ||||
| void gpuScale2fv(const float vec[2]); | void gpuScale2fv(const float vec[2]); | ||||
| void gpuRotate2D(float deg); | void gpuRotate2D(float deg); | ||||
| ▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
| ) | ) | ||||
| /* TODO: finish this in a simpler way --^ */ | /* TODO: finish this in a simpler way --^ */ | ||||
| #else | #else | ||||
| # define gpuMultMatrix3D(x) gpuMultMatrix3D((const float (*)[4])(x)) | # define gpuMultMatrix3D(x) gpuMultMatrix3D((const float (*)[4])(x)) | ||||
| # define gpuLoadMatrix3D(x) gpuLoadMatrix3D((const float (*)[4])(x)) | # define gpuLoadMatrix3D(x) gpuLoadMatrix3D((const float (*)[4])(x)) | ||||
| # define gpuLoadProjectionMatrix3D(x) gpuLoadProjectionMatrix3D((const float (*)[4])(x)) | # define gpuLoadProjectionMatrix3D(x) gpuLoadProjectionMatrix3D((const float (*)[4])(x)) | ||||
| # if MATRIX_2D_4x4 | |||||
| # define gpuMultMatrix2D(x) gpuMultMatrix2D((const float (*)[4])(x)) | # define gpuMultMatrix2D(x) gpuMultMatrix2D((const float (*)[4])(x)) | ||||
| # else | |||||
| # define gpuMultMatrix2D(x) gpuMultMatrix2D((const float (*)[3])(x)) | |||||
| # define gpuLoadMatrix2D(x) gpuLoadMatrix2D((const float (*)[3])(x)) | |||||
| # endif | |||||
| # define gpuGetModelViewMatrix3D(x) gpuGetModelViewMatrix3D((float (*)[4])(x)) | # define gpuGetModelViewMatrix3D(x) gpuGetModelViewMatrix3D((float (*)[4])(x)) | ||||
| # define gpuGetProjectionMatrix3D(x) gpuGetProjectionMatrix3D((float (*)[4])(x)) | # define gpuGetProjectionMatrix3D(x) gpuGetProjectionMatrix3D((float (*)[4])(x)) | ||||
| # define gpuGetModelViewProjectionMatrix3D(x) gpuGetModelViewProjectionMatrix3D((float (*)[4])(x)) | # define gpuGetModelViewProjectionMatrix3D(x) gpuGetModelViewProjectionMatrix3D((float (*)[4])(x)) | ||||
| # define gpuGetNormalMatrix(x) gpuGetNormalMatrix((float (*)[3])(x)) | # define gpuGetNormalMatrix(x) gpuGetNormalMatrix((float (*)[3])(x)) | ||||
| # define gpuGetNormalMatrixInverse(x) gpuGetNormalMatrixInverse((float (*)[3])(x)) | # define gpuGetNormalMatrixInverse(x) gpuGetNormalMatrixInverse((float (*)[3])(x)) | ||||
| #endif /* C11 */ | #endif /* C11 */ | ||||
| #endif /* SUPPRESS_GENERIC_MATRIX_API */ | #endif /* SUPPRESS_GENERIC_MATRIX_API */ | ||||
| #endif /* GPU_MATRIX_H */ | #endif /* GPU_MATRIX_H */ | ||||