Added AssetPack and basic assets

This commit is contained in:
grayson committed 2021-08-27 22:37:02 -05:00
1 parent 933d3f1fe9
commit 29b3f8627e
7 files changed
+77 -1

No files matched your search

@@ -13,6 +13,7 @@ namespace nf {
void Entity::create(const void* vertexBufferData, const size_t vertexBufferSize, const void* indexBufferData, size_t indexBufferCount, const void* textureCoordinatesBufferData, size_t textureCoordinatesBufferSize, const char* textureName) {
m_model = new Model;
m_model->create(vertexBufferData, vertexBufferSize, indexBufferData, indexBufferCount, textureCoordinatesBufferData, textureCoordinatesBufferSize, textureName);
//TODO: Replace this with getting the information from the AGeometry and ATexture structs
}
void Entity::setPosition(float x, float y, float z) {
+1 -1
View File
@@ -17,7 +17,7 @@ namespace nf {
unsigned char* texture = stbi_load(textureName, &width, &height, &nChannels, 0);
//TODO: Load from memory
if (!texture)
Error("Texture failed to load from memory!");
Error("Texture \"" + (std::string)textureName + "\" failed to load from memory!");
glBindTexture(GL_TEXTURE_2D, m_id);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);