2019-12-17 12:06:44 +01:00
|
|
|
#include "../src/Bitmap.h"
|
|
|
|
#include "../src/TextRenderer.h"
|
|
|
|
#include <internal.hpp>
|
2019-11-19 13:27:18 +01:00
|
|
|
|
2019-10-16 15:44:13 +02:00
|
|
|
/**
|
2019-10-15 16:12:56 +02:00
|
|
|
* @author: Julian Hinxlage
|
|
|
|
* @since: v0.0.0
|
|
|
|
* @brief: An image is loaded and used as a font.
|
|
|
|
*/
|
2019-11-19 13:27:18 +01:00
|
|
|
|
2019-10-15 14:00:06 +02:00
|
|
|
int main() {
|
2019-11-19 13:47:30 +01:00
|
|
|
vkvm::initialize(0);
|
2019-12-19 10:52:26 +01:00
|
|
|
vkvm::setLogLevel(vkvm::DEBUG);
|
2019-12-04 10:18:13 +01:00
|
|
|
|
|
|
|
TextRenderer textRenderer = TextRenderer();
|
2019-11-20 15:51:01 +01:00
|
|
|
textRenderer.setLeftMargin(1);
|
|
|
|
textRenderer.setBottomMargin(1);
|
2019-11-27 15:16:35 +01:00
|
|
|
|
2019-11-20 12:50:32 +01:00
|
|
|
|
2019-12-04 10:18:13 +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-12-04 10:18:13 +01:00
|
|
|
|
2019-10-15 16:12:56 +02:00
|
|
|
}
|
|
|
|
|
2019-10-15 14:00:06 +02:00
|
|
|
return 0;
|
2019-12-17 12:06:44 +01:00
|
|
|
}
|