Added protected OnEvent functions for inheritance

This commit is contained in:
Robert 2020-05-16 19:38:57 +02:00
parent 0611493afd
commit 10d19f7f58
6 changed files with 98 additions and 18 deletions

View file

@ -1,2 +1,30 @@
#pragma once
#include "SDLU.hpp"
#include "SDLU.hpp"
#include <iostream>
class MyWindow :
public sdlu::RenderWindow
{
public:
MyWindow(Uint32 width, Uint32 height, const char* title) :
RenderWindow(sdlu::Vector2u(width, height), title, NULL, NULL)
{
// Empty
}
};
void sdlu::RenderWindow::OnCreate()
{
std::cout << "Window was Created!" << std::endl;
}
bool sdlu::RenderWindow::OnResize()
{
std::cout << "Window was Resized!" << std::endl;
return false;
}
void sdlu::RenderWindow::OnClose()
{
std::cout << "Window was Closed!" << std::endl;
}