summaryrefslogtreecommitdiff
path: root/src/shader.h
blob: cd44e8062100960ccff70017cc0de8f1d51f8c9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once
#include <glad/glad.h>

typedef struct {
	GLuint id;
} Shader;

[[nodiscard]]
/* Return -1 on error. */
int shader_init(Shader *s, const char *vertex_src, const char *fragment_src);

void shader_deinit(Shader *s);

void shader_use(const Shader *s);

/* Return -1 on error. */
GLint shader_uniform_location(const Shader *s, const char *name);