add: VirtualDisplay
This commit is contained in:
@@ -4,25 +4,29 @@
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
#include "display/EPD_7in5_V2.hpp"
|
||||
#include "display/Display.hpp"
|
||||
#include "render/RenderTarget.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
constexpr double pi = 3.14159;
|
||||
|
||||
frame::display::EPD_7in5_V2 display{};
|
||||
auto display = frame::display::Create();
|
||||
|
||||
display.Init();
|
||||
if(!display)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
display.Clear(frame::display::Color::WHITE);
|
||||
display->Init();
|
||||
|
||||
frame::render::RenderTarget target(display.getSize());
|
||||
display->Clear(frame::display::Color::WHITE);
|
||||
|
||||
frame::Vector const center = (display.getSize() / 2);
|
||||
frame::render::RenderTarget target(display->getSize());
|
||||
|
||||
frame::Vector const center = (display->getSize() / 2);
|
||||
|
||||
target.DrawPixel({10, 10}, frame::BLACK);
|
||||
target.DrawLine({10, 12}, {100, 12}, frame::BLACK);
|
||||
@@ -52,15 +56,17 @@ int main()
|
||||
target.DrawCircle({151, 151}, 30, frame::WHITE);
|
||||
target.DrawCircle({151, 151}, 20, frame::WHITE);
|
||||
target.DrawCircle({151, 151}, 10, frame::WHITE);
|
||||
target.DrawCircle({151, 151}, 1, frame::WHITE);
|
||||
target.DrawCircle({151, 151}, 1, frame::WHITE);
|
||||
|
||||
target.DrawRect({10, (int)display.getSize().height - 110}, {110, (int)display.getSize().height - 10}, 5);
|
||||
target.DrawRect({10, (int)display->getSize().height - 110},
|
||||
{110, (int)display->getSize().height - 10},
|
||||
5);
|
||||
|
||||
display.Display(target.getImage());
|
||||
display->Display(target.getImage());
|
||||
|
||||
std::this_thread::sleep_for(10s);
|
||||
|
||||
display.Clear(frame::display::Color::WHITE);
|
||||
display->Clear(frame::display::Color::WHITE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user