Async load works, using exceptions for special resources.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "../Core/ResourceManager.h"
|
||||
|
||||
class BaseTexture : public Resource
|
||||
class BaseTexture : public ThreadUnsafeResource
|
||||
{
|
||||
friend class ResourceManager;
|
||||
|
||||
|
||||
@@ -4,21 +4,24 @@
|
||||
#include "RawModel.h"
|
||||
#include "../OpenGL.h"
|
||||
|
||||
class Model : public RawModel
|
||||
class Model : public ThreadUnsafeResource
|
||||
{
|
||||
friend class ResourceManager;
|
||||
|
||||
private:
|
||||
Model(std::string fileName);
|
||||
virtual void GlCommands() override;
|
||||
|
||||
public:
|
||||
~Model();
|
||||
const std::vector<RawModel::MaterialGroup>& TextureGroups() const { return m_RawModel->TextureGroups; }
|
||||
const glm::mat4& Matrix() const { return m_RawModel->m_Matrix; }
|
||||
const std::vector<RawModel::Vertex>& Vertices() const { return m_RawModel->m_Vertices; }
|
||||
|
||||
GLuint VAO;
|
||||
GLuint ElementBuffer;
|
||||
|
||||
private:
|
||||
RawModel* m_RawModel;
|
||||
GLuint VertexBuffer;
|
||||
GLuint DiffuseVertexColorBuffer;
|
||||
GLuint SpecularVertexColorBuffer;
|
||||
|
||||
@@ -24,7 +24,6 @@ class RawModel : public Resource
|
||||
|
||||
protected:
|
||||
RawModel(std::string fileName);
|
||||
virtual void GlCommands() override;
|
||||
|
||||
public:
|
||||
~RawModel();
|
||||
@@ -47,8 +46,11 @@ public:
|
||||
struct MaterialGroup
|
||||
{
|
||||
float Shininess;
|
||||
std::string TexturePath;
|
||||
std::shared_ptr<::Texture> Texture;
|
||||
std::string NormalMapPath;
|
||||
std::shared_ptr<::Texture> NormalMap;
|
||||
std::string SpecularMapPath;
|
||||
std::shared_ptr<::Texture> SpecularMap;
|
||||
unsigned int StartIndex;
|
||||
unsigned int EndIndex;
|
||||
|
||||
@@ -11,10 +11,7 @@ class Texture : public BaseTexture
|
||||
|
||||
private:
|
||||
Texture(std::string path);
|
||||
virtual void GlCommands() override;
|
||||
|
||||
GLint m_Format;
|
||||
Image* m_Image;
|
||||
public:
|
||||
~Texture();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user