first commit
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
#pragma once
|
||||
|
||||
#include <set>
|
||||
|
||||
#include "PaintDevice.h"
|
||||
|
||||
class Engine
|
||||
{
|
||||
public:
|
||||
enum class ErrorCode
|
||||
{
|
||||
success = 0,
|
||||
paint_device_not_ready
|
||||
};
|
||||
|
||||
virtual ~Engine() = default;
|
||||
|
||||
ErrorCode run();
|
||||
|
||||
protected:
|
||||
void track_key(int key);
|
||||
|
||||
void untrack_key(int key);
|
||||
|
||||
PaintDevice& paint_device()
|
||||
{
|
||||
return m_PaintDevice;
|
||||
}
|
||||
|
||||
virtual bool end() const = 0;
|
||||
|
||||
virtual void on_button_press(
|
||||
int button
|
||||
) = 0;
|
||||
|
||||
virtual void update(
|
||||
int dt
|
||||
) = 0;
|
||||
|
||||
virtual void render(
|
||||
PaintDevice& paintDevice
|
||||
) = 0;
|
||||
|
||||
private:
|
||||
void updateInput();
|
||||
|
||||
PaintDevice m_PaintDevice;
|
||||
|
||||
std::set<int> m_TrackedKeys;
|
||||
};
|
||||
Reference in New Issue
Block a user