2021-11-12 20:03:04 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Object.hpp"
|
|
|
|
#include "Shader.hpp"
|
|
|
|
#include "gl_core_3_3.h"
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
namespace glrage {
|
|
|
|
namespace gl {
|
|
|
|
|
|
|
|
class Program : public Object
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Program();
|
|
|
|
~Program();
|
|
|
|
void bind();
|
|
|
|
void attach(Shader& shader);
|
|
|
|
void detach(Shader& shader);
|
|
|
|
void link();
|
|
|
|
void fragmentData(const std::string& name);
|
|
|
|
GLint attributeLocation(const std::string& name);
|
|
|
|
GLint uniformLocation(const std::string& name);
|
|
|
|
|
|
|
|
void uniform3f(const std::string& name, GLfloat v0, GLfloat v1, GLfloat v2);
|
2021-11-14 23:59:19 +01:00
|
|
|
void uniform4f(const std::string& name,
|
|
|
|
GLfloat v0,
|
|
|
|
GLfloat v1,
|
|
|
|
GLfloat v2,
|
2021-11-12 20:03:04 +01:00
|
|
|
GLfloat v3);
|
|
|
|
void uniform1i(const std::string& name, GLint v0);
|
2021-11-14 23:59:19 +01:00
|
|
|
void uniformMatrix4fv(const std::string& name,
|
|
|
|
GLsizei count,
|
|
|
|
GLboolean transpose,
|
|
|
|
const GLfloat* value);
|
2021-11-12 20:03:04 +01:00
|
|
|
|
|
|
|
std::string infoLog();
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::map<std::string, GLint> m_attributeLocations;
|
|
|
|
std::map<std::string, GLint> m_uniformLocations;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace gl
|
|
|
|
} // namespace glrage
|