Add System::createEventLoop() (not yet functional)

This commit is contained in:
David Capello 2012-09-13 20:13:50 -03:00
parent f0d8703ad8
commit 9308d290e2
4 changed files with 37 additions and 0 deletions

20
src/she/event_loop.h Normal file
View File

@ -0,0 +1,20 @@
// SHE library
// Copyright (C) 2012 David Capello
//
// This source file is ditributed under a BSD-like license, please
// read LICENSE.txt for more information.
#ifndef SHE_EVENT_LOOP_H_INCLUDED
#define SHE_EVENT_LOOP_H_INCLUDED
namespace she {
class EventLoop {
public:
virtual ~EventLoop() { }
virtual void dispose() = 0;
};
} // namespace she
#endif

View File

@ -8,6 +8,7 @@
#define SHE_H_INCLUDED
#include "she/display.h"
#include "she/event_loop.h"
#include "she/locked_surface.h"
#include "she/scoped_handle.h"
#include "she/scoped_surface_lock.h"

View File

@ -258,6 +258,16 @@ private:
int m_scale;
};
class Alleg4EventLoop : public EventLoop {
public:
Alleg4EventLoop() {
}
void dispose() {
delete this;
}
};
class Alleg4System : public System {
public:
Alleg4System() {
@ -295,6 +305,10 @@ public:
Alleg4Surface::AutoDestroy);
}
EventLoop* createEventLoop() {
return new Alleg4EventLoop();
}
};
static System* g_instance;

View File

@ -14,6 +14,7 @@ namespace she {
class Surface;
class Display;
class EventLoop;
class DisplayCreationException : std::runtime_error {
public:
@ -29,6 +30,7 @@ namespace she {
virtual Display* createDisplay(int width, int height, int scale) = 0;
virtual Surface* createSurface(int width, int height) = 0;
virtual Surface* createSurfaceFromNativeHandle(void* nativeHandle) = 0;
virtual EventLoop* createEventLoop() = 0;
};
System* CreateSystem();