forked from vixorien/D3D11Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRenderable.h
More file actions
40 lines (33 loc) · 933 Bytes
/
Renderable.h
File metadata and controls
40 lines (33 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
// Don't include this if it's already been included somewhere else!
#include "Transform.h"
#include "Mesh.h"
#include <memory>
#include <wrl/client.h>
#include "Camera.h"
#include "Material.h"
class Renderable
{
public:
Renderable();
Renderable(std::shared_ptr<Mesh> mesh, std::shared_ptr<Material> material);
// There isn't really much for a destructor to do here.
// In general, a class shouldn't delete an object it didn't create.
// And in our case especially,
// where multiple renderable entities will use the same mesh,
// definitely don't delete the mesh.
// Getters
std::shared_ptr<Mesh> GetMesh();
std::shared_ptr<Material> GetMaterial();
Transform* GetTransform();
// Draw
void Draw(
Microsoft::WRL::ComPtr<ID3D11DeviceContext> context,
std::shared_ptr<Camera> camera,
float totalTime
);
private:
Transform trf;
std::shared_ptr<Mesh> mesh;
std::shared_ptr<Material> material;
};