Input
This commit is contained in:
@@ -8,11 +8,12 @@
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
Display::Display(void) :
|
||||
Display::Display(Engine &engine) :
|
||||
#if DAWN_SDL2
|
||||
glContext(nullptr),
|
||||
window(nullptr)
|
||||
window(nullptr),
|
||||
#endif
|
||||
engine(engine)
|
||||
{
|
||||
#if DAWN_SDL2
|
||||
uint32_t flags = SDL_INIT_VIDEO;
|
||||
@@ -72,14 +73,14 @@ void Display::update(void) {
|
||||
while(SDL_PollEvent(&event)) {
|
||||
switch(event.type) {
|
||||
case SDL_QUIT: {
|
||||
Engine::getInstance()->console.exec("exit");
|
||||
engine.console.exec("exit");
|
||||
break;
|
||||
}
|
||||
|
||||
case SDL_WINDOWEVENT: {
|
||||
switch(event.window.event) {
|
||||
case SDL_WINDOWEVENT_CLOSE: {
|
||||
Engine::getInstance()->console.exec("exit");
|
||||
engine.console.exec("exit");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,11 @@
|
||||
#include "dawn.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
struct Engine;
|
||||
|
||||
struct Display {
|
||||
private:
|
||||
Engine &engine;
|
||||
#if DAWN_SDL2
|
||||
SDL_Window* window;
|
||||
SDL_GLContext glContext;
|
||||
@@ -20,8 +23,10 @@ namespace Dawn {
|
||||
|
||||
/**
|
||||
* Display constructor
|
||||
*
|
||||
* @param engine The engine instance.
|
||||
*/
|
||||
Display(void);
|
||||
Display(Engine &engine);
|
||||
|
||||
/**
|
||||
* Update the display (swap buffers, etc.)
|
||||
|
||||
Reference in New Issue
Block a user