SDL_gpu  0.11.0
A hardware-accelerated, cross-platform 2D graphics API
Data Structures
Matrix Controls

Data Structures

struct  GPU_MatrixStack
 
DECLSPEC float SDLCALL GPU_VectorLength (float *vec3)
 
DECLSPEC void SDLCALL GPU_VectorNormalize (float *vec3)
 
DECLSPEC float SDLCALL GPU_VectorDot (float *A, float *B)
 
DECLSPEC void SDLCALL GPU_VectorCross (float *result, float *A, float *B)
 
DECLSPEC void SDLCALL GPU_VectorCopy (float *result, float *A)
 
DECLSPEC void SDLCALL GPU_VectorApplyMatrix (float *vec3, float *matrix_4x4)
 
DECLSPEC void SDLCALL GPU_MatrixCopy (float *result, const float *A)
 
DECLSPEC void SDLCALL GPU_MatrixIdentity (float *result)
 
DECLSPEC void SDLCALL GPU_MatrixOrtho (float *result, float left, float right, float bottom, float top, float near, float far)
 
DECLSPEC void SDLCALL GPU_MatrixFrustum (float *result, float left, float right, float bottom, float top, float near, float far)
 
DECLSPEC void SDLCALL GPU_MatrixPerspective (float *result, float fovy, float aspect, float zNear, float zFar)
 
DECLSPEC void SDLCALL GPU_MatrixLookAt (float *matrix, float eye_x, float eye_y, float eye_z, float target_x, float target_y, float target_z, float up_x, float up_y, float up_z)
 
DECLSPEC void SDLCALL GPU_MatrixTranslate (float *result, float x, float y, float z)
 
DECLSPEC void SDLCALL GPU_MatrixScale (float *result, float sx, float sy, float sz)
 
DECLSPEC void SDLCALL GPU_MatrixRotate (float *result, float degrees, float x, float y, float z)
 
DECLSPEC void SDLCALL GPU_Multiply4x4 (float *result, float *A, float *B)
 
DECLSPEC void SDLCALL GPU_MultiplyAndAssign (float *result, float *B)
 
DECLSPEC const char *SDLCALL GPU_GetMatrixString (float *A)
 
DECLSPEC float *SDLCALL GPU_GetCurrentMatrix (void)
 
DECLSPEC float *SDLCALL GPU_GetModelView (void)
 
DECLSPEC float *SDLCALL GPU_GetProjection (void)
 
DECLSPEC void SDLCALL GPU_GetModelViewProjection (float *result)
 
DECLSPEC void SDLCALL GPU_MatrixMode (int matrix_mode)
 
DECLSPEC void SDLCALL GPU_PushMatrix (void)
 
DECLSPEC void SDLCALL GPU_PopMatrix (void)
 
DECLSPEC void SDLCALL GPU_LoadIdentity (void)
 
DECLSPEC void SDLCALL GPU_Ortho (float left, float right, float bottom, float top, float near, float far)
 
DECLSPEC void SDLCALL GPU_Frustum (float left, float right, float bottom, float top, float near, float far)
 
DECLSPEC void SDLCALL GPU_Translate (float x, float y, float z)
 
DECLSPEC void SDLCALL GPU_Scale (float sx, float sy, float sz)
 
DECLSPEC void SDLCALL GPU_Rotate (float degrees, float x, float y, float z)
 
DECLSPEC void SDLCALL GPU_MultMatrix (float *matrix4x4)
 

Detailed Description

Function Documentation

◆ GPU_Frustum()

DECLSPEC void SDLCALL GPU_Frustum ( float  left,
float  right,
float  bottom,
float  top,
float  near,
float  far 
)

Multiplies a perspective projection matrix into the current matrix.

Definition at line 484 of file SDL_gpu_matrix.c.

◆ GPU_GetCurrentMatrix()

DECLSPEC float* SDLCALL GPU_GetCurrentMatrix ( void  )

Returns the current matrix from the top of the matrix stack. Returns NULL if stack is empty.

Definition at line 415 of file SDL_gpu_matrix.c.

◆ GPU_GetMatrixString()

DECLSPEC const char* SDLCALL GPU_GetMatrixString ( float *  A)

Returns an internal string that represents the contents of matrix A.

Definition at line 360 of file SDL_gpu_matrix.c.

◆ GPU_GetModelView()

DECLSPEC float* SDLCALL GPU_GetModelView ( void  )

Returns the current modelview matrix from the top of the matrix stack. Returns NULL if stack is empty.

Definition at line 389 of file SDL_gpu_matrix.c.

◆ GPU_GetModelViewProjection()

DECLSPEC void SDLCALL GPU_GetModelViewProjection ( float *  result)

Copies the current modelview-projection matrix into the given 'result' matrix (result = P*M).

Definition at line 519 of file SDL_gpu_matrix.c.

◆ GPU_GetProjection()

DECLSPEC float* SDLCALL GPU_GetProjection ( void  )

Returns the current projection matrix from the top of the matrix stack. Returns NULL if stack is empty.

Definition at line 402 of file SDL_gpu_matrix.c.

◆ GPU_LoadIdentity()

DECLSPEC void SDLCALL GPU_LoadIdentity ( void  )

Fills current matrix with the identity matrix.

Definition at line 468 of file SDL_gpu_matrix.c.

◆ GPU_MatrixCopy()

DECLSPEC void SDLCALL GPU_MatrixCopy ( float *  result,
const float *  A 
)

Overwrite 'result' matrix with the values from matrix A.

Definition at line 122 of file SDL_gpu_matrix.c.

◆ GPU_MatrixFrustum()

DECLSPEC void SDLCALL GPU_MatrixFrustum ( float *  result,
float  left,
float  right,
float  bottom,
float  top,
float  near,
float  far 
)

Multiplies a perspective projection matrix into the given matrix.

Definition at line 163 of file SDL_gpu_matrix.c.

◆ GPU_MatrixIdentity()

DECLSPEC void SDLCALL GPU_MatrixIdentity ( float *  result)

Fills 'result' matrix with the identity matrix.

Definition at line 127 of file SDL_gpu_matrix.c.

◆ GPU_MatrixLookAt()

DECLSPEC void SDLCALL GPU_MatrixLookAt ( float *  matrix,
float  eye_x,
float  eye_y,
float  eye_z,
float  target_x,
float  target_y,
float  target_z,
float  up_x,
float  up_y,
float  up_z 
)

Multiplies a view matrix into the given matrix.

Definition at line 194 of file SDL_gpu_matrix.c.

◆ GPU_MatrixMode()

DECLSPEC void SDLCALL GPU_MatrixMode ( int  matrix_mode)

Changes matrix mode to either GPU_PROJECTION or GPU_MODELVIEW. Further matrix stack operations manipulate that particular stack.

Definition at line 380 of file SDL_gpu_matrix.c.

◆ GPU_MatrixOrtho()

DECLSPEC void SDLCALL GPU_MatrixOrtho ( float *  result,
float  left,
float  right,
float  bottom,
float  top,
float  near,
float  far 
)

Multiplies an orthographic projection matrix into the given matrix.

Definition at line 134 of file SDL_gpu_matrix.c.

◆ GPU_MatrixPerspective()

DECLSPEC void SDLCALL GPU_MatrixPerspective ( float *  result,
float  fovy,
float  aspect,
float  zNear,
float  zFar 
)

Multiplies a perspective projection matrix into the given matrix.

Definition at line 181 of file SDL_gpu_matrix.c.

◆ GPU_MatrixRotate()

DECLSPEC void SDLCALL GPU_MatrixRotate ( float *  result,
float  degrees,
float  x,
float  y,
float  z 
)

Multiplies a rotation matrix into the given matrix.

Definition at line 279 of file SDL_gpu_matrix.c.

◆ GPU_MatrixScale()

DECLSPEC void SDLCALL GPU_MatrixScale ( float *  result,
float  sx,
float  sy,
float  sz 
)

Multiplies a scaling matrix into the given matrix.

Definition at line 261 of file SDL_gpu_matrix.c.

◆ GPU_MatrixTranslate()

DECLSPEC void SDLCALL GPU_MatrixTranslate ( float *  result,
float  x,
float  y,
float  z 
)

Adds a translation into the given matrix.

Definition at line 233 of file SDL_gpu_matrix.c.

◆ GPU_Multiply4x4()

DECLSPEC void SDLCALL GPU_Multiply4x4 ( float *  result,
float *  A,
float *  B 
)

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'.

See also
GPU_MultiplyAndAssign

Definition at line 325 of file SDL_gpu_matrix.c.

◆ GPU_MultiplyAndAssign()

DECLSPEC void SDLCALL GPU_MultiplyAndAssign ( float *  result,
float *  B 
)

Multiplies matrices 'result' and B and stores the result in the given 'result' matrix (result = result * B).

Definition at line 348 of file SDL_gpu_matrix.c.

◆ GPU_MultMatrix()

DECLSPEC void SDLCALL GPU_MultMatrix ( float *  matrix4x4)

Multiplies a given matrix into the current matrix.

Definition at line 508 of file SDL_gpu_matrix.c.

◆ GPU_Ortho()

DECLSPEC void SDLCALL GPU_Ortho ( float  left,
float  right,
float  bottom,
float  top,
float  near,
float  far 
)

Multiplies an orthographic projection matrix into the current matrix.

Definition at line 478 of file SDL_gpu_matrix.c.

◆ GPU_PopMatrix()

DECLSPEC void SDLCALL GPU_PopMatrix ( void  )

Removes the current matrix from the stack.

Definition at line 450 of file SDL_gpu_matrix.c.

◆ GPU_PushMatrix()

DECLSPEC void SDLCALL GPU_PushMatrix ( void  )

Pushes the current matrix as a new matrix stack item.

Definition at line 432 of file SDL_gpu_matrix.c.

◆ GPU_Rotate()

DECLSPEC void SDLCALL GPU_Rotate ( float  degrees,
float  x,
float  y,
float  z 
)

Multiplies a rotation matrix into the current matrix.

Definition at line 502 of file SDL_gpu_matrix.c.

◆ GPU_Scale()

DECLSPEC void SDLCALL GPU_Scale ( float  sx,
float  sy,
float  sz 
)

Multiplies a scaling matrix into the current matrix.

Definition at line 496 of file SDL_gpu_matrix.c.

◆ GPU_Translate()

DECLSPEC void SDLCALL GPU_Translate ( float  x,
float  y,
float  z 
)

Adds a translation into the current matrix.

Definition at line 490 of file SDL_gpu_matrix.c.

◆ GPU_VectorApplyMatrix()

DECLSPEC void SDLCALL GPU_VectorApplyMatrix ( float *  vec3,
float *  matrix_4x4 
)

Multiplies the given matrix into the given vector (vec3 = matrix*vec3).

Definition at line 90 of file SDL_gpu_matrix.c.

◆ GPU_VectorCopy()

DECLSPEC void SDLCALL GPU_VectorCopy ( float *  result,
float *  A 
)

Overwrite 'result' vector with the values from vector A.

Definition at line 83 of file SDL_gpu_matrix.c.

◆ GPU_VectorCross()

DECLSPEC void SDLCALL GPU_VectorCross ( float *  result,
float *  A,
float *  B 
)

Performs the cross product of vectors A and B (result = A x B). Do not use A or B as 'result'.

Definition at line 76 of file SDL_gpu_matrix.c.

◆ GPU_VectorDot()

DECLSPEC float SDLCALL GPU_VectorDot ( float *  A,
float *  B 
)

Returns the dot product of two vectors.

Definition at line 71 of file SDL_gpu_matrix.c.

◆ GPU_VectorLength()

DECLSPEC float SDLCALL GPU_VectorLength ( float *  vec3)

Returns the magnitude (length) of the given vector.

Definition at line 58 of file SDL_gpu_matrix.c.

◆ GPU_VectorNormalize()

DECLSPEC void SDLCALL GPU_VectorNormalize ( float *  vec3)

Modifies the given vector so that it has a new length of 1.

Definition at line 63 of file SDL_gpu_matrix.c.