prosperon/source/engine/shader.h

32 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"
2023-05-04 17:07:00 -05:00
#include "sokol/sokol_gfx.h"
2021-11-30 21:29:18 -06:00
2022-11-19 17:13:57 -06:00
struct shader {
2023-05-04 17:07:00 -05:00
sg_shader shd;
2021-11-30 21:29:18 -06:00
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);
2023-05-04 17:07:00 -05: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);
2023-05-04 17:07:00 -05:00
*/
2021-11-30 21:29:18 -06:00
#endif