mirror of
https://github.com/godotengine/godot-platform-haiku.git
synced 2026-01-04 06:09:42 +03:00
Compare commits
19 Commits
master
...
2.1.5-stab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bb54b5142 | ||
|
|
817b310748 | ||
|
|
20c12eef64 | ||
|
|
5441c15a33 | ||
|
|
13e0723521 | ||
|
|
4160f467c4 | ||
|
|
a78dd556f9 | ||
|
|
80801978a5 | ||
|
|
9b4ed82558 | ||
|
|
99d0aa0b8e | ||
|
|
1b389a8e4c | ||
|
|
f07bb36f97 | ||
|
|
289fc15e57 | ||
|
|
92806c4c08 | ||
|
|
8824d6f4f3 | ||
|
|
a8658241a1 | ||
|
|
2325ef4fa4 | ||
|
|
012500bf43 | ||
|
|
64d247674c |
29
SCsub
29
SCsub
@@ -1,25 +1,28 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
Import('env')
|
Import('env')
|
||||||
|
|
||||||
common_haiku = [
|
common_haiku = [
|
||||||
'os_haiku.cpp',
|
'os_haiku.cpp',
|
||||||
'context_gl_haiku.cpp',
|
'context_gl_haiku.cpp',
|
||||||
'haiku_application.cpp',
|
'haiku_application.cpp',
|
||||||
'haiku_direct_window.cpp',
|
'haiku_direct_window.cpp',
|
||||||
'haiku_gl_view.cpp',
|
'haiku_gl_view.cpp',
|
||||||
'key_mapping_haiku.cpp',
|
'key_mapping_haiku.cpp',
|
||||||
'audio_driver_media_kit.cpp'
|
'audio_driver_media_kit.cpp'
|
||||||
]
|
]
|
||||||
|
|
||||||
target = env.Program(
|
target = env.add_program(
|
||||||
'#bin/godot',
|
'#bin/godot',
|
||||||
['godot_haiku.cpp'] + common_haiku
|
['godot_haiku.cpp'] + common_haiku
|
||||||
)
|
)
|
||||||
|
|
||||||
command = env.Command('#bin/godot.rsrc', '#platform/haiku/godot.rdef',
|
command = env.Command('#bin/godot.rsrc', '#platform/haiku/godot.rdef',
|
||||||
['rc -o $TARGET $SOURCE'])
|
['rc -o $TARGET $SOURCE'])
|
||||||
|
|
||||||
def addResourcesAction(target = None, source = None, env = None):
|
|
||||||
return env.Execute('xres -o ' + File(target)[0].path + ' bin/godot.rsrc')
|
def addResourcesAction(target=None, source=None, env=None):
|
||||||
|
return env.Execute('xres -o ' + File(target)[0].path + ' bin/godot.rsrc')
|
||||||
|
|
||||||
env.AddPostAction(target, addResourcesAction)
|
env.AddPostAction(target, addResourcesAction)
|
||||||
env.Depends(target, command)
|
env.Depends(target, command)
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -32,7 +33,7 @@
|
|||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
int32_t* AudioDriverMediaKit::samples_in = NULL;
|
int32_t *AudioDriverMediaKit::samples_in = NULL;
|
||||||
|
|
||||||
Error AudioDriverMediaKit::init() {
|
Error AudioDriverMediaKit::init() {
|
||||||
active = false;
|
active = false;
|
||||||
@@ -42,7 +43,7 @@ Error AudioDriverMediaKit::init() {
|
|||||||
channels = 2;
|
channels = 2;
|
||||||
|
|
||||||
int latency = GLOBAL_DEF("audio/output_latency", 25);
|
int latency = GLOBAL_DEF("audio/output_latency", 25);
|
||||||
buffer_size = nearest_power_of_2(latency * mix_rate / 1000);
|
buffer_size = closest_power_of_2(latency * mix_rate / 1000);
|
||||||
samples_in = memnew_arr(int32_t, buffer_size * channels);
|
samples_in = memnew_arr(int32_t, buffer_size * channels);
|
||||||
|
|
||||||
media_raw_audio_format format;
|
media_raw_audio_format format;
|
||||||
@@ -54,12 +55,11 @@ Error AudioDriverMediaKit::init() {
|
|||||||
format.buffer_size = buffer_size * sizeof(int32_t) * channels;
|
format.buffer_size = buffer_size * sizeof(int32_t) * channels;
|
||||||
|
|
||||||
player = new BSoundPlayer(
|
player = new BSoundPlayer(
|
||||||
&format,
|
&format,
|
||||||
"godot_sound_server",
|
"godot_sound_server",
|
||||||
AudioDriverMediaKit::PlayBuffer,
|
AudioDriverMediaKit::PlayBuffer,
|
||||||
NULL,
|
NULL,
|
||||||
this
|
this);
|
||||||
);
|
|
||||||
|
|
||||||
if (player->InitCheck() != B_OK) {
|
if (player->InitCheck() != B_OK) {
|
||||||
fprintf(stderr, "MediaKit ERR: can not create a BSoundPlayer instance\n");
|
fprintf(stderr, "MediaKit ERR: can not create a BSoundPlayer instance\n");
|
||||||
@@ -72,9 +72,9 @@ Error AudioDriverMediaKit::init() {
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioDriverMediaKit::PlayBuffer(void* cookie, void* buffer, size_t size, const media_raw_audio_format& format) {
|
void AudioDriverMediaKit::PlayBuffer(void *cookie, void *buffer, size_t size, const media_raw_audio_format &format) {
|
||||||
AudioDriverMediaKit* ad = (AudioDriverMediaKit*) cookie;
|
AudioDriverMediaKit *ad = (AudioDriverMediaKit *)cookie;
|
||||||
int32_t* buf = (int32_t*) buffer;
|
int32_t *buf = (int32_t *)buffer;
|
||||||
|
|
||||||
if (!ad->active) {
|
if (!ad->active) {
|
||||||
for (unsigned int i = 0; i < ad->buffer_size * ad->channels; i++) {
|
for (unsigned int i = 0; i < ad->buffer_size * ad->channels; i++) {
|
||||||
@@ -136,7 +136,6 @@ AudioDriverMediaKit::AudioDriverMediaKit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AudioDriverMediaKit::~AudioDriverMediaKit() {
|
AudioDriverMediaKit::~AudioDriverMediaKit() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -30,19 +31,19 @@
|
|||||||
|
|
||||||
#ifdef MEDIA_KIT_ENABLED
|
#ifdef MEDIA_KIT_ENABLED
|
||||||
|
|
||||||
#include "core/os/thread.h"
|
|
||||||
#include "core/os/mutex.h"
|
#include "core/os/mutex.h"
|
||||||
|
#include "core/os/thread.h"
|
||||||
|
|
||||||
#include <kernel/image.h> // needed for image_id
|
|
||||||
#include <SoundPlayer.h>
|
#include <SoundPlayer.h>
|
||||||
|
#include <kernel/image.h> // needed for image_id
|
||||||
|
|
||||||
class AudioDriverMediaKit : public AudioDriverSW {
|
class AudioDriverMediaKit : public AudioDriverSW {
|
||||||
Mutex* mutex;
|
Mutex *mutex;
|
||||||
|
|
||||||
BSoundPlayer* player;
|
BSoundPlayer *player;
|
||||||
static int32_t* samples_in;
|
static int32_t *samples_in;
|
||||||
|
|
||||||
static void PlayBuffer(void* cookie, void* buffer, size_t size, const media_raw_audio_format& format);
|
static void PlayBuffer(void *cookie, void *buffer, size_t size, const media_raw_audio_format &format);
|
||||||
|
|
||||||
unsigned int mix_rate;
|
unsigned int mix_rate;
|
||||||
OutputFormat output_format;
|
OutputFormat output_format;
|
||||||
@@ -52,8 +53,7 @@ class AudioDriverMediaKit : public AudioDriverSW {
|
|||||||
bool active;
|
bool active;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
const char *get_name() const {
|
||||||
const char* get_name() const {
|
|
||||||
return "MediaKit";
|
return "MediaKit";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -30,12 +31,12 @@
|
|||||||
|
|
||||||
#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
|
#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
|
||||||
|
|
||||||
ContextGL_Haiku::ContextGL_Haiku(HaikuDirectWindow* p_window) {
|
ContextGL_Haiku::ContextGL_Haiku(HaikuDirectWindow *p_window) {
|
||||||
window = p_window;
|
window = p_window;
|
||||||
|
|
||||||
uint32 type = BGL_RGB | BGL_DOUBLE | BGL_DEPTH;
|
uint32 type = BGL_RGB | BGL_DOUBLE | BGL_DEPTH;
|
||||||
view = new HaikuGLView(window->Bounds(), type);
|
view = new HaikuGLView(window->Bounds(), type);
|
||||||
|
|
||||||
use_vsync = false;
|
use_vsync = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -38,13 +39,13 @@
|
|||||||
|
|
||||||
class ContextGL_Haiku : public ContextGL {
|
class ContextGL_Haiku : public ContextGL {
|
||||||
private:
|
private:
|
||||||
HaikuGLView* view;
|
HaikuGLView *view;
|
||||||
HaikuDirectWindow* window;
|
HaikuDirectWindow *window;
|
||||||
|
|
||||||
bool use_vsync;
|
bool use_vsync;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ContextGL_Haiku(HaikuDirectWindow* p_window);
|
ContextGL_Haiku(HaikuDirectWindow *p_window);
|
||||||
~ContextGL_Haiku();
|
~ContextGL_Haiku();
|
||||||
|
|
||||||
virtual Error initialize();
|
virtual Error initialize();
|
||||||
@@ -53,7 +54,7 @@ public:
|
|||||||
virtual void swap_buffers();
|
virtual void swap_buffers();
|
||||||
virtual int get_window_width();
|
virtual int get_window_width();
|
||||||
virtual int get_window_height();
|
virtual int get_window_height();
|
||||||
|
|
||||||
virtual void set_use_vsync(bool p_use);
|
virtual void set_use_vsync(bool p_use);
|
||||||
virtual bool is_using_vsync() const;
|
virtual bool is_using_vsync() const;
|
||||||
};
|
};
|
||||||
|
|||||||
86
detect.py
86
detect.py
@@ -1,63 +1,67 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def is_active():
|
def is_active():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def get_name():
|
def get_name():
|
||||||
return "Haiku"
|
return "Haiku"
|
||||||
|
|
||||||
|
|
||||||
def can_build():
|
def can_build():
|
||||||
if (os.name != "posix"):
|
if (os.name != "posix"):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if (sys.platform == "darwin"):
|
if (sys.platform == "darwin"):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
def get_opts():
|
def get_opts():
|
||||||
return [
|
return [
|
||||||
('debug_release', 'Add debug symbols to release version','no')
|
('debug_release', 'Add debug symbols to release version', 'no')
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def get_flags():
|
def get_flags():
|
||||||
return [
|
return [
|
||||||
('builtin_zlib', 'no'),
|
]
|
||||||
('glew', 'yes'),
|
|
||||||
]
|
|
||||||
|
|
||||||
def configure(env):
|
def configure(env):
|
||||||
is64 = sys.maxsize > 2**32
|
is64 = sys.maxsize > 2**32
|
||||||
|
|
||||||
if (env["bits"]=="default"):
|
if (env["bits"] == "default"):
|
||||||
if (is64):
|
if (is64):
|
||||||
env["bits"]="64"
|
env["bits"] = "64"
|
||||||
else:
|
else:
|
||||||
env["bits"]="32"
|
env["bits"] = "32"
|
||||||
|
|
||||||
env.Append(CPPPATH = ['#platform/haiku'])
|
env.Append(CPPPATH=['#platform/haiku'])
|
||||||
|
|
||||||
env["CC"] = "gcc-x86"
|
env["CC"] = "gcc-x86"
|
||||||
env["CXX"] = "g++-x86"
|
env["CXX"] = "g++-x86"
|
||||||
|
|
||||||
if (env["target"]=="release"):
|
if (env["target"] == "release"):
|
||||||
if (env["debug_release"]=="yes"):
|
if (env["debug_release"] == "yes"):
|
||||||
env.Append(CCFLAGS=['-g2'])
|
env.Append(CCFLAGS=['-g2'])
|
||||||
else:
|
else:
|
||||||
env.Append(CCFLAGS=['-O3','-ffast-math'])
|
env.Append(CCFLAGS=['-O3', '-ffast-math'])
|
||||||
elif (env["target"]=="release_debug"):
|
elif (env["target"] == "release_debug"):
|
||||||
env.Append(CCFLAGS=['-O2','-ffast-math','-DDEBUG_ENABLED'])
|
env.Append(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
|
||||||
elif (env["target"]=="debug"):
|
elif (env["target"] == "debug"):
|
||||||
env.Append(CCFLAGS=['-g2', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED'])
|
env.Append(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
|
||||||
|
|
||||||
#env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
|
# env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
|
||||||
env.Append(CPPFLAGS = ['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np
|
env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np
|
||||||
env.Append(CPPFLAGS = ['-DOPENGL_ENABLED', '-DMEDIA_KIT_ENABLED'])
|
env.Append(CPPFLAGS=['-DOPENGL_ENABLED', '-DMEDIA_KIT_ENABLED'])
|
||||||
env.Append(CPPFLAGS = ['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
|
env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
|
||||||
env.Append(LIBS = ['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL'])
|
env.Append(LIBS=['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL'])
|
||||||
|
|
||||||
import methods
|
import methods
|
||||||
env.Append(BUILDERS = {'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl')})
|
env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.gen.h', src_suffix='.glsl')})
|
||||||
env.Append(BUILDERS = {'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl')})
|
env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.gen.h', src_suffix='.glsl')})
|
||||||
env.Append(BUILDERS = {'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl')})
|
env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.gen.h', src_suffix='.glsl')})
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -29,10 +30,10 @@
|
|||||||
#include "main/main.h"
|
#include "main/main.h"
|
||||||
#include "os_haiku.h"
|
#include "os_haiku.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
OS_Haiku os;
|
OS_Haiku os;
|
||||||
|
|
||||||
Error error = Main::setup(argv[0], argc-1, &argv[1]);
|
Error error = Main::setup(argv[0], argc - 1, &argv[1]);
|
||||||
if (error != OK) {
|
if (error != OK) {
|
||||||
return 255;
|
return 255;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -28,8 +29,6 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
#include "haiku_application.h"
|
#include "haiku_application.h"
|
||||||
|
|
||||||
HaikuApplication::HaikuApplication()
|
HaikuApplication::HaikuApplication() :
|
||||||
: BApplication("application/x-vnd.godot")
|
BApplication("application/x-vnd.godot") {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -29,13 +30,12 @@
|
|||||||
#ifndef HAIKU_APPLICATION_H
|
#ifndef HAIKU_APPLICATION_H
|
||||||
#define HAIKU_APPLICATION_H
|
#define HAIKU_APPLICATION_H
|
||||||
|
|
||||||
#include <kernel/image.h> // needed for image_id
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <kernel/image.h> // needed for image_id
|
||||||
|
|
||||||
class HaikuApplication : public BApplication
|
class HaikuApplication : public BApplication {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
HaikuApplication();
|
HaikuApplication();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -28,43 +29,41 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
#include <UnicodeChar.h>
|
#include <UnicodeChar.h>
|
||||||
|
|
||||||
#include "main/main.h"
|
|
||||||
#include "os/keyboard.h"
|
|
||||||
#include "haiku_direct_window.h"
|
#include "haiku_direct_window.h"
|
||||||
#include "key_mapping_haiku.h"
|
#include "key_mapping_haiku.h"
|
||||||
|
#include "main/main.h"
|
||||||
|
#include "os/keyboard.h"
|
||||||
|
|
||||||
HaikuDirectWindow::HaikuDirectWindow(BRect p_frame)
|
HaikuDirectWindow::HaikuDirectWindow(BRect p_frame) :
|
||||||
: BDirectWindow(p_frame, "Godot", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE)
|
BDirectWindow(p_frame, "Godot", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE) {
|
||||||
{
|
|
||||||
last_mouse_pos_valid = false;
|
last_mouse_pos_valid = false;
|
||||||
last_buttons_state = 0;
|
last_buttons_state = 0;
|
||||||
last_button_mask = 0;
|
last_button_mask = 0;
|
||||||
last_key_modifier_state = 0;
|
last_key_modifier_state = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HaikuDirectWindow::~HaikuDirectWindow() {
|
HaikuDirectWindow::~HaikuDirectWindow() {
|
||||||
delete update_runner;
|
delete update_runner;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::SetHaikuGLView(HaikuGLView* p_view) {
|
void HaikuDirectWindow::SetHaikuGLView(HaikuGLView *p_view) {
|
||||||
view = p_view;
|
view = p_view;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::StartMessageRunner() {
|
void HaikuDirectWindow::StartMessageRunner() {
|
||||||
update_runner = new BMessageRunner(BMessenger(this),
|
update_runner = new BMessageRunner(BMessenger(this),
|
||||||
new BMessage(REDRAW_MSG), 1000000/30 /* 30 fps */);
|
new BMessage(REDRAW_MSG), 1000000 / 30 /* 30 fps */);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::StopMessageRunner() {
|
void HaikuDirectWindow::StopMessageRunner() {
|
||||||
delete update_runner;
|
delete update_runner;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::SetInput(InputDefault* p_input) {
|
void HaikuDirectWindow::SetInput(InputDefault *p_input) {
|
||||||
input = p_input;
|
input = p_input;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::SetMainLoop(MainLoop* p_main_loop) {
|
void HaikuDirectWindow::SetMainLoop(MainLoop *p_main_loop) {
|
||||||
main_loop = p_main_loop;
|
main_loop = p_main_loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,12 +72,12 @@ bool HaikuDirectWindow::QuitRequested() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::DirectConnected(direct_buffer_info* info) {
|
void HaikuDirectWindow::DirectConnected(direct_buffer_info *info) {
|
||||||
view->DirectConnected(info);
|
view->DirectConnected(info);
|
||||||
view->EnableDirectMode(true);
|
view->EnableDirectMode(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::MessageReceived(BMessage* message) {
|
void HaikuDirectWindow::MessageReceived(BMessage *message) {
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case REDRAW_MSG:
|
case REDRAW_MSG:
|
||||||
if (Main::iteration() == true) {
|
if (Main::iteration() == true) {
|
||||||
@@ -92,7 +91,7 @@ void HaikuDirectWindow::MessageReceived(BMessage* message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::DispatchMessage(BMessage* message, BHandler* handler) {
|
void HaikuDirectWindow::DispatchMessage(BMessage *message, BHandler *handler) {
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case B_MOUSE_DOWN:
|
case B_MOUSE_DOWN:
|
||||||
case B_MOUSE_UP:
|
case B_MOUSE_UP:
|
||||||
@@ -133,7 +132,7 @@ void HaikuDirectWindow::DispatchMessage(BMessage* message, BHandler* handler) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::HandleMouseButton(BMessage* message) {
|
void HaikuDirectWindow::HandleMouseButton(BMessage *message) {
|
||||||
BPoint where;
|
BPoint where;
|
||||||
if (message->FindPoint("where", &where) != B_OK) {
|
if (message->FindPoint("where", &where) != B_OK) {
|
||||||
return;
|
return;
|
||||||
@@ -183,14 +182,14 @@ void HaikuDirectWindow::HandleMouseButton(BMessage* message) {
|
|||||||
int32 clicks = message->FindInt32("clicks");
|
int32 clicks = message->FindInt32("clicks");
|
||||||
|
|
||||||
if (clicks > 1) {
|
if (clicks > 1) {
|
||||||
mouse_event.mouse_button.doubleclick=true;
|
mouse_event.mouse_button.doubleclick = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input->parse_input_event(mouse_event);
|
input->parse_input_event(mouse_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::HandleMouseMoved(BMessage* message) {
|
void HaikuDirectWindow::HandleMouseMoved(BMessage *message) {
|
||||||
BPoint where;
|
BPoint where;
|
||||||
if (message->FindPoint("where", &where) != B_OK) {
|
if (message->FindPoint("where", &where) != B_OK) {
|
||||||
return;
|
return;
|
||||||
@@ -230,7 +229,7 @@ void HaikuDirectWindow::HandleMouseMoved(BMessage* message) {
|
|||||||
input->parse_input_event(motion_event);
|
input->parse_input_event(motion_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::HandleMouseWheelChanged(BMessage* message) {
|
void HaikuDirectWindow::HandleMouseWheelChanged(BMessage *message) {
|
||||||
float wheel_delta_y = 0;
|
float wheel_delta_y = 0;
|
||||||
if (message->FindFloat("be:wheel_delta_y", &wheel_delta_y) != B_OK) {
|
if (message->FindFloat("be:wheel_delta_y", &wheel_delta_y) != B_OK) {
|
||||||
return;
|
return;
|
||||||
@@ -257,7 +256,7 @@ void HaikuDirectWindow::HandleMouseWheelChanged(BMessage* message) {
|
|||||||
input->parse_input_event(mouse_event);
|
input->parse_input_event(mouse_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::HandleKeyboardEvent(BMessage* message) {
|
void HaikuDirectWindow::HandleKeyboardEvent(BMessage *message) {
|
||||||
int32 raw_char = 0;
|
int32 raw_char = 0;
|
||||||
int32 key = 0;
|
int32 key = 0;
|
||||||
int32 modifiers = 0;
|
int32 modifiers = 0;
|
||||||
@@ -284,21 +283,21 @@ void HaikuDirectWindow::HandleKeyboardEvent(BMessage* message) {
|
|||||||
event.key.echo = message->HasInt32("be:key_repeat");
|
event.key.echo = message->HasInt32("be:key_repeat");
|
||||||
event.key.unicode = 0;
|
event.key.unicode = 0;
|
||||||
|
|
||||||
const char* bytes = NULL;
|
const char *bytes = NULL;
|
||||||
if (message->FindString("bytes", &bytes) == B_OK) {
|
if (message->FindString("bytes", &bytes) == B_OK) {
|
||||||
event.key.unicode = BUnicodeChar::FromUTF8(&bytes);
|
event.key.unicode = BUnicodeChar::FromUTF8(&bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
//make it consistent accross platforms.
|
//make it consistent accross platforms.
|
||||||
if (event.key.scancode==KEY_BACKTAB) {
|
if (event.key.scancode == KEY_BACKTAB) {
|
||||||
event.key.scancode=KEY_TAB;
|
event.key.scancode = KEY_TAB;
|
||||||
event.key.mod.shift=true;
|
event.key.mod.shift = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
input->parse_input_event(event);
|
input->parse_input_event(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::HandleKeyboardModifierEvent(BMessage* message) {
|
void HaikuDirectWindow::HandleKeyboardModifierEvent(BMessage *message) {
|
||||||
int32 old_modifiers = 0;
|
int32 old_modifiers = 0;
|
||||||
int32 modifiers = 0;
|
int32 modifiers = 0;
|
||||||
|
|
||||||
@@ -325,7 +324,7 @@ void HaikuDirectWindow::HandleKeyboardModifierEvent(BMessage* message) {
|
|||||||
input->parse_input_event(event);
|
input->parse_input_event(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuDirectWindow::HandleWindowResized(BMessage* message) {
|
void HaikuDirectWindow::HandleWindowResized(BMessage *message) {
|
||||||
int32 width = 0;
|
int32 width = 0;
|
||||||
int32 height = 0;
|
int32 height = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -29,8 +30,8 @@
|
|||||||
#ifndef HAIKU_DIRECT_WINDOW_H
|
#ifndef HAIKU_DIRECT_WINDOW_H
|
||||||
#define HAIKU_DIRECT_WINDOW_H
|
#define HAIKU_DIRECT_WINDOW_H
|
||||||
|
|
||||||
#include <kernel/image.h> // needed for image_id
|
|
||||||
#include <DirectWindow.h>
|
#include <DirectWindow.h>
|
||||||
|
#include <kernel/image.h> // needed for image_id
|
||||||
|
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
#include "main/input_default.h"
|
#include "main/input_default.h"
|
||||||
@@ -41,8 +42,7 @@
|
|||||||
#define LOCKGL_MSG 'glck'
|
#define LOCKGL_MSG 'glck'
|
||||||
#define UNLOCKGL_MSG 'ulck'
|
#define UNLOCKGL_MSG 'ulck'
|
||||||
|
|
||||||
class HaikuDirectWindow : public BDirectWindow
|
class HaikuDirectWindow : public BDirectWindow {
|
||||||
{
|
|
||||||
private:
|
private:
|
||||||
unsigned int event_id;
|
unsigned int event_id;
|
||||||
Point2i last_mouse_position;
|
Point2i last_mouse_position;
|
||||||
@@ -50,19 +50,19 @@ private:
|
|||||||
uint32 last_buttons_state;
|
uint32 last_buttons_state;
|
||||||
uint32 last_key_modifier_state;
|
uint32 last_key_modifier_state;
|
||||||
int last_button_mask;
|
int last_button_mask;
|
||||||
OS::VideoMode* current_video_mode;
|
OS::VideoMode *current_video_mode;
|
||||||
|
|
||||||
MainLoop* main_loop;
|
MainLoop *main_loop;
|
||||||
InputDefault* input;
|
InputDefault *input;
|
||||||
HaikuGLView* view;
|
HaikuGLView *view;
|
||||||
BMessageRunner* update_runner;
|
BMessageRunner *update_runner;
|
||||||
|
|
||||||
void HandleMouseButton(BMessage* message);
|
void HandleMouseButton(BMessage *message);
|
||||||
void HandleMouseMoved(BMessage* message);
|
void HandleMouseMoved(BMessage *message);
|
||||||
void HandleMouseWheelChanged(BMessage* message);
|
void HandleMouseWheelChanged(BMessage *message);
|
||||||
void HandleWindowResized(BMessage* message);
|
void HandleWindowResized(BMessage *message);
|
||||||
void HandleKeyboardEvent(BMessage* message);
|
void HandleKeyboardEvent(BMessage *message);
|
||||||
void HandleKeyboardModifierEvent(BMessage* message);
|
void HandleKeyboardModifierEvent(BMessage *message);
|
||||||
inline InputModifierState GetKeyModifierState(uint32 p_state);
|
inline InputModifierState GetKeyModifierState(uint32 p_state);
|
||||||
inline int GetMouseButtonState(uint32 p_state);
|
inline int GetMouseButtonState(uint32 p_state);
|
||||||
|
|
||||||
@@ -70,16 +70,16 @@ public:
|
|||||||
HaikuDirectWindow(BRect p_frame);
|
HaikuDirectWindow(BRect p_frame);
|
||||||
~HaikuDirectWindow();
|
~HaikuDirectWindow();
|
||||||
|
|
||||||
void SetHaikuGLView(HaikuGLView* p_view);
|
void SetHaikuGLView(HaikuGLView *p_view);
|
||||||
void StartMessageRunner();
|
void StartMessageRunner();
|
||||||
void StopMessageRunner();
|
void StopMessageRunner();
|
||||||
void SetInput(InputDefault* p_input);
|
void SetInput(InputDefault *p_input);
|
||||||
void SetMainLoop(MainLoop* p_main_loop);
|
void SetMainLoop(MainLoop *p_main_loop);
|
||||||
inline void SetVideoMode(OS::VideoMode* video_mode) { current_video_mode = video_mode; };
|
inline void SetVideoMode(OS::VideoMode *video_mode) { current_video_mode = video_mode; };
|
||||||
virtual bool QuitRequested();
|
virtual bool QuitRequested();
|
||||||
virtual void DirectConnected(direct_buffer_info* info);
|
virtual void DirectConnected(direct_buffer_info *info);
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
virtual void DispatchMessage(BMessage* message, BHandler* handler);
|
virtual void DispatchMessage(BMessage *message, BHandler *handler);
|
||||||
|
|
||||||
inline Point2i GetLastMousePosition() { return last_mouse_position; };
|
inline Point2i GetLastMousePosition() { return last_mouse_position; };
|
||||||
inline int GetLastButtonMask() { return last_button_mask; };
|
inline int GetLastButtonMask() { return last_button_mask; };
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -26,12 +27,11 @@
|
|||||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
#include "main/main.h"
|
|
||||||
#include "haiku_gl_view.h"
|
#include "haiku_gl_view.h"
|
||||||
|
#include "main/main.h"
|
||||||
|
|
||||||
HaikuGLView::HaikuGLView(BRect frame, uint32 type)
|
HaikuGLView::HaikuGLView(BRect frame, uint32 type) :
|
||||||
: BGLView(frame, "GodotGLView", B_FOLLOW_ALL_SIDES, 0, type)
|
BGLView(frame, "GodotGLView", B_FOLLOW_ALL_SIDES, 0, type) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HaikuGLView::AttachedToWindow(void) {
|
void HaikuGLView::AttachedToWindow(void) {
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -29,11 +30,10 @@
|
|||||||
#ifndef HAIKU_GL_VIEW_H
|
#ifndef HAIKU_GL_VIEW_H
|
||||||
#define HAIKU_GL_VIEW_H
|
#define HAIKU_GL_VIEW_H
|
||||||
|
|
||||||
#include <kernel/image.h> // needed for image_id
|
|
||||||
#include <GLView.h>
|
#include <GLView.h>
|
||||||
|
#include <kernel/image.h> // needed for image_id
|
||||||
|
|
||||||
class HaikuGLView : public BGLView
|
class HaikuGLView : public BGLView {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
HaikuGLView(BRect frame, uint32 type);
|
HaikuGLView(BRect frame, uint32 type);
|
||||||
virtual void AttachedToWindow(void);
|
virtual void AttachedToWindow(void);
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -136,7 +137,7 @@ static _HaikuTranslatePair _hb_to_keycode[] = {
|
|||||||
{ KEY_Y, (0x79) },
|
{ KEY_Y, (0x79) },
|
||||||
{ KEY_Z, (0x7A) },
|
{ KEY_Z, (0x7A) },
|
||||||
|
|
||||||
/*
|
/*
|
||||||
{ KEY_PLAY, VK_PLAY},// (0xFA)
|
{ KEY_PLAY, VK_PLAY},// (0xFA)
|
||||||
{ KEY_STANDBY,VK_SLEEP },//(0x5F)
|
{ KEY_STANDBY,VK_SLEEP },//(0x5F)
|
||||||
{ KEY_BACK,VK_BROWSER_BACK},// (0xA6)
|
{ KEY_BACK,VK_BROWSER_BACK},// (0xA6)
|
||||||
@@ -177,22 +178,48 @@ static _HaikuTranslatePair _hb_to_keycode[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
unsigned int KeyMappingHaiku::get_keysym(int32 raw_char, int32 key) {
|
unsigned int KeyMappingHaiku::get_keysym(int32 raw_char, int32 key) {
|
||||||
if (raw_char == B_INSERT && key == 0x64) { return KEY_KP_0; }
|
if (raw_char == B_INSERT && key == 0x64) {
|
||||||
if (raw_char == B_END && key == 0x58) { return KEY_KP_1; }
|
return KEY_KP_0;
|
||||||
if (raw_char == B_DOWN_ARROW && key == 0x59) { return KEY_KP_2; }
|
}
|
||||||
if (raw_char == B_PAGE_DOWN && key == 0x5A) { return KEY_KP_3; }
|
if (raw_char == B_END && key == 0x58) {
|
||||||
if (raw_char == B_LEFT_ARROW && key == 0x48) { return KEY_KP_4; }
|
return KEY_KP_1;
|
||||||
if (raw_char == 0x35 && key == 0x49) { return KEY_KP_5; }
|
}
|
||||||
if (raw_char == B_RIGHT_ARROW && key == 0x4A) { return KEY_KP_6; }
|
if (raw_char == B_DOWN_ARROW && key == 0x59) {
|
||||||
if (raw_char == B_HOME && key == 0x37) { return KEY_KP_7; }
|
return KEY_KP_2;
|
||||||
if (raw_char == B_UP_ARROW && key == 0x38) { return KEY_KP_8; }
|
}
|
||||||
if (raw_char == B_PAGE_UP && key == 0x39) { return KEY_KP_9; }
|
if (raw_char == B_PAGE_DOWN && key == 0x5A) {
|
||||||
if (raw_char == 0x2F && key == 0x23) { return KEY_KP_DIVIDE; }
|
return KEY_KP_3;
|
||||||
if (raw_char == 0x2D && key == 0x25) { return KEY_KP_SUBTRACT; }
|
}
|
||||||
if (raw_char == B_DELETE && key == 0x65) { return KEY_KP_PERIOD; }
|
if (raw_char == B_LEFT_ARROW && key == 0x48) {
|
||||||
|
return KEY_KP_4;
|
||||||
|
}
|
||||||
|
if (raw_char == 0x35 && key == 0x49) {
|
||||||
|
return KEY_KP_5;
|
||||||
|
}
|
||||||
|
if (raw_char == B_RIGHT_ARROW && key == 0x4A) {
|
||||||
|
return KEY_KP_6;
|
||||||
|
}
|
||||||
|
if (raw_char == B_HOME && key == 0x37) {
|
||||||
|
return KEY_KP_7;
|
||||||
|
}
|
||||||
|
if (raw_char == B_UP_ARROW && key == 0x38) {
|
||||||
|
return KEY_KP_8;
|
||||||
|
}
|
||||||
|
if (raw_char == B_PAGE_UP && key == 0x39) {
|
||||||
|
return KEY_KP_9;
|
||||||
|
}
|
||||||
|
if (raw_char == 0x2F && key == 0x23) {
|
||||||
|
return KEY_KP_DIVIDE;
|
||||||
|
}
|
||||||
|
if (raw_char == 0x2D && key == 0x25) {
|
||||||
|
return KEY_KP_SUBTRACT;
|
||||||
|
}
|
||||||
|
if (raw_char == B_DELETE && key == 0x65) {
|
||||||
|
return KEY_KP_PERIOD;
|
||||||
|
}
|
||||||
|
|
||||||
if (raw_char == 0x10) {
|
if (raw_char == 0x10) {
|
||||||
for(int i = 0; _fn_to_keycode[i].keysym != KEY_UNKNOWN; i++) {
|
for (int i = 0; _fn_to_keycode[i].keysym != KEY_UNKNOWN; i++) {
|
||||||
if (_fn_to_keycode[i].keycode == key) {
|
if (_fn_to_keycode[i].keycode == key) {
|
||||||
return _fn_to_keycode[i].keysym;
|
return _fn_to_keycode[i].keysym;
|
||||||
}
|
}
|
||||||
@@ -201,7 +228,7 @@ unsigned int KeyMappingHaiku::get_keysym(int32 raw_char, int32 key) {
|
|||||||
return KEY_UNKNOWN;
|
return KEY_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; _hb_to_keycode[i].keysym != KEY_UNKNOWN; i++) {
|
for (int i = 0; _hb_to_keycode[i].keysym != KEY_UNKNOWN; i++) {
|
||||||
if (_hb_to_keycode[i].keycode == raw_char) {
|
if (_hb_to_keycode[i].keycode == raw_char) {
|
||||||
return _hb_to_keycode[i].keysym;
|
return _hb_to_keycode[i].keysym;
|
||||||
}
|
}
|
||||||
@@ -211,7 +238,7 @@ unsigned int KeyMappingHaiku::get_keysym(int32 raw_char, int32 key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned int KeyMappingHaiku::get_modifier_keysym(int32 key) {
|
unsigned int KeyMappingHaiku::get_modifier_keysym(int32 key) {
|
||||||
for(int i = 0; _mod_to_keycode[i].keysym != KEY_UNKNOWN; i++) {
|
for (int i = 0; _mod_to_keycode[i].keysym != KEY_UNKNOWN; i++) {
|
||||||
if ((_mod_to_keycode[i].keycode & key) != 0) {
|
if ((_mod_to_keycode[i].keycode & key) != 0) {
|
||||||
return _mod_to_keycode[i].keysym;
|
return _mod_to_keycode[i].keysym;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -29,9 +30,8 @@
|
|||||||
#ifndef KEY_MAPPING_HAIKU_H
|
#ifndef KEY_MAPPING_HAIKU_H
|
||||||
#define KEY_MAPPING_HAIKU_H
|
#define KEY_MAPPING_HAIKU_H
|
||||||
|
|
||||||
class KeyMappingHaiku
|
class KeyMappingHaiku {
|
||||||
{
|
KeyMappingHaiku(){};
|
||||||
KeyMappingHaiku() {};
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static unsigned int get_keysym(int32 raw_char, int32 key);
|
static unsigned int get_keysym(int32 raw_char, int32 key);
|
||||||
|
|||||||
36
os_haiku.cpp
36
os_haiku.cpp
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -28,16 +29,15 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
|
|
||||||
#include "servers/visual/visual_server_raster.h"
|
|
||||||
#include "servers/visual/visual_server_wrap_mt.h"
|
|
||||||
#include "drivers/gles2/rasterizer_gles2.h"
|
#include "drivers/gles2/rasterizer_gles2.h"
|
||||||
#include "servers/physics/physics_server_sw.h"
|
#include "servers/physics/physics_server_sw.h"
|
||||||
|
#include "servers/visual/visual_server_raster.h"
|
||||||
|
#include "servers/visual/visual_server_wrap_mt.h"
|
||||||
//#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
|
//#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
|
||||||
#include "main/main.h"
|
#include "main/main.h"
|
||||||
|
|
||||||
#include "os_haiku.h"
|
#include "os_haiku.h"
|
||||||
|
|
||||||
|
|
||||||
OS_Haiku::OS_Haiku() {
|
OS_Haiku::OS_Haiku() {
|
||||||
#ifdef MEDIA_KIT_ENABLED
|
#ifdef MEDIA_KIT_ENABLED
|
||||||
AudioDriverManagerSW::add_driver(&driver_media_kit);
|
AudioDriverManagerSW::add_driver(&driver_media_kit);
|
||||||
@@ -53,8 +53,8 @@ void OS_Haiku::run() {
|
|||||||
context_gl->release_current();
|
context_gl->release_current();
|
||||||
|
|
||||||
// TODO: clean up
|
// TODO: clean up
|
||||||
BMessenger* bms = new BMessenger(window);
|
BMessenger *bms = new BMessenger(window);
|
||||||
BMessage* msg = new BMessage();
|
BMessage *msg = new BMessage();
|
||||||
bms->SendMessage(LOCKGL_MSG, msg);
|
bms->SendMessage(LOCKGL_MSG, msg);
|
||||||
|
|
||||||
window->StartMessageRunner();
|
window->StartMessageRunner();
|
||||||
@@ -76,7 +76,7 @@ int OS_Haiku::get_video_driver_count() const {
|
|||||||
return 1;
|
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";
|
return "GLES2";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ OS::VideoMode OS_Haiku::get_default_video_mode() const {
|
|||||||
return OS::VideoMode(800, 600, false);
|
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;
|
current_video_mode = p_desired;
|
||||||
|
|
||||||
@@ -187,13 +187,13 @@ void OS_Haiku::finalize() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void OS_Haiku::set_main_loop(MainLoop* p_main_loop) {
|
void OS_Haiku::set_main_loop(MainLoop *p_main_loop) {
|
||||||
main_loop = p_main_loop;
|
main_loop = p_main_loop;
|
||||||
input->set_main_loop(p_main_loop);
|
input->set_main_loop(p_main_loop);
|
||||||
window->SetMainLoop(p_main_loop);
|
window->SetMainLoop(p_main_loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainLoop* OS_Haiku::get_main_loop() const {
|
MainLoop *OS_Haiku::get_main_loop() const {
|
||||||
return main_loop;
|
return main_loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,6 +235,10 @@ void OS_Haiku::set_cursor_shape(CursorShape p_shape) {
|
|||||||
//ERR_PRINT("set_cursor_shape() NOT IMPLEMENTED");
|
//ERR_PRINT("set_cursor_shape() NOT IMPLEMENTED");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OS_Haiku::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
|
||||||
|
// TODO: implement set_custom_mouse_cursor()
|
||||||
|
}
|
||||||
|
|
||||||
int OS_Haiku::get_screen_count() const {
|
int OS_Haiku::get_screen_count() const {
|
||||||
// TODO: implement get_screen_count()
|
// TODO: implement get_screen_count()
|
||||||
return 1;
|
return 1;
|
||||||
@@ -251,7 +255,7 @@ void OS_Haiku::set_current_screen(int p_screen) {
|
|||||||
|
|
||||||
Point2 OS_Haiku::get_screen_position(int p_screen) const {
|
Point2 OS_Haiku::get_screen_position(int p_screen) const {
|
||||||
// TODO: make this work with the p_screen parameter
|
// TODO: make this work with the p_screen parameter
|
||||||
BScreen* screen = new BScreen(window);
|
BScreen *screen = new BScreen(window);
|
||||||
BRect frame = screen->Frame();
|
BRect frame = screen->Frame();
|
||||||
delete screen;
|
delete screen;
|
||||||
return Point2i(frame.left, frame.top);
|
return Point2i(frame.left, frame.top);
|
||||||
@@ -259,13 +263,13 @@ Point2 OS_Haiku::get_screen_position(int p_screen) const {
|
|||||||
|
|
||||||
Size2 OS_Haiku::get_screen_size(int p_screen) const {
|
Size2 OS_Haiku::get_screen_size(int p_screen) const {
|
||||||
// TODO: make this work with the p_screen parameter
|
// TODO: make this work with the p_screen parameter
|
||||||
BScreen* screen = new BScreen(window);
|
BScreen *screen = new BScreen(window);
|
||||||
BRect frame = screen->Frame();
|
BRect frame = screen->Frame();
|
||||||
delete screen;
|
delete screen;
|
||||||
return Size2i(frame.IntegerWidth() + 1, frame.IntegerHeight() + 1);
|
return Size2i(frame.IntegerWidth() + 1, frame.IntegerHeight() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OS_Haiku::set_window_title(const String& p_title) {
|
void OS_Haiku::set_window_title(const String &p_title) {
|
||||||
window->SetTitle(p_title.utf8().get_data());
|
window->SetTitle(p_title.utf8().get_data());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,7 +289,7 @@ Point2 OS_Haiku::get_window_position() const {
|
|||||||
return Point2i(point.x, point.y);
|
return Point2i(point.x, point.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OS_Haiku::set_window_position(const Point2& p_position) {
|
void OS_Haiku::set_window_position(const Point2 &p_position) {
|
||||||
window->MoveTo(p_position.x, p_position.y);
|
window->MoveTo(p_position.x, p_position.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,7 +336,7 @@ bool OS_Haiku::is_window_maximized() const {
|
|||||||
return !window->IsMinimized();
|
return !window->IsMinimized();
|
||||||
}
|
}
|
||||||
|
|
||||||
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");
|
ERR_PRINT("set_video_mode() NOT IMPLEMENTED");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
65
os_haiku.h
65
os_haiku.h
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
@@ -30,57 +31,56 @@
|
|||||||
#define OS_HAIKU_H
|
#define OS_HAIKU_H
|
||||||
|
|
||||||
#include "drivers/unix/os_unix.h"
|
#include "drivers/unix/os_unix.h"
|
||||||
#include "servers/visual_server.h"
|
#include "main/input_default.h"
|
||||||
#include "servers/visual/rasterizer.h"
|
|
||||||
#include "servers/physics_server.h"
|
|
||||||
#include "servers/physics_2d/physics_2d_server_sw.h"
|
|
||||||
#include "servers/audio/audio_server_sw.h"
|
#include "servers/audio/audio_server_sw.h"
|
||||||
#include "servers/audio/sample_manager_sw.h"
|
#include "servers/audio/sample_manager_sw.h"
|
||||||
|
#include "servers/physics_2d/physics_2d_server_sw.h"
|
||||||
|
#include "servers/physics_server.h"
|
||||||
#include "servers/spatial_sound/spatial_sound_server_sw.h"
|
#include "servers/spatial_sound/spatial_sound_server_sw.h"
|
||||||
#include "servers/spatial_sound_2d/spatial_sound_2d_server_sw.h"
|
#include "servers/spatial_sound_2d/spatial_sound_2d_server_sw.h"
|
||||||
#include "main/input_default.h"
|
#include "servers/visual/rasterizer.h"
|
||||||
|
#include "servers/visual_server.h"
|
||||||
|
|
||||||
#include "audio_driver_media_kit.h"
|
#include "audio_driver_media_kit.h"
|
||||||
#include "context_gl_haiku.h"
|
#include "context_gl_haiku.h"
|
||||||
#include "haiku_application.h"
|
#include "haiku_application.h"
|
||||||
#include "haiku_direct_window.h"
|
#include "haiku_direct_window.h"
|
||||||
|
|
||||||
|
|
||||||
class OS_Haiku : public OS_Unix {
|
class OS_Haiku : public OS_Unix {
|
||||||
private:
|
private:
|
||||||
HaikuApplication* app;
|
HaikuApplication *app;
|
||||||
HaikuDirectWindow* window;
|
HaikuDirectWindow *window;
|
||||||
MainLoop* main_loop;
|
MainLoop *main_loop;
|
||||||
InputDefault* input;
|
InputDefault *input;
|
||||||
Rasterizer* rasterizer;
|
Rasterizer *rasterizer;
|
||||||
VisualServer* visual_server;
|
VisualServer *visual_server;
|
||||||
VideoMode current_video_mode;
|
VideoMode current_video_mode;
|
||||||
PhysicsServer* physics_server;
|
PhysicsServer *physics_server;
|
||||||
Physics2DServer* physics_2d_server;
|
Physics2DServer *physics_2d_server;
|
||||||
AudioServerSW* audio_server;
|
AudioServerSW *audio_server;
|
||||||
SampleManagerMallocSW* sample_manager;
|
SampleManagerMallocSW *sample_manager;
|
||||||
SpatialSoundServerSW* spatial_sound_server;
|
SpatialSoundServerSW *spatial_sound_server;
|
||||||
SpatialSound2DServerSW* spatial_sound_2d_server;
|
SpatialSound2DServerSW *spatial_sound_2d_server;
|
||||||
|
|
||||||
#ifdef MEDIA_KIT_ENABLED
|
#ifdef MEDIA_KIT_ENABLED
|
||||||
AudioDriverMediaKit driver_media_kit;
|
AudioDriverMediaKit driver_media_kit;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
|
#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
|
||||||
ContextGL_Haiku* context_gl;
|
ContextGL_Haiku *context_gl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
virtual void delete_main_loop();
|
virtual void delete_main_loop();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual int get_video_driver_count() const;
|
virtual int get_video_driver_count() const;
|
||||||
virtual const char* get_video_driver_name(int p_driver) const;
|
virtual const char *get_video_driver_name(int p_driver) const;
|
||||||
virtual VideoMode get_default_video_mode() const;
|
virtual VideoMode get_default_video_mode() const;
|
||||||
|
|
||||||
virtual void initialize(const VideoMode& p_desired, int p_video_driver, int p_audio_driver);
|
virtual void initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver);
|
||||||
virtual void finalize();
|
virtual void finalize();
|
||||||
|
|
||||||
virtual void set_main_loop(MainLoop* p_main_loop);
|
virtual void set_main_loop(MainLoop *p_main_loop);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OS_Haiku();
|
OS_Haiku();
|
||||||
@@ -88,7 +88,7 @@ public:
|
|||||||
|
|
||||||
virtual String get_name();
|
virtual String get_name();
|
||||||
|
|
||||||
virtual MainLoop* get_main_loop() const;
|
virtual MainLoop *get_main_loop() const;
|
||||||
|
|
||||||
virtual bool can_draw() const;
|
virtual bool can_draw() const;
|
||||||
virtual void release_rendering_thread();
|
virtual void release_rendering_thread();
|
||||||
@@ -98,17 +98,18 @@ public:
|
|||||||
virtual Point2 get_mouse_pos() const;
|
virtual Point2 get_mouse_pos() const;
|
||||||
virtual int get_mouse_button_state() const;
|
virtual int get_mouse_button_state() const;
|
||||||
virtual void set_cursor_shape(CursorShape p_shape);
|
virtual void set_cursor_shape(CursorShape p_shape);
|
||||||
|
virtual void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot);
|
||||||
|
|
||||||
virtual int get_screen_count() const;
|
virtual int get_screen_count() const;
|
||||||
virtual int get_current_screen() const;
|
virtual int get_current_screen() const;
|
||||||
virtual void set_current_screen(int p_screen);
|
virtual void set_current_screen(int p_screen);
|
||||||
virtual Point2 get_screen_position(int p_screen=0) const;
|
virtual Point2 get_screen_position(int p_screen = 0) const;
|
||||||
virtual Size2 get_screen_size(int p_screen=0) const;
|
virtual Size2 get_screen_size(int p_screen = 0) const;
|
||||||
virtual void set_window_title(const String& p_title);
|
virtual void set_window_title(const String &p_title);
|
||||||
virtual Size2 get_window_size() const;
|
virtual Size2 get_window_size() const;
|
||||||
virtual void set_window_size(const Size2 p_size);
|
virtual void set_window_size(const Size2 p_size);
|
||||||
virtual Point2 get_window_position() const;
|
virtual Point2 get_window_position() const;
|
||||||
virtual void set_window_position(const Point2& p_position);
|
virtual void set_window_position(const Point2 &p_position);
|
||||||
virtual void set_window_fullscreen(bool p_enabled);
|
virtual void set_window_fullscreen(bool p_enabled);
|
||||||
virtual bool is_window_fullscreen() const;
|
virtual bool is_window_fullscreen() const;
|
||||||
virtual void set_window_resizable(bool p_enabled);
|
virtual void set_window_resizable(bool p_enabled);
|
||||||
@@ -118,9 +119,9 @@ public:
|
|||||||
virtual void set_window_maximized(bool p_enabled);
|
virtual void set_window_maximized(bool p_enabled);
|
||||||
virtual bool is_window_maximized() const;
|
virtual bool is_window_maximized() const;
|
||||||
|
|
||||||
virtual void set_video_mode(const VideoMode& p_video_mode, int p_screen=0);
|
virtual void set_video_mode(const VideoMode &p_video_mode, int p_screen = 0);
|
||||||
virtual VideoMode get_video_mode(int p_screen=0) const;
|
virtual VideoMode get_video_mode(int p_screen = 0) const;
|
||||||
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen=0) const;
|
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen = 0) const;
|
||||||
virtual String get_executable_path() const;
|
virtual String get_executable_path() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
/* http://www.godotengine.org */
|
/* https://godotengine.org */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
|
||||||
/* */
|
/* */
|
||||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
/* a copy of this software and associated documentation files (the */
|
/* a copy of this software and associated documentation files (the */
|
||||||
|
|||||||
Reference in New Issue
Block a user