Incorrectly loading a model, Adding a VertexArray abstraction
* Using import library assimp to incorrectly load a cube.obj * Using a temporary Renderable class as a placeholder for all data needed to render the mesh. * Vertex Array abstraction added
This commit is contained in:
@ -4,7 +4,10 @@
|
||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||
#define TINYGLTF_NO_EXTERNAL_IMAGE
|
||||
|
||||
#include <tiny_gltf.h>
|
||||
#include <MyGraphicsEngine/Mesh.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/postprocess.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <string>
|
||||
|
||||
@ -14,9 +17,11 @@ private:
|
||||
void ImportBlend(std::string path);
|
||||
void ImportGLTF(std::string path);
|
||||
void ImportOBJ(std::string path);
|
||||
static BarinkEngine::Mesh ModelImporter::processMesh(aiMesh* mesh, const aiScene* scene);
|
||||
static std::vector<BarinkEngine::Mesh> ModelImporter::processNode(aiNode* node, const aiScene* scene);
|
||||
|
||||
public:
|
||||
void Import(std::string path);
|
||||
|
||||
static void Test();
|
||||
static std::vector<BarinkEngine::Mesh> Test();
|
||||
};
|
12
MyGraphicsEngine/include/Editor/EditorWindow.h
Normal file
12
MyGraphicsEngine/include/Editor/EditorWindow.h
Normal file
@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
class EditorWindow {
|
||||
protected:
|
||||
std::string WindowTitle;
|
||||
|
||||
public:
|
||||
|
||||
virtual void Show() = 0;
|
||||
|
||||
};
|
@ -1,10 +1,12 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <glm/glm.hpp>
|
||||
namespace BarinkEngine{
|
||||
|
||||
class Mesh {
|
||||
public:
|
||||
std::vector<glm::vec3> vertices;
|
||||
std::vector<GLushort> elements;
|
||||
std::vector<glm::vec2> uv;
|
||||
};
|
||||
class Mesh {
|
||||
public:
|
||||
std::vector<glm::vec3> vertices;
|
||||
std::vector<unsigned int > elements;
|
||||
std::vector<glm::vec2> uv;
|
||||
};
|
||||
}
|
18
MyGraphicsEngine/include/MyGraphicsEngine/VertexArray.h
Normal file
18
MyGraphicsEngine/include/MyGraphicsEngine/VertexArray.h
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
class VertexArray{
|
||||
private:
|
||||
unsigned int id;
|
||||
|
||||
|
||||
public:
|
||||
void Create();
|
||||
void Bind();
|
||||
void Unbind();
|
||||
|
||||
void Delete();
|
||||
|
||||
void AttachAttribute(unsigned int index, int size, int stride);
|
||||
|
||||
|
||||
};
|
Reference in New Issue
Block a user