citro3d
Loading...
Searching...
No Matches
mtxstack.h
1#pragma once
2#include "maths.h"
3
4#define C3D_MTXSTACK_SIZE 8
5
6typedef struct
7{
8 C3D_Mtx m[C3D_MTXSTACK_SIZE];
9 int pos;
10 u8 unifType, unifPos, unifLen;
11 bool isDirty;
13
14static inline C3D_Mtx* MtxStack_Cur(C3D_MtxStack* stk)
15{
16 stk->isDirty = true;
17 return &stk->m[stk->pos];
18}
19
20void MtxStack_Init(C3D_MtxStack* stk);
21void MtxStack_Bind(C3D_MtxStack* stk, GPU_SHADER_TYPE unifType, int unifPos, int unifLen);
22C3D_Mtx* MtxStack_Push(C3D_MtxStack* stk);
23C3D_Mtx* MtxStack_Pop(C3D_MtxStack* stk);
24void MtxStack_Update(C3D_MtxStack* stk);
GPU_SHADER_TYPE
Basic math library for matrix, vector, and quaternion operations.
Definition mtxstack.h:7
uint8_t u8
Row-major 4x4 matrix.
Definition types.h:91