Object now follows the behaviour of Shader
This commit is contained in:
parent
4fe91a12e2
commit
87b27eae70
7 changed files with 32 additions and 19 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue