From 7b13dee8c59bbe5f02ec428d4abc358fac3a48d8 Mon Sep 17 00:00:00 2001 From: Julian Hinxlage Date: Tue, 19 Nov 2019 12:15:20 +0100 Subject: [PATCH] added event test --- main/main.cpp | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 53edc26..00dd65a 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1,5 +1,32 @@ -#include "../src/demo.h" +#include + +#include "vkvm.hpp" +#include "internal.hpp" int main() { - return test(); + vkvm::initialize(0); + + vkvm::registerEvent(vkvm::EventType::Redraw, [](){ + vkvm::log(vkvm::INFO, "redraw event callback"); + }); + + vkvm::registerEvent(vkvm::EventType::Timer, [](){ + vkvm::log(vkvm::INFO, "timer event callback"); + }); + + std::string input; + while(input != "exit"){ + std::cout << "type r for redraw and t for timer (exit to exit)" << std::endl; + std::cout << "> "; + std::getline(std::cin, input); + + if(input == "r"){ + vkvm::callEvent(vkvm::Redraw); + } + if(input == "t"){ + vkvm::callEvent(vkvm::Timer); + } + } + + return 0; } \ No newline at end of file