Initial bindings for console render
This commit is contained in:
@@ -35,16 +35,21 @@
|
||||
<section if="LIME_JPEG">
|
||||
|
||||
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/jpeg/" />
|
||||
<compilerflag value="-DLIME_JPEG" />
|
||||
|
||||
<file name="src/graphics/JPEG.cpp" />
|
||||
|
||||
</section>
|
||||
|
||||
<section if="LIME_FREETYPE">
|
||||
|
||||
|
||||
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/freetype/include" />
|
||||
<compilerflag value="-DLIME_FREETYPE" />
|
||||
|
||||
|
||||
<file name="src/graphics/Font.cpp" />
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<section if="LIME_NEKO">
|
||||
|
||||
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/neko/vm/" />
|
||||
@@ -57,12 +62,16 @@
|
||||
<section if="LIME_OPENAL">
|
||||
|
||||
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/openal/include/" />
|
||||
<compilerflag value="-DLIME_OPENAL" />
|
||||
|
||||
<file name="src/audio/OpenALBindings.cpp" />
|
||||
|
||||
</section>
|
||||
|
||||
<section if="LIME_OPENGL">
|
||||
|
||||
<compilerflag value="-DLIME_OPENGL" />
|
||||
|
||||
<file name="src/graphics/OpenGLBindings.cpp" />
|
||||
|
||||
</section>
|
||||
@@ -71,6 +80,9 @@
|
||||
|
||||
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/png/" />
|
||||
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/zlib/" />
|
||||
<compilerflag value="-DLIME_PNG" />
|
||||
|
||||
<file name="src/graphics/PNG.cpp" />
|
||||
|
||||
</section>
|
||||
|
||||
@@ -81,6 +93,7 @@
|
||||
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include/configs/linux/" if="linux"/>
|
||||
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include/configs/windows/" if="windows"/>
|
||||
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include/configs/mac/" if="mac"/>
|
||||
<compilerflag value="-DLIME_SDL" />
|
||||
|
||||
<file name="src/backend/sdl/SDLApplication.cpp" />
|
||||
<file name="src/backend/sdl/SDLWindow.cpp" />
|
||||
@@ -89,12 +102,9 @@
|
||||
</section>
|
||||
|
||||
<file name="src/system/ios/System.mm" if="ios" />
|
||||
|
||||
|
||||
<file name="src/app/UpdateEvent.cpp" />
|
||||
<file name="src/graphics/Font.cpp" if="LIME_FREETYPE" />
|
||||
<file name="src/graphics/Image.cpp" />
|
||||
<file name="src/graphics/JPEG.cpp" if="LIME_JPEG" />
|
||||
<file name="src/graphics/PNG.cpp" if="LIME_PNG" />
|
||||
<file name="src/graphics/RenderEvent.cpp" />
|
||||
<file name="src/system/System.cpp" />
|
||||
<file name="src/ui/KeyEvent.cpp" />
|
||||
|
||||
@@ -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