VenomEngine
Cross-Platform Modern Graphics Engine
Loading...
Searching...
No Matches
Model.h
1
8#pragma once
9
13
14#include <vector>
15
16namespace venom
17{
18namespace common
19{
20class Model;
21
22class VENOM_COMMON_API ModelResource : public GraphicsCachedResource
23{
24public:
25 std::vector<vc::Mesh> meshes;
26 std::vector<vc::Material> materials;
27};
28
29class VENOM_COMMON_API ModelImpl : public PluginObjectImpl, public GraphicsPluginObject, public GraphicsCachedResourceHolder
30{
31public:
32 ModelImpl();
33 virtual ~ModelImpl() = default;
34
35 vc::Error ImportModel(const char * path);
36 virtual void Draw() = 0;
37
38 const std::vector<vc::Mesh> & GetMeshes() const;
39
40private:
41 friend class Model;
42};
43
46class VENOM_COMMON_API Model : public PluginObjectImplWrapper
47{
48public:
49 Model();
50 Model(const char * path);
51 ~Model();
52
53 inline void Draw() { _impl->As<ModelImpl>()->Draw(); }
54 inline vc::Error ImportModel(const char * path) { return _impl->As<ModelImpl>()->ImportModel(path); }
55 inline const std::vector<vc::Mesh> & GetMeshes() const { return _impl->As<ModelImpl>()->GetMeshes(); }
56};
57
58
59}
60}
Base class for cached resource holders.
Definition GraphicsPluginObject.h:57
Base class for cached resources.
Definition GraphicsPluginObject.h:29
Base class for graphics plugin objects.
Definition GraphicsPluginObject.h:80
Contains all the mesh's data and is the main high-level interface for the user.
Definition Model.h:47
Definition Model.h:30
Definition Model.h:23
Interface for the PluginObject different implementations.
Definition PluginObject.h:56
Wrapper for the PluginObjectImpl, inherited by classes like Model or Mesh to make them usable as comp...
Definition PluginObject.h:76
Contains the entirety of the code of the VenomEngine project.
Definition Config.h:13