add: Basic Font Rendering
This commit is contained in:
@@ -7,12 +7,15 @@
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
#include "display/Display.hpp"
|
||||
#include "font/Font.hpp"
|
||||
#include "render/RenderTarget.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
constexpr double pi = 3.14159;
|
||||
|
||||
auto font = frame::font::Font::LoadFromFile("Fira Code.json");
|
||||
|
||||
auto display = frame::display::Create();
|
||||
|
||||
if(!display)
|
||||
@@ -62,6 +65,8 @@ int main()
|
||||
{110, (int)display->getSize().height - 10},
|
||||
5);
|
||||
|
||||
target.DrawText("abcdefghijklmnopqrstuvwxyz", {100, 50}, *font, 14);
|
||||
|
||||
display->Display(target.getImage());
|
||||
|
||||
std::this_thread::sleep_for(10s);
|
||||
|
||||
Reference in New Issue
Block a user