Slight refactor
This commit is contained in:
@@ -1,19 +1,24 @@
|
||||
package lime.app;
|
||||
|
||||
|
||||
import lime.graphics.IRenderEventListener;
|
||||
import lime.graphics.Renderer;
|
||||
import lime.graphics.RenderEvent;
|
||||
import lime.graphics.RenderEventManager;
|
||||
import lime.system.System;
|
||||
import lime.ui.IKeyEventListener;
|
||||
import lime.ui.IMouseEventListener;
|
||||
import lime.ui.ITouchEventListener;
|
||||
import lime.ui.IWindowEventListener;
|
||||
import lime.ui.KeyEventManager;
|
||||
import lime.ui.KeyEvent;
|
||||
import lime.ui.MouseEventManager;
|
||||
import lime.ui.KeyEventManager;
|
||||
import lime.ui.MouseEvent;
|
||||
import lime.ui.TouchEventManager;
|
||||
import lime.ui.MouseEventManager;
|
||||
import lime.ui.TouchEvent;
|
||||
import lime.ui.WindowEventManager;
|
||||
import lime.ui.TouchEventManager;
|
||||
import lime.ui.Window;
|
||||
import lime.ui.WindowEvent;
|
||||
import lime.system.System;
|
||||
import lime.ui.WindowEventManager;
|
||||
|
||||
|
||||
class Application implements IKeyEventListener implements IMouseEventListener implements IRenderEventListener implements ITouchEventListener implements IUpdateEventListener implements IWindowEventListener {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package lime.app;
|
||||
package lime.graphics;
|
||||
|
||||
|
||||
interface IRenderEventListener {
|
||||
@@ -1,4 +1,4 @@
|
||||
package lime.app;
|
||||
package lime.graphics;
|
||||
|
||||
|
||||
class RenderEvent {
|
||||
@@ -1,4 +1,4 @@
|
||||
package lime.app;
|
||||
package lime.graphics;
|
||||
|
||||
|
||||
import lime.system.System;
|
||||
@@ -1,7 +1,8 @@
|
||||
package lime.app;
|
||||
package lime.graphics;
|
||||
|
||||
|
||||
import lime.system.System;
|
||||
import lime.ui.Window;
|
||||
|
||||
|
||||
class Renderer {
|
||||
@@ -36,4 +37,4 @@ class Renderer {
|
||||
#end
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package lime.app;
|
||||
package lime.ui;
|
||||
|
||||
|
||||
import lime.app.Application;
|
||||
import lime.system.System;
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
|
||||
</section>
|
||||
|
||||
<file name="src/app/RenderEvent.cpp" />
|
||||
<file name="src/app/UpdateEvent.cpp" />
|
||||
<file name="src/graphics/RenderEvent.cpp" />
|
||||
<file name="src/ui/KeyEvent.cpp" />
|
||||
<file name="src/ui/MouseEvent.cpp" />
|
||||
<file name="src/ui/TouchEvent.cpp" />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LIME_APP_RENDER_EVENT_H
|
||||
#define LIME_APP_RENDER_EVENT_H
|
||||
#ifndef LIME_GRAPHICS_RENDER_EVENT_H
|
||||
#define LIME_GRAPHICS_RENDER_EVENT_H
|
||||
|
||||
|
||||
#include <hx/CFFI.h>
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef LIME_APP_RENDERER_H
|
||||
#define LIME_APP_RENDERER_H
|
||||
#ifndef LIME_GRAPHICS_RENDERER_H
|
||||
#define LIME_GRAPHICS_RENDERER_H
|
||||
|
||||
|
||||
#include <app/Window.h>
|
||||
#include <ui/Window.h>
|
||||
|
||||
|
||||
namespace lime {
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LIME_APP_WINDOW_H
|
||||
#define LIME_APP_WINDOW_H
|
||||
#ifndef LIME_UI_WINDOW_H
|
||||
#define LIME_UI_WINDOW_H
|
||||
|
||||
|
||||
#include <app/Application.h>
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
#include <hx/CFFI.h>
|
||||
#include <app/Application.h>
|
||||
#include <app/Renderer.h>
|
||||
#include <app/RenderEvent.h>
|
||||
#include <app/UpdateEvent.h>
|
||||
#include <app/Window.h>
|
||||
#include <graphics/Renderer.h>
|
||||
#include <graphics/RenderEvent.h>
|
||||
#include <ui/KeyEvent.h>
|
||||
#include <ui/MouseEvent.h>
|
||||
#include <ui/TouchEvent.h>
|
||||
#include <ui/Window.h>
|
||||
#include <ui/WindowEvent.h>
|
||||
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#include <hx/CFFI.h>
|
||||
#include <app/RenderEvent.h>
|
||||
|
||||
|
||||
namespace lime {
|
||||
|
||||
|
||||
AutoGCRoot* RenderEvent::callback = 0;
|
||||
AutoGCRoot* RenderEvent::eventObject = 0;
|
||||
|
||||
//static int id_type;
|
||||
//static bool init = false;
|
||||
|
||||
|
||||
RenderEvent::RenderEvent () {
|
||||
|
||||
type = RENDER;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void RenderEvent::Dispatch (RenderEvent* event) {
|
||||
|
||||
if (RenderEvent::callback) {
|
||||
|
||||
//if (!init) {
|
||||
|
||||
//id_type = val_id ("type");
|
||||
|
||||
//}
|
||||
|
||||
value object = (RenderEvent::eventObject ? RenderEvent::eventObject->get () : alloc_empty_object ());
|
||||
|
||||
//alloc_field (object, id_type, alloc_int (event->type));
|
||||
|
||||
val_call1 (RenderEvent::callback->get (), object);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#include <SDL.h>
|
||||
#include <app/Application.h>
|
||||
#include <app/RenderEvent.h>
|
||||
#include <app/UpdateEvent.h>
|
||||
#include <graphics/RenderEvent.h>
|
||||
#include <ui/KeyEvent.h>
|
||||
#include <ui/MouseEvent.h>
|
||||
#include <ui/TouchEvent.h>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
#include <SDL.h>
|
||||
#include <app/Renderer.h>
|
||||
#include <graphics/Renderer.h>
|
||||
|
||||
|
||||
namespace lime {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
#include <SDL.h>
|
||||
#include <app/Window.h>
|
||||
#include <ui/Window.h>
|
||||
|
||||
|
||||
namespace lime {
|
||||
|
||||
Reference in New Issue
Block a user