Lots of stuff, ending with Window restruct

This commit is contained in:
NaifBanana
2026-09-09 12:18:44 -05:00
parent e2ea8c5373
commit fa60274540
12 changed files with 412 additions and 40 deletions
@@ -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());