Added Texture
This commit is contained in:
1 parent
4f1ea8327a
commit
933d3f1fe9
13 files changed
+84
-18
No files matched your search
@@ -11,7 +11,7 @@ namespace nf {
|
||||
public:
|
||||
Entity();
|
||||
|
||||
void create(const void* vertexBufferData, const size_t vertexBufferSize, const void* indexBufferData, size_t indexBufferCount);
|
||||
void create(const void* vertexBufferData, const size_t vertexBufferSize, const void* indexBufferData, size_t indexBufferCount, const void* textureCoordinatesBufferData = nullptr, size_t textureCoordinatesBufferSize = 0, const char* textureName = nullptr);
|
||||
//TODO: Do this using loaded assets somehow
|
||||
void setPosition(float x, float y, float z);
|
||||
void setRotation(float x, float y, float z);
|
||||
|
||||
@@ -5,17 +5,18 @@
|
||||
#endif
|
||||
|
||||
#include "Drawable.h"
|
||||
#include "Texture.h"
|
||||
|
||||
namespace nf {
|
||||
class Model : public Drawable {
|
||||
public:
|
||||
Model();
|
||||
|
||||
void create(const void* vertexBufferData, const size_t vertexBufferSize, const void* indexBufferData, size_t indexBufferCount);
|
||||
void create(const void* vertexBufferData, const size_t vertexBufferSize, const void* indexBufferData, size_t indexBufferCount, const void* textureCoordinates = nullptr, size_t textureCoordinatesBufferSize = 0, const char* textureName = nullptr);
|
||||
void bind() override;
|
||||
|
||||
~Model();
|
||||
private:
|
||||
|
||||
Texture* m_texture;
|
||||
};
|
||||
}
|
||||
@@ -22,7 +22,7 @@ namespace nf {
|
||||
public:
|
||||
Entity();
|
||||
|
||||
void create(const void* vertexBufferData, const size_t vertexBufferSize, const void* indexBufferData, size_t indexBufferCount);
|
||||
void create(const void* vertexBufferData, const size_t vertexBufferSize, const void* indexBufferData, size_t indexBufferCount, const void* textureCoordinatesBufferData = nullptr, size_t textureCoordinatesBufferSize = 0, const char* textureName = nullptr);
|
||||
//TODO: Do this using loaded assets somehow
|
||||
void setPosition(float x, float y, float z);
|
||||
void setRotation(float x, float y, float z);
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace nf {
|
||||
|
||||
void bind();
|
||||
void setUniform(const char* name, glm::mat4& data);
|
||||
static unsigned int current;
|
||||
|
||||
~Shader();
|
||||
private:
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
namespace nf {
|
||||
class Texture {
|
||||
public:
|
||||
Texture();
|
||||
|
||||
void create(const char* textureName);
|
||||
void bind();
|
||||
|
||||
~Texture();
|
||||
private:
|
||||
unsigned int m_id;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user