Initial bindings for console render
This commit is contained in:
@@ -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 ();
|
||||
|
||||
|
||||
50
project/src/backend/console/ConsoleApplication.cpp
Normal file
50
project/src/backend/console/ConsoleApplication.cpp
Normal 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 ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
41
project/src/backend/console/ConsoleApplication.h
Normal file
41
project/src/backend/console/ConsoleApplication.h
Normal 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
|
||||
36
project/src/backend/console/ConsoleRenderer.cpp
Normal file
36
project/src/backend/console/ConsoleRenderer.cpp
Normal 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
26
project/src/backend/console/ConsoleRenderer.h
Normal file
26
project/src/backend/console/ConsoleRenderer.h
Normal 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
|
||||
43
project/src/backend/console/ConsoleWindow.cpp
Normal file
43
project/src/backend/console/ConsoleWindow.cpp
Normal 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
27
project/src/backend/console/ConsoleWindow.h
Normal file
27
project/src/backend/console/ConsoleWindow.h
Normal 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
|
||||
Reference in New Issue
Block a user