-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrawable.h
More file actions
29 lines (24 loc) · 810 Bytes
/
Drawable.h
File metadata and controls
29 lines (24 loc) · 810 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
#pragma once
#include "Graphics.h"
#include <DirectXMath.h>
#include <vector>
#include "IndexBuffer.h"
class Bindable;
class Drawable {
template<class T>
friend class DrawableBase;
public:
Drawable() = default;
Drawable(const Drawable&) = delete;
virtual ~Drawable() = default;
virtual DirectX::XMMATRIX getTransformXM() const noexcept = 0;
void draw(Graphics& g) const noexcept(!IS_DEBUG);
virtual void update(float dt) noexcept = 0;
protected:
void addBind(std::unique_ptr<Bindable> bind) noexcept(!IS_DEBUG);
void addIndexBuffer(std::unique_ptr<class IndexBuffer> ibuf) noexcept(!IS_DEBUG);
private:
virtual const std::vector<std::unique_ptr<Bindable>>& getStaticBinds() const noexcept = 0;
const class IndexBuffer* pIndexBuffer = nullptr;
std::vector<std::unique_ptr<Bindable>> binds;
};