♻️ (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);
|
Mesh3D(const std::string& filepath);
|
||||||
std::vector<float> meshVertices;
|
std::vector<float> meshVertices;
|
||||||
int numMeshVertices = 0;
|
int numMeshVertices = 0;
|
||||||
|
int numFaces = 0;
|
||||||
void loadOBJFile(const std::string& filepath);
|
void loadOBJFile(const std::string& filepath);
|
||||||
Texture2D texture;
|
Texture2D texture;
|
||||||
GLuint VBO;
|
GLuint VBO;
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
#include "ShaderProgram.h"
|
#include "ShaderProgram.h"
|
||||||
#include "Texture2D.h"
|
#include "Texture2D.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -21,7 +22,7 @@ struct Object3D {
|
|||||||
GLuint VAO;
|
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;
|
static bool gWireframe = false;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user