Text-Renderer/main/main.cpp

35 lines
833 B
C++
Raw Normal View History

2019-12-17 12:06:44 +01:00
#include "../src/Bitmap.h"
#include "../src/TextRenderer.h"
#include <internal.hpp>
/**
* @author: Julian Hinxlage
* @since: v0.0.0
* @brief: An image is loaded and used as a font.
*/
2019-10-15 14:00:06 +02:00
int main() {
vkvm::initialize(0);
2019-12-19 10:52:26 +01:00
vkvm::setLogLevel(vkvm::DEBUG);
TextRenderer textRenderer = TextRenderer();
textRenderer.setLeftMargin(1);
textRenderer.setBottomMargin(1);
2019-11-20 12:50:32 +01:00
vkvm::registerEvent(vkvm::EventType::RenderText, [&textRenderer]() {
2019-11-27 12:02:14 +01:00
std::string currentText = vkvm::getText();
2019-12-19 10:52:26 +01:00
vkvm::log(vkvm::DEBUG, currentText);
2019-11-27 12:02:14 +01:00
textRenderer.update(currentText);
vkvm::callEvent(vkvm::EventType::Redraw);
});
2019-12-19 10:52:26 +01:00
vkvm::registerEvent(vkvm::EventType::UpdateControlRegisters, [&textRenderer]() {
textRenderer.updateParameters();
});
while (true) {
}
2019-10-15 14:00:06 +02:00
return 0;
2019-12-17 12:06:44 +01:00
}