Lots of stuff, ending with Window restruct
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <NBCore/Errors.hpp>
|
||||
#include <NBCore/Utils.hpp>
|
||||
|
||||
#include <NBGraphics/Buffers.hpp>
|
||||
#include <NBGraphics/OGLObjects.hpp>
|
||||
|
||||
namespace nb {
|
||||
@@ -112,17 +113,22 @@ class Program : public OpenGLObject {
|
||||
Program& operator=(Program&&) = delete;
|
||||
operator bool();
|
||||
~Program() { remove(); }
|
||||
virtual void bind() const override {
|
||||
void bind() const override {
|
||||
OPENGL_CALL(glUseProgram(_id));
|
||||
}
|
||||
virtual void unbind() const override { /* TODO: Some warning of some kind perhaps*/ }
|
||||
void unbind() const override { /* TODO: Some warning of some kind perhaps*/ }
|
||||
GLint status(GLenum) const;
|
||||
std::string log() const;
|
||||
void setUniform(const std::string& blockname, std::shared_ptr<UniformBuffer>);
|
||||
void setUniformBinding(const std::string& blockname, GLuint index);
|
||||
GLuint getUniformBinding(const std::string& blockname) const;
|
||||
|
||||
friend Base;
|
||||
|
||||
protected:
|
||||
using Base::_id;
|
||||
GLint _success;
|
||||
std::unordered_map<std::string, GLuint> _uniformBindings;
|
||||
virtual GLuint declare() override {
|
||||
if (!_id) {
|
||||
_id = OPENGL_CALL(glCreateProgram());
|
||||
|
||||
Reference in New Issue
Block a user