Leviathan  0.8.0.0
Leviathan game engine
Renderable.h
Go to the documentation of this file.
1 // Leviathan Game Engine
2 // Copyright (c) 2012-2019 Henri Hyyryläinen
3 #pragma once
4 #include "Define.h"
5 // ------------------------------------ //
6 #include "BaseRenderable.h"
7 #include "Material.h"
8 #include "Mesh.h"
9 
10 namespace Leviathan {
11 
13 class Renderable : public BaseRenderable {
14 protected:
15  // These are protected for only constructing properly reference
16  // counted instances through MakeShared
18 
20 
21 public:
22  DLLEXPORT void SetMaterial(const Material::pointer& material);
23  DLLEXPORT void SetMesh(const Mesh::pointer& mesh);
24 
26 
27 protected:
28  DLLEXPORT virtual void OnAttachedToParent(SceneNode& parent) override;
29  DLLEXPORT virtual void OnDetachedFromParent(SceneNode& oldparent) override;
30 
31 private:
33  bs::HRenderable GraphicalObject;
34 
35  Material::pointer _Material;
36  Mesh::pointer _Mesh;
37 };
38 
39 } // namespace Leviathan
DLLEXPORT void SetMesh(const Mesh::pointer &mesh)
Definition: Renderable.cpp:45
Implements a basic renderable rendering a Mesh with a Material.
Definition: Renderable.h:13
DLLEXPORT Renderable(SceneNode &parent)
Definition: Renderable.cpp:10
REFERENCE_COUNTED_PTR_TYPE(Renderable)
A node in the Scene used to position renderables and other SceneNodes.
Definition: SceneNode.h:70
DLLEXPORT void SetMaterial(const Material::pointer &material)
Definition: Renderable.cpp:31
virtual DLLEXPORT void OnAttachedToParent(SceneNode &parent) override
Definition: Renderable.cpp:17
#define DLLEXPORT
Definition: Include.h:84
virtual DLLEXPORT void OnDetachedFromParent(SceneNode &oldparent) override
Definition: Renderable.cpp:23
The access mask controls which registered functions and classes a script sees.
Definition: GameModule.h:12