♻️ (engine): store Mesh3D objects as unique_ptr for safer memory handling
This commit is contained in:
parent
0ffaffc83e
commit
646efa9383
@ -13,6 +13,7 @@ namespace djalim {
|
||||
Mesh3D(const std::string& filepath);
|
||||
std::vector<float> meshVertices;
|
||||
int numMeshVertices = 0;
|
||||
int numFaces = 0;
|
||||
void loadOBJFile(const std::string& filepath);
|
||||
Texture2D texture;
|
||||
GLuint VBO;
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
#include "ShaderProgram.h"
|
||||
#include "Texture2D.h"
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -21,7 +22,7 @@ struct Object3D {
|
||||
GLuint VAO;
|
||||
};
|
||||
|
||||
typedef std::map<std::string,djalim::Mesh3D> Objects3D;
|
||||
typedef std::map<std::string,std::unique_ptr<djalim::Mesh3D>> Objects3D;
|
||||
|
||||
static bool gWireframe = false;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user