36 lines
1.4 KiB
C
36 lines
1.4 KiB
C
#ifndef MONS_SHADER_H
|
|
#define MONS_SHADER_H
|
|
|
|
#include <glad/gl.h>
|
|
#include <stdbool.h>
|
|
|
|
typedef unsigned int mons_shader;
|
|
typedef unsigned int mons_program;
|
|
|
|
typedef enum mons_shader_type {
|
|
MONS_SHADER_TYPE_VERTEX = GL_VERTEX_SHADER,
|
|
MONS_SHADER_TYPE_FRAGMENT = GL_FRAGMENT_SHADER,
|
|
} mons_shader_type;
|
|
|
|
struct mons_vec2;
|
|
struct mons_vec3;
|
|
struct mons_vec4;
|
|
struct mons_mat4;
|
|
|
|
mons_shader mons_create_shader(mons_shader_type type, char *source, int len);
|
|
mons_program mons_create_program(mons_shader vertex_shader, mons_shader fragment_shader);
|
|
void mons_shader_set_float(mons_program shader, char *uniform_name, float value);
|
|
void mons_shader_set_vec2(mons_program shader, char *uniform_name, struct mons_vec2 value);
|
|
void mons_shader_set_vec3(mons_program shader, char *uniform_name, struct mons_vec3 value);
|
|
void mons_shader_set_vec4(mons_program shader, char *uniform_name, struct mons_vec4 value);
|
|
void mons_shader_set_mat4(mons_program shader, char *uniform_name, struct mons_mat4 value, bool transpose);
|
|
|
|
void mons_shader_set_float_global(char *uniform_name, float value);
|
|
void mons_shader_set_vec2_global(char *uniform_name, struct mons_vec2 value);
|
|
void mons_shader_set_vec3_global(char *uniform_name, struct mons_vec3 value);
|
|
void mons_shader_set_vec4_global(char *uniform_name, struct mons_vec4 value);
|
|
void mons_shader_set_mat4_global(char *uniform_name, struct mons_mat4 value, bool transpose);
|
|
void mons_shader_apply_global_uniforms(mons_program shader);
|
|
|
|
#endif
|