citro3d  1.2.0
mtxstack.h
Go to the documentation of this file.
1 #pragma once
2 #include "maths.h"
3 
4 #define C3D_MTXSTACK_SIZE 8
5 
6 typedef struct
7 {
9  int pos;
10  u8 unifType, unifPos, unifLen;
11  bool isDirty;
12 } C3D_MtxStack;
13 
14 static inline C3D_Mtx* MtxStack_Cur(C3D_MtxStack* stk)
15 {
16  stk->isDirty = true;
17  return &stk->m[stk->pos];
18 }
19 
20 void MtxStack_Init(C3D_MtxStack* stk);
21 void MtxStack_Bind(C3D_MtxStack* stk, GPU_SHADER_TYPE unifType, int unifPos, int unifLen);
24 void MtxStack_Update(C3D_MtxStack* stk);
void MtxStack_Update(C3D_MtxStack *stk)
Definition: mtxstack.c:35
void MtxStack_Init(C3D_MtxStack *stk)
Definition: mtxstack.c:4
void MtxStack_Bind(C3D_MtxStack *stk, GPU_SHADER_TYPE unifType, int unifPos, int unifLen)
Definition: mtxstack.c:12
C3D_Mtx * MtxStack_Pop(C3D_MtxStack *stk)
Definition: mtxstack.c:28
C3D_Mtx * MtxStack_Push(C3D_MtxStack *stk)
Definition: mtxstack.c:20
static C3D_Mtx * MtxStack_Cur(C3D_MtxStack *stk)
Definition: mtxstack.h:14
#define C3D_MTXSTACK_SIZE
Definition: mtxstack.h:4
Definition: mtxstack.h:7
u8 unifLen
Definition: mtxstack.h:10
C3D_Mtx m[C3D_MTXSTACK_SIZE]
Definition: mtxstack.h:8
int pos
Definition: mtxstack.h:9
bool isDirty
Definition: mtxstack.h:11
Row-major 4x4 matrix.
Definition: types.h:77