Object now follows the behaviour of Shader

This commit is contained in:
Robert 2021-01-21 01:12:25 +01:00
parent 4fe91a12e2
commit 87b27eae70
7 changed files with 32 additions and 19 deletions

View file

@ -1,7 +1,7 @@
#ifndef COLOR_HPP
#define COLOR_HPP
#include "core.hpp"
#include <core.hpp>
#include <glad/glad.h>
namespace oglu

View file

@ -1,6 +1,8 @@
#ifndef CORE_HPP
#define CORE_HPP
#include <memory>
#ifdef OGLU_WIN32
#ifdef OGLU_BUILD_DLL
#define OGLU_API __declspec(dllexport)

View file

@ -1,7 +1,7 @@
#ifndef DRAWABLE_HPP
#define DRAWABLE_HPP
#include "core.hpp"
#include <core.hpp>
#include <glad/glad.h>
namespace oglu
@ -15,11 +15,12 @@ namespace oglu
const GLvoid* pointer;
} VertexAttribute;
class OGLU_API Object
class OGLU_API AbstractObject
{
public:
Object();
Object(const GLfloat* vertices, size_t verticesSize, const GLuint* indices, size_t indicesSize, const VertexAttribute* topology, size_t topologySize);
AbstractObject(const AbstractObject& other);
friend std::shared_ptr<AbstractObject> OGLU_API MakeObject(const GLfloat* vertices, size_t verticesSize, const GLuint* indices, size_t indicesSize, const VertexAttribute* topology, size_t topologySize);
GLuint GetVAO() { return VAO; }
void Bind();
@ -29,11 +30,15 @@ namespace oglu
void BindAndDraw();
private:
AbstractObject(const GLfloat* vertices, size_t verticesSize, const GLuint* indices, size_t indicesSize, const VertexAttribute* topology, size_t topologySize);
inline void RegisterVertexAttribPointer(GLuint index, const VertexAttribute& topology);
GLuint VAO;
GLsizei count;
};
typedef std::shared_ptr<AbstractObject> Object;
}
#endif

View file

@ -1,7 +1,6 @@
#ifndef SHADER_HPP
#define SHADER_HPP
#include <memory>
#include <core.hpp>
#include <glad/glad.h>