Haiku: enable building with GLES

This commit is contained in:
Kostadin Damyanov 2015-05-28 03:42:40 +03:00
parent 8dd674d639
commit 513d509783
4 changed files with 49 additions and 11 deletions

View File

@ -49,6 +49,7 @@ def configure(env):
elif (env["target"]=="debug"):
env.Append(CCFLAGS=['-g2', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED'])
#env.Append(CPPFLAGS = ['-DDEBUG_METHODS_ENABLED'])
env.Append(CPPFLAGS = ['-DUNIX_ENABLED'])
#env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
env.Append(CPPFLAGS = ['-DOPENGL_ENABLED', '-DGLEW_ENABLED'])
env.Append(CPPFLAGS = ['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
env.Append(LIBS = ['be', 'z', 'network', 'bnetapi'])

View File

@ -1,3 +1,5 @@
#include "servers/visual/visual_server_raster.h"
#include "drivers/gles2/rasterizer_gles2.h"
#include "os_haiku.h"
OS_Haiku::OS_Haiku() {
@ -5,17 +7,13 @@ OS_Haiku::OS_Haiku() {
};
void OS_Haiku::run() {
}
String OS_Haiku::get_name() {
return "Haiku";
}
void OS_Haiku::delete_main_loop() {
}
int OS_Haiku::get_video_driver_count() const {
}
@ -29,19 +27,51 @@ OS::VideoMode OS_Haiku::get_default_video_mode() const {
}
void OS_Haiku::initialize(const VideoMode& p_desired, int p_video_driver, int p_audio_driver) {
main_loop = NULL;
#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
//context_gl = memnew( ContextGL_X11( x11_display, x11_window,current_videomode, false ) );
//context_gl->initialize();
rasterizer = memnew(RasterizerGLES2);
#endif
visual_server = memnew(VisualServerRaster(rasterizer));
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
}
}
void OS_Haiku::finalize() {
if (main_loop) {
memdelete(main_loop);
}
main_loop = NULL;
visual_server->finish();
memdelete(visual_server);
memdelete(rasterizer);
}
void OS_Haiku::set_main_loop(MainLoop* p_main_loop) {
main_loop = p_main_loop;
// TODO: enable
//input->set_main_loop(p_main_loop);
}
MainLoop* OS_Haiku::get_main_loop() const {
return main_loop;
}
void OS_Haiku::delete_main_loop() {
if (main_loop) {
memdelete(main_loop);
}
main_loop = NULL;
}
bool OS_Haiku::can_draw() const {

View File

@ -2,10 +2,15 @@
#define OS_HAIKU_H
#include "drivers/unix/os_unix.h"
#include "servers/visual_server.h"
#include "servers/visual/rasterizer.h"
class OS_Haiku : public OS_Unix {
private:
MainLoop* main_loop;
Rasterizer* rasterizer;
VisualServer* visual_server;
virtual void delete_main_loop();
protected:

View File

@ -2,3 +2,5 @@
// for ifaddrs.h needed in drivers/unix/ip_unix.cpp
#define _BSD_SOURCE 1
#define GLES2_INCLUDE_H "gl_context/glew.h"