citro3d/include/c3d/mtxstack.h

24 lines
540 B
C
Raw Normal View History

2014-12-20 21:34:19 +01:00
#pragma once
#include "maths.h"
#define C3D_MTXSTACK_SIZE 8
typedef struct
{
C3D_Mtx m[C3D_MTXSTACK_SIZE];
int pos;
2015-03-05 23:05:14 +01:00
u8 unifType, unifPos, unifLen;
2014-12-20 21:34:19 +01:00
bool isDirty;
} C3D_MtxStack;
static inline C3D_Mtx* MtxStack_Cur(C3D_MtxStack* stk)
{
stk->isDirty = true;
return &stk->m[stk->pos];
}
void MtxStack_Init(C3D_MtxStack* stk);
2015-03-05 23:05:14 +01:00
void MtxStack_Bind(C3D_MtxStack* stk, GPU_SHADER_TYPE unifType, int unifPos, int unifLen);
2014-12-20 21:34:19 +01:00
void MtxStack_Push(C3D_MtxStack* stk);
void MtxStack_Pop(C3D_MtxStack* stk);
void MtxStack_Update(C3D_MtxStack* stk);