Async load works, using exceptions for special resources.

This commit is contained in:
William Moberg
2016-01-14 16:27:45 +01:00
parent 9f185a1e35
commit 71047b08ec
13 changed files with 160 additions and 181 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
#include "../Core/ResourceManager.h"
class BaseTexture : public Resource
class BaseTexture : public ThreadUnsafeResource
{
friend class ResourceManager;
+5 -2
View File
@@ -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;
+3 -1
View File
@@ -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;
-3
View File
@@ -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();