Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
74 lines (53 loc) · 1.88 KB

File metadata and controls

74 lines (53 loc) · 1.88 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//
// GLSLProgramObject.h - Wrapper for GLSL program objects
//
// Author: Louis Bavoil
// Email: sdkfeedback@nvidia.com
//
// Copyright (c) NVIDIA Corporation. All rights reserved.
////////////////////////////////////////////////////////////////////////////////
#ifndef GLSL_PROGRAM_OBJECT_H
#define GLSL_PROGRAM_OBJECT_H
#include <GL/glew.h>
#include <glm/vec3.hpp>
#include <glm/mat3x3.hpp>
#include <glm/mat4x4.hpp>
#include <string>
#include <vector>
class GLSLProgramObject
{
public:
GLSLProgramObject();
virtual ~GLSLProgramObject();
void destroy();
void bind();
void unbind();
void setUniform(const std::string& name, GLuint val);
void setUniform(const std::string& name, GLfloat val);
void setUniform(const std::string& name, const glm::vec3& val);
void setUniform(const std::string& name, const glm::mat3& val);
void setUniform(const std::string& name, const glm::mat4& val);
void setTextureUnit(const std::string& texname, int texunit);
void bindTexture(GLenum target, const std::string& texname, GLuint texid, int texunit);
void bindTexture2D(const std::string& texname, GLuint texid, int texunit) {
bindTexture(GL_TEXTURE_2D, texname, texid, texunit);
}
void bindTexture2DArray(const std::string& texname, GLuint texid, int texunit) {
bindTexture(GL_TEXTURE_2D_ARRAY, texname, texid, texunit);
}
void bindTexture3D(const std::string& texname, GLuint texid, int texunit) {
bindTexture(GL_TEXTURE_3D, texname, texid, texunit);
}
void bindTextureRECT(const std::string& texname, GLuint texid, int texunit) {
bindTexture(GL_TEXTURE_RECTANGLE_ARB, texname, texid, texunit);
}
void attachVertexShader(const std::string& filename);
void attachFragmentShader(const std::string& filename);
void link();
inline GLuint getProgId() { return _progId; }
protected:
std::vector<GLuint> _vertexShaders;
std::vector<GLuint> _fragmentShaders;
GLuint _progId;
};
#endif
Morty Proxy This is a proxified and sanitized view of the page, visit original site.