mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 12:39:57 +00:00
Add System::createEventLoop() (not yet functional)
This commit is contained in:
parent
f0d8703ad8
commit
9308d290e2
20
src/she/event_loop.h
Normal file
20
src/she/event_loop.h
Normal 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
|
@ -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"
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user