summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorKostadin Damyanov <maxmight@gmail.com>2015-05-28 03:42:40 +0300
committerKostadin Damyanov <maxmight@gmail.com>2015-05-28 03:42:40 +0300
commit513d509783678d1a6c9fd47d7e2e822d886f2c84 (patch)
tree053db1bf8479cd042c9280c08068d801244b8438 /platform
parent8dd674d6399b5543f589d3b770c97209e3e31c3b (diff)
Haiku: enable building with GLES
Diffstat (limited to 'platform')
-rw-r--r--platform/haiku/detect.py5
-rw-r--r--platform/haiku/os_haiku.cpp46
-rw-r--r--platform/haiku/os_haiku.h7
-rw-r--r--platform/haiku/platform_config.h2
4 files changed, 49 insertions, 11 deletions
diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py
index 0c4d091824..bb123c6aa0 100644
--- a/platform/haiku/detect.py
+++ b/platform/haiku/detect.py
@@ -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'])
diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp
index 7c207f265b..103b1ac748 100644
--- a/platform/haiku/os_haiku.cpp
+++ b/platform/haiku/os_haiku.cpp
@@ -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 {
diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h
index 8740a738cc..67faff5e96 100644
--- a/platform/haiku/os_haiku.h
+++ b/platform/haiku/os_haiku.h
@@ -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:
diff --git a/platform/haiku/platform_config.h b/platform/haiku/platform_config.h
index d37873ca8b..b63b600fc1 100644
--- a/platform/haiku/platform_config.h
+++ b/platform/haiku/platform_config.h
@@ -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"