added event test
This commit is contained in:
parent
cffd3b5850
commit
7b13dee8c5
@ -1,5 +1,32 @@
|
||||
#include "../src/demo.h"
|
||||
#include <iostream>
|
||||
|
||||
#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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user