prosperon/source/engine/shader.h

31 lines
1.1 KiB
C
Raw Normal View History

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