add: Simple widget system
This commit is contained in:
22
frame/src/widgets/clock/Analog.hpp
Normal file
22
frame/src/widgets/clock/Analog.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include "../Widget.hpp"
|
||||
|
||||
#include <chrono>
|
||||
|
||||
namespace frame::widgets
|
||||
{
|
||||
|
||||
class AnalogClock : public Widget
|
||||
{
|
||||
using Time = std::chrono::time_point<std::chrono::system_clock>;
|
||||
|
||||
Time last_time;
|
||||
|
||||
public:
|
||||
static Widget::shared_ptr Create();
|
||||
|
||||
void Update() override;
|
||||
void Render(render::RenderTarget& rt) override;
|
||||
};
|
||||
} // namespace frame::widgets
|
||||
Reference in New Issue
Block a user