-
Notifications
You must be signed in to change notification settings - Fork 1
/
shader.hpp
42 lines (35 loc) · 1001 Bytes
/
shader.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// shader.hpp
// fgt
//
// Created by Albin Stigö on 01/12/2017.
// Copyright © 2017 Albin Stigo. All rights reserved.
//
#ifndef shader_hpp
#define shader_hpp
#include <stdio.h>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <string>
#include <glm/glm.hpp>
using namespace std;
class Shader {
GLuint m_program;
static string contentsOfFile(string path);
static void compileShaderOrLogAndDie(GLuint shader);
public:
Shader(string name);
~Shader();
GLuint program();
GLuint attribLocation(string name);
void enableVertexAttribArray(string name);
void disableVertexAttribArray(string name);
void vertexAttribPointer(string name, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
GLuint uniformLocation(string name);
void setUniform(string name, glm::mat4 &mat4);
void setUniform(string name, GLint v0);
void setUniform(string name, GLfloat v0);
void use();
void release();
};
#endif /* shader_hpp */