Haiku: start implementing the os-dependant stuff

This commit is contained in:
Kostadin Damyanov 2015-05-30 00:57:07 +03:00
parent db459fba1d
commit 8130707e01
2 changed files with 17 additions and 13 deletions

View file

@ -8,7 +8,7 @@ OS_Haiku::OS_Haiku() {
}; };
void OS_Haiku::run() { void OS_Haiku::run() {
ERR_PRINT("run() NOT IMPLEMENTED");
} }
String OS_Haiku::get_name() { String OS_Haiku::get_name() {
@ -16,19 +16,20 @@ String OS_Haiku::get_name() {
} }
int OS_Haiku::get_video_driver_count() const { int OS_Haiku::get_video_driver_count() const {
return 1;
} }
const char* OS_Haiku::get_video_driver_name(int p_driver) const { const char* OS_Haiku::get_video_driver_name(int p_driver) const {
return "GLES2";
} }
OS::VideoMode OS_Haiku::get_default_video_mode() const { OS::VideoMode OS_Haiku::get_default_video_mode() const {
return OS::VideoMode(800, 600, false);
} }
void OS_Haiku::initialize(const VideoMode& p_desired, int p_video_driver, int p_audio_driver) { void OS_Haiku::initialize(const VideoMode& p_desired, int p_video_driver, int p_audio_driver) {
main_loop = NULL; main_loop = NULL;
current_video_mode = p_desired;
#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) #if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
//context_gl = memnew( ContextGL_X11( x11_display, x11_window,current_videomode, false ) ); //context_gl = memnew( ContextGL_X11( x11_display, x11_window,current_videomode, false ) );
@ -42,6 +43,8 @@ void OS_Haiku::initialize(const VideoMode& p_desired, int p_video_driver, int p_
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD)); visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
} }
visual_server->init();
} }
void OS_Haiku::finalize() { void OS_Haiku::finalize() {
@ -76,39 +79,39 @@ void OS_Haiku::delete_main_loop() {
} }
bool OS_Haiku::can_draw() const { bool OS_Haiku::can_draw() const {
ERR_PRINT("can_draw() NOT IMPLEMENTED");
} }
Point2 OS_Haiku::get_mouse_pos() const { Point2 OS_Haiku::get_mouse_pos() const {
ERR_PRINT("get_mouse_pos() NOT IMPLEMENTED");
} }
int OS_Haiku::get_mouse_button_state() const { int OS_Haiku::get_mouse_button_state() const {
ERR_PRINT("get_mouse_button_state() NOT IMPLEMENTED");
} }
void OS_Haiku::set_cursor_shape(CursorShape p_shape) { void OS_Haiku::set_cursor_shape(CursorShape p_shape) {
ERR_PRINT("set_cursor_shape() NOT IMPLEMENTED");
} }
void OS_Haiku::set_window_title(const String& p_title) { void OS_Haiku::set_window_title(const String& p_title) {
ERR_PRINT("set_window_title() NOT IMPLEMENTED");
} }
Size2 OS_Haiku::get_window_size() const { Size2 OS_Haiku::get_window_size() const {
ERR_PRINT("get_window_size() NOT IMPLEMENTED");
} }
void OS_Haiku::set_video_mode(const VideoMode& p_video_mode, int p_screen) { void OS_Haiku::set_video_mode(const VideoMode& p_video_mode, int p_screen) {
ERR_PRINT("set_video_mode() NOT IMPLEMENTED");
} }
OS::VideoMode OS_Haiku::get_video_mode(int p_screen) const { OS::VideoMode OS_Haiku::get_video_mode(int p_screen) const {
return current_video_mode;
} }
void OS_Haiku::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) const { void OS_Haiku::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) const {
ERR_PRINT("get_fullscreen_mode_list() NOT IMPLEMENTED");
} }
String OS_Haiku::get_executable_path() const { String OS_Haiku::get_executable_path() const {

View file

@ -10,6 +10,7 @@ private:
MainLoop* main_loop; MainLoop* main_loop;
Rasterizer* rasterizer; Rasterizer* rasterizer;
VisualServer* visual_server; VisualServer* visual_server;
VideoMode current_video_mode;
virtual void delete_main_loop(); virtual void delete_main_loop();