Initial bindings for console render

This commit is contained in:
Joshua Granick
2014-07-16 12:07:36 -07:00
parent e4c23bbb67
commit c6404e4a86
8 changed files with 244 additions and 7 deletions

View File

@@ -59,17 +59,21 @@ namespace lime {
Image image;
const char *filePath = val_string (path);
#ifdef LIME_PNG
if (PNG::Decode (filePath, &image)) {
return image.Value ();
}
#endif
#ifdef LIME_JPEG
if (JPEG::Decode (filePath, &image)) {
return image.Value ();
}
#endif
return alloc_null ();

View File

@@ -0,0 +1,50 @@
#include "ConsoleApplication.h"
namespace lime {
AutoGCRoot* Application::callback = 0;
double Application::GetTicks () {
return 0;
}
ConsoleApplication::ConsoleApplication () {
KeyEvent keyEvent;
MouseEvent mouseEvent;
RenderEvent renderEvent;
TouchEvent touchEvent;
UpdateEvent updateEvent;
WindowEvent windowEvent;
}
ConsoleApplication::~ConsoleApplication () {
}
int ConsoleApplication::Exec () {
return 0;
}
Application* CreateApplication () {
return new ConsoleApplication ();
}
}

View File

@@ -0,0 +1,41 @@
#ifndef LIME_CONSOLE_APPLICATION_H
#define LIME_CONSOLE_APPLICATION_H
#include <app/Application.h>
#include <app/UpdateEvent.h>
#include <graphics/RenderEvent.h>
#include <ui/KeyEvent.h>
#include <ui/MouseEvent.h>
#include <ui/TouchEvent.h>
#include <ui/WindowEvent.h>
namespace lime {
class ConsoleApplication : public Application {
public:
ConsoleApplication ();
~ConsoleApplication ();
virtual int Exec ();
private:
KeyEvent keyEvent;
MouseEvent mouseEvent;
RenderEvent renderEvent;
TouchEvent touchEvent;
UpdateEvent updateEvent;
WindowEvent windowEvent;
};
}
#endif

View File

@@ -0,0 +1,36 @@
#include "ConsoleWindow.h"
#include "ConsoleRenderer.h"
namespace lime {
ConsoleRenderer::ConsoleRenderer (Window* window) {
currentWindow = window;
}
ConsoleRenderer::~ConsoleRenderer () {
}
void ConsoleRenderer::Flip () {
}
Renderer* CreateRenderer (Window* window) {
return new ConsoleRenderer (window);
}
}

View File

@@ -0,0 +1,26 @@
#ifndef LIME_CONSOLE_RENDERER_H
#define LIME_CONSOLE_RENDERER_H
#include <graphics/Renderer.h>
namespace lime {
class ConsoleRenderer : public Renderer {
public:
ConsoleRenderer (Window* window);
~ConsoleRenderer ();
virtual void Flip ();
};
}
#endif

View File

@@ -0,0 +1,43 @@
#include "ConsoleWindow.h"
namespace lime {
ConsoleWindow::ConsoleWindow (Application* application, int width, int height, int flags, const char* title) {
currentApplication = application;
this->flags = flags;
}
ConsoleWindow::~ConsoleWindow () {
}
void ConsoleWindow::Move (int x, int y) {
}
void ConsoleWindow::Resize (int width, int height) {
}
Window* CreateWindow (Application* application, int width, int height, int flags, const char* title) {
return new ConsoleWindow (application, width, height, flags, title);
}
}

View File

@@ -0,0 +1,27 @@
#ifndef LIME_CONSOLE_WINDOW_H
#define LIME_CONSOLE_WINDOW_H
#include <ui/Window.h>
namespace lime {
class ConsoleWindow : public Window {
public:
ConsoleWindow (Application* application, int width, int height, int flags, const char* title);
~ConsoleWindow ();
virtual void Move (int x, int y);
virtual void Resize (int width, int height);
};
}
#endif