prosperon/source/engine/shader.h

32 lines
1.2 KiB
C
Raw Normal View History

2021-11-30 21:29:18 -06:00
#ifndef SHADER_H
#define SHADER_H
#include "mathc.h"
struct mShader {
unsigned int id;
const char *vertpath;
const char *fragpath;
};
void shader_compile_all();
struct mShader *MakeShader(const char *vertpath, const char *fragpath);
2022-07-02 03:40:50 -05:00
struct mShader *CreateShader(const char *vert, const char *frag);
2021-11-30 21:29:18 -06:00
void shader_compile(struct mShader *shader);
void shader_use(struct mShader *shader);
void shader_setbool(struct mShader *shader, const char *name, int val);
void shader_setint(struct mShader *shader, const char *name, int val);
void shader_setfloat(struct mShader *shader, const char *name, float val);
2022-07-02 03:40:50 -05:00
void shader_setvec2(struct mShader *shader, const char *name, mfloat_t val[2]);
void shader_setvec3(struct mShader *shader, const char *name, mfloat_t val[3]);
void shader_setvec4(struct mShader *shader, const char *name, mfloat_t val[4]);
void shader_setmat2(struct mShader *shader, const char *name, mfloat_t val[4]);
void shader_setmat3(struct mShader *shader, const char *name, mfloat_t val[9]);
void shader_setmat4(struct mShader *shader, const char *name, mfloat_t val[16]);
2021-11-30 21:29:18 -06:00
2022-07-02 03:40:50 -05:00
void shader_setUBO(struct mShader *shader, const char *name, unsigned int index);
2021-11-30 21:29:18 -06:00
#endif