1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
matabstrix/src/executable.hpp

36 lines
601 B
C++
Raw Permalink Normal View History

2015-11-13 13:24:16 +00:00
#ifndef _EXECUTABLE_HPP_
#define _EXECUTABLE_HPP_
#include "gl.hpp"
#include "shader.hpp"
2015-11-13 13:52:01 +00:00
#include <vector>
2015-11-13 13:24:16 +00:00
struct Executable
{
void use() const;
2015-11-13 13:52:01 +00:00
inline GLuint uniform(unsigned index) const;
2015-11-13 13:24:16 +00:00
private:
friend struct Program;
Executable();
void attach_shader(const Shader &shader);
void bind_attrib_location(GLuint index, const GLchar *name);
void link();
2015-11-13 13:52:01 +00:00
void get_uniforms(unsigned count, const GLchar *const names[]);
2015-11-13 13:24:16 +00:00
GLuint id;
2015-11-13 13:52:01 +00:00
std::vector<GLuint> uniforms;
2015-11-13 13:24:16 +00:00
};
2015-11-13 13:52:01 +00:00
GLuint Executable::uniform(unsigned index) const
{
return uniforms.at(index);
}
2015-11-13 13:24:16 +00:00
#endif // _EXECUTABLE_HPP_