Platform: Ensure classes match their header filename

Also drop some unused files.

Renamed:
- `platform/iphone/sem_iphone.h` -> `semaphore_iphone.h`
  (same for `osx`)
- `platform/uwp/gl_context_egl.h` -> `context_egl_uwp.h`
- in `platform/windows`: `context_gl_win.h`, `crash_handler_win.h`,
  `godot_win.cpp`, `joypad.h` and `key_mapping_win.h` all renamed to
  use `windows`. Some classes renamed accordingly too.
- `EditorExportAndroid` and `EditorExportUWP` renamed to
  `EditorExportPlatformAndroid` and `EditorExportPlatformUWP`
- `power_android` and `power_osx` renamed to `PowerAndroid` and
  `PowerOSX`
- `OSUWP` renamed to `OS_UWP`

Dropped:
- `platform/windows/ctxgl_procaddr.h`
This commit is contained in:
Rémi Verschelde 2019-02-12 15:43:54 +01:00
parent 75dae1b9a9
commit bc26d0d6cd
49 changed files with 264 additions and 478 deletions

View File

@ -206,9 +206,9 @@ static const LauncherIcon launcher_icons[] = {
{ "launcher_icons/mdpi_48x48", "res/drawable-mdpi-v4/icon.png" }
};
class EditorExportAndroid : public EditorExportPlatform {
class EditorExportPlatformAndroid : public EditorExportPlatform {
GDCLASS(EditorExportAndroid, EditorExportPlatform)
GDCLASS(EditorExportPlatformAndroid, EditorExportPlatform)
Ref<ImageTexture> logo;
Ref<ImageTexture> run_icon;
@ -235,7 +235,7 @@ class EditorExportAndroid : public EditorExportPlatform {
static void _device_poll_thread(void *ud) {
EditorExportAndroid *ea = (EditorExportAndroid *)ud;
EditorExportPlatformAndroid *ea = (EditorExportPlatformAndroid *)ud;
while (!ea->quit_request) {
@ -1925,7 +1925,7 @@ public:
virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, Set<String> &p_features) {
}
EditorExportAndroid() {
EditorExportPlatformAndroid() {
Ref<Image> img = memnew(Image(_android_logo));
logo.instance();
@ -1941,7 +1941,7 @@ public:
device_thread = Thread::create(_device_poll_thread, this);
}
~EditorExportAndroid() {
~EditorExportPlatformAndroid() {
quit_request = true;
Thread::wait_to_finish(device_thread);
memdelete(device_lock);
@ -1969,6 +1969,6 @@ void register_android_exporter() {
EDITOR_DEF("export/android/timestamping_authority_url", "");
EDITOR_DEF("export/android/shutdown_adb_on_exit", true);
Ref<EditorExportAndroid> exporter = Ref<EditorExportAndroid>(memnew(EditorExportAndroid));
Ref<EditorExportPlatformAndroid> exporter = Ref<EditorExportPlatformAndroid>(memnew(EditorExportPlatformAndroid));
EditorExport::get_singleton()->add_export_platform(exporter);
}

View File

@ -175,7 +175,7 @@ Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int
input = memnew(InputDefault);
input->set_fallback_mapping("Default Android Gamepad");
//power_manager = memnew(power_android);
//power_manager = memnew(PowerAndroid);
return OK;
}

View File

@ -134,7 +134,7 @@ private:
SetKeepScreenOnFunc set_keep_screen_on_func;
AlertFunc alert_func;
//power_android *power_manager;
//PowerAndroid *power_manager;
int video_driver_index;
public:

View File

@ -190,7 +190,7 @@ int Android_JNI_GetPowerInfo(int *plugged, int *charged, int *battery, int *seco
return 0;
}
bool power_android::GetPowerInfo_Android() {
bool PowerAndroid::GetPowerInfo_Android() {
int battery;
int plugged;
int charged;
@ -218,7 +218,7 @@ bool power_android::GetPowerInfo_Android() {
return true;
}
OS::PowerState power_android::get_power_state() {
OS::PowerState PowerAndroid::get_power_state() {
if (GetPowerInfo_Android()) {
return power_state;
} else {
@ -227,7 +227,7 @@ OS::PowerState power_android::get_power_state() {
}
}
int power_android::get_power_seconds_left() {
int PowerAndroid::get_power_seconds_left() {
if (GetPowerInfo_Android()) {
return nsecs_left;
} else {
@ -236,7 +236,7 @@ int power_android::get_power_seconds_left() {
}
}
int power_android::get_power_percent_left() {
int PowerAndroid::get_power_percent_left() {
if (GetPowerInfo_Android()) {
return percent_left;
} else {
@ -245,11 +245,11 @@ int power_android::get_power_percent_left() {
}
}
power_android::power_android() :
PowerAndroid::PowerAndroid() :
nsecs_left(-1),
percent_left(-1),
power_state(OS::POWERSTATE_UNKNOWN) {
}
power_android::~power_android() {
PowerAndroid::~PowerAndroid() {
}

View File

@ -28,13 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef PLATFORM_ANDROID_POWER_ANDROID_H_
#define PLATFORM_ANDROID_POWER_ANDROID_H_
#ifndef POWER_ANDROID_H
#define POWER_ANDROID_H
#include "core/os/os.h"
#include <android/native_window_jni.h>
class power_android {
class PowerAndroid {
struct LocalReferenceHolder {
JNIEnv *m_env;
@ -65,8 +66,8 @@ private:
public:
static int s_active;
power_android();
virtual ~power_android();
PowerAndroid();
virtual ~PowerAndroid();
static bool LocalReferenceHolder_Init(struct LocalReferenceHolder *refholder, JNIEnv *env);
static struct LocalReferenceHolder LocalReferenceHolder_Setup(const char *func);
static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder);
@ -76,4 +77,4 @@ public:
int get_power_percent_left();
};
#endif /* PLATFORM_ANDROID_POWER_ANDROID_H_ */
#endif // POWER_ANDROID_H

View File

@ -7,7 +7,7 @@ import os
iphone_lib = [
'godot_iphone.cpp',
'os_iphone.cpp',
'sem_iphone.cpp',
'semaphore_iphone.cpp',
'gl_view.mm',
'main.m',
'app_delegate.mm',

View File

@ -45,9 +45,10 @@
#include "core/project_settings.h"
#include "drivers/unix/syslog_logger.h"
#include "sem_iphone.h"
#include "semaphore_iphone.h"
#include "ios.h"
#include <dlfcn.h>
int OSIPhone::get_video_driver_count() const {

View File

@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef PLATFORM_IPHONE_POWER_IPHONE_H_
#define PLATFORM_IPHONE_POWER_IPHONE_H_
#ifndef POWER_IPHONE_H
#define POWER_IPHONE_H
#include <os/os.h>
@ -50,4 +50,4 @@ public:
int get_power_percent_left();
};
#endif /* PLATFORM_IPHONE_POWER_IPHONE_H_ */
#endif // POWER_IPHONE_H

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* sem_iphone.cpp */
/* semaphore_iphone.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "sem_iphone.h"
#include "semaphore_iphone.h"
#include <fcntl.h>
#include <unistd.h>
@ -71,6 +71,7 @@ void cgsem_destroy(cgsem_t *cgsem) {
}
#include "core/os/memory.h"
#include <errno.h>
Error SemaphoreIphone::wait() {

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* sem_iphone.h */
/* semaphore_iphone.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef SEM_IPHONE_H
#define SEM_IPHONE_H
#ifndef SEMAPHORE_IPHONE_H
#define SEMAPHORE_IPHONE_H
struct cgsem {
int pipefd[2];
@ -56,4 +56,4 @@ public:
~SemaphoreIphone();
};
#endif
#endif // SEMAPHORE_IPHONE_H

View File

@ -10,7 +10,7 @@ files = [
'crash_handler_osx.mm',
'os_osx.mm',
'godot_main_osx.mm',
'sem_osx.cpp',
'semaphore_osx.cpp',
'dir_access_osx.mm',
'joypad_osx.cpp',
'power_osx.cpp',

View File

@ -45,4 +45,4 @@ public:
~CrashHandler();
};
#endif
#endif // CRASH_HANDLER_OSX_H

View File

@ -28,9 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "crash_handler_osx.h"
#include "core/os/os.h"
#include "core/project_settings.h"
#include "main/main.h"
#include "os_osx.h"
#include <string.h>
#include <unistd.h>

View File

@ -43,6 +43,7 @@
#include "servers/visual/rasterizer.h"
#include "servers/visual/visual_server_wrap_mt.h"
#include "servers/visual_server.h"
#include <AppKit/AppKit.h>
#include <AppKit/NSCursor.h>
#include <ApplicationServices/ApplicationServices.h>
@ -132,7 +133,7 @@ public:
String im_text;
Point2 im_selection;
power_osx *power_manager;
PowerOSX *power_manager;
CrashHandler crash_handler;

View File

@ -37,7 +37,7 @@
#include "drivers/gles2/rasterizer_gles2.h"
#include "drivers/gles3/rasterizer_gles3.h"
#include "main/main.h"
#include "sem_osx.h"
#include "semaphore_osx.h"
#include "servers/visual/visual_server_raster.h"
#include <mach-o/dyld.h>
@ -1461,7 +1461,7 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
input = memnew(InputDefault);
joypad_osx = memnew(JoypadOSX);
power_manager = memnew(power_osx);
power_manager = memnew(PowerOSX);
_ensure_user_data_dir();

View File

@ -67,7 +67,7 @@ Adapted from corresponding SDL 2.0 code.
CFDictionaryGetValueIfPresent(dict, CFSTR(k), (const void **)v)
/* Note that AC power sources also include a laptop battery it is charging. */
void power_osx::checkps(CFDictionaryRef dict, bool *have_ac, bool *have_battery, bool *charging) {
void PowerOSX::checkps(CFDictionaryRef dict, bool *have_ac, bool *have_battery, bool *charging) {
CFStringRef strval; /* don't CFRelease() this. */
CFBooleanRef bval;
CFNumberRef numval;
@ -169,7 +169,7 @@ void power_osx::checkps(CFDictionaryRef dict, bool *have_ac, bool *have_battery,
#undef STRMATCH
// CODE CHUNK IMPORTED FROM SDL 2.0
bool power_osx::GetPowerInfo_MacOSX() {
bool PowerOSX::GetPowerInfo_MacOSX() {
CFTypeRef blob = IOPSCopyPowerSourcesInfo();
nsecs_left = -1;
@ -211,14 +211,14 @@ bool power_osx::GetPowerInfo_MacOSX() {
return true; /* always the definitive answer on Mac OS X. */
}
bool power_osx::UpdatePowerInfo() {
bool PowerOSX::UpdatePowerInfo() {
if (GetPowerInfo_MacOSX()) {
return true;
}
return false;
}
OS::PowerState power_osx::get_power_state() {
OS::PowerState PowerOSX::get_power_state() {
if (UpdatePowerInfo()) {
return power_state;
} else {
@ -226,7 +226,7 @@ OS::PowerState power_osx::get_power_state() {
}
}
int power_osx::get_power_seconds_left() {
int PowerOSX::get_power_seconds_left() {
if (UpdatePowerInfo()) {
return nsecs_left;
} else {
@ -234,7 +234,7 @@ int power_osx::get_power_seconds_left() {
}
}
int power_osx::get_power_percent_left() {
int PowerOSX::get_power_percent_left() {
if (UpdatePowerInfo()) {
return percent_left;
} else {
@ -242,11 +242,11 @@ int power_osx::get_power_percent_left() {
}
}
power_osx::power_osx() :
PowerOSX::PowerOSX() :
nsecs_left(-1),
percent_left(-1),
power_state(OS::POWERSTATE_UNKNOWN) {
}
power_osx::~power_osx() {
PowerOSX::~PowerOSX() {
}

View File

@ -28,15 +28,16 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef PLATFORM_OSX_POWER_OSX_H_
#define PLATFORM_OSX_POWER_OSX_H_
#ifndef POWER_OSX_H
#define POWER_OSX_H
#include "core/os/file_access.h"
#include "core/os/os.h"
#include "dir_access_osx.h"
#include <CoreFoundation/CoreFoundation.h>
class power_osx {
class PowerOSX {
private:
int nsecs_left;
@ -47,12 +48,12 @@ private:
bool UpdatePowerInfo();
public:
power_osx();
virtual ~power_osx();
PowerOSX();
virtual ~PowerOSX();
OS::PowerState get_power_state();
int get_power_seconds_left();
int get_power_percent_left();
};
#endif /* PLATFORM_OSX_POWER_OSX_H_ */
#endif // POWER_OSX_H

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* sem_osx.cpp */
/* semaphore_osx.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "sem_osx.h"
#include "semaphore_osx.h"
#include <fcntl.h>
#include <unistd.h>
@ -66,6 +66,7 @@ void cgsem_destroy(cgsem_t *cgsem) {
}
#include "core/os/memory.h"
#include <errno.h>
Error SemaphoreOSX::wait() {

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* sem_osx.h */
/* semaphore_osx.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef SEM_OSX_H
#define SEM_OSX_H
#ifndef SEMAPHORE_OSX_H
#define SEMAPHORE_OSX_H
struct cgsem {
int pipefd[2];
@ -56,4 +56,4 @@ public:
~SemaphoreOSX();
};
#endif
#endif // SEMAPHORE_OSX_H

View File

@ -13,7 +13,7 @@ common_server = [\
if sys.platform == "darwin":
common_server.append("#platform/osx/crash_handler_osx.mm")
common_server.append("#platform/osx/power_osx.cpp")
common_server.append("#platform/osx/sem_osx.cpp")
common_server.append("#platform/osx/semaphore_osx.cpp")
else:
common_server.append("#platform/x11/crash_handler_x11.cpp")
common_server.append("#platform/x11/power_x11.cpp")

View File

@ -93,7 +93,7 @@ Error OS_Server::initialize(const VideoMode &p_desired, int p_video_driver, int
input = memnew(InputDefault);
#ifdef __APPLE__
power_manager = memnew(power_osx);
power_manager = memnew(PowerOSX);
#else
power_manager = memnew(PowerX11);
#endif

View File

@ -38,7 +38,7 @@
#ifdef __APPLE__
#include "platform/osx/crash_handler_osx.h"
#include "platform/osx/power_osx.h"
#include "platform/osx/sem_osx.h"
#include "platform/osx/semaphore_osx.h"
#else
#include "platform/x11/crash_handler_x11.h"
#include "platform/x11/power_x11.h"
@ -69,7 +69,7 @@ class OS_Server : public OS_Unix {
InputDefault *input;
#ifdef __APPLE__
power_osx *power_manager;
PowerOSX *power_manager;
#else
PowerX11 *power_manager;
#endif

View File

@ -4,11 +4,11 @@ Import('env')
files = [
'thread_uwp.cpp',
'#platform/windows/key_mapping_win.cpp',
'#platform/windows/key_mapping_windows.cpp',
'#platform/windows/windows_terminal_logger.cpp',
'joypad_uwp.cpp',
'power_uwp.cpp',
'gl_context_egl.cpp',
'context_egl_uwp.cpp',
'app.cpp',
'os_uwp.cpp',
]

View File

@ -39,7 +39,7 @@
#include "core/os/keyboard.h"
#include "main/main.h"
#include "platform/windows/key_mapping_win.h"
#include "platform/windows/key_mapping_windows.h"
#include <collection.h>
@ -99,7 +99,7 @@ void App::Initialize(CoreApplicationView ^ applicationView) {
// Information about the Suspending and Resuming event handlers can be found here:
// http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh994930.aspx
os = new OSUWP;
os = new OS_UWP;
}
// Called when the CoreWindow object is created (or re-created).
@ -398,7 +398,7 @@ void App::OnMouseMoved(MouseDevice ^ mouse_device, MouseEventArgs ^ args) {
void App::key_event(Windows::UI::Core::CoreWindow ^ sender, bool p_pressed, Windows::UI::Core::KeyEventArgs ^ key_args, Windows::UI::Core::CharacterReceivedEventArgs ^ char_args) {
OSUWP::KeyEvent ke;
OS_UWP::KeyEvent ke;
ke.control = sender->GetAsyncKeyState(VirtualKey::Control) == CoreVirtualKeyStates::Down;
ke.alt = sender->GetAsyncKeyState(VirtualKey::Menu) == CoreVirtualKeyStates::Down;
@ -408,14 +408,14 @@ void App::key_event(Windows::UI::Core::CoreWindow ^ sender, bool p_pressed, Wind
if (key_args != nullptr) {
ke.type = OSUWP::KeyEvent::MessageType::KEY_EVENT_MESSAGE;
ke.type = OS_UWP::KeyEvent::MessageType::KEY_EVENT_MESSAGE;
ke.unicode = 0;
ke.scancode = KeyMappingWindows::get_keysym((unsigned int)key_args->VirtualKey);
ke.echo = (!p_pressed && !key_args->KeyStatus.IsKeyReleased) || (p_pressed && key_args->KeyStatus.WasKeyDown);
} else {
ke.type = OSUWP::KeyEvent::MessageType::CHAR_EVENT_MESSAGE;
ke.type = OS_UWP::KeyEvent::MessageType::CHAR_EVENT_MESSAGE;
ke.unicode = char_args->KeyCode;
ke.scancode = 0;
ke.echo = (!p_pressed && !char_args->KeyStatus.IsKeyReleased) || (p_pressed && char_args->KeyStatus.WasKeyDown);

View File

@ -103,7 +103,7 @@ namespace GodotUWP
EGLSurface mEglSurface;
CoreWindow^ window;
OSUWP* os;
OS_UWP* os;
int last_touch_x[32]; // 20 fingers, index 31 reserved for the mouse
int last_touch_y[32];

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* gl_context_egl.cpp */
/* context_egl_uwp.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,33 +28,33 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "gl_context_egl.h"
#include "context_egl_uwp.h"
#include "EGL/eglext.h"
using Platform::Exception;
void ContextEGL::release_current() {
void ContextEGL_UWP::release_current() {
eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, mEglContext);
};
void ContextEGL::make_current() {
void ContextEGL_UWP::make_current() {
eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext);
};
int ContextEGL::get_window_width() {
int ContextEGL_UWP::get_window_width() {
return width;
};
int ContextEGL::get_window_height() {
int ContextEGL_UWP::get_window_height() {
return height;
};
void ContextEGL::reset() {
void ContextEGL_UWP::reset() {
cleanup();
@ -62,7 +62,7 @@ void ContextEGL::reset() {
initialize();
};
void ContextEGL::swap_buffers() {
void ContextEGL_UWP::swap_buffers() {
if (eglSwapBuffers(mEglDisplay, mEglSurface) != EGL_TRUE) {
cleanup();
@ -74,7 +74,7 @@ void ContextEGL::swap_buffers() {
}
};
Error ContextEGL::initialize() {
Error ContextEGL_UWP::initialize() {
EGLint configAttribList[] = {
EGL_RED_SIZE, 8,
@ -190,7 +190,7 @@ Error ContextEGL::initialize() {
return OK;
};
void ContextEGL::cleanup() {
void ContextEGL_UWP::cleanup() {
if (mEglDisplay != EGL_NO_DISPLAY && mEglSurface != EGL_NO_SURFACE) {
eglDestroySurface(mEglDisplay, mEglSurface);
@ -208,14 +208,14 @@ void ContextEGL::cleanup() {
}
};
ContextEGL::ContextEGL(CoreWindow ^ p_window, Driver p_driver) :
ContextEGL_UWP::ContextEGL_UWP(CoreWindow ^ p_window, Driver p_driver) :
mEglDisplay(EGL_NO_DISPLAY),
mEglContext(EGL_NO_CONTEXT),
mEglSurface(EGL_NO_SURFACE),
driver(p_driver),
window(p_window) {}
ContextEGL::~ContextEGL() {
ContextEGL_UWP::~ContextEGL_UWP() {
cleanup();
};

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* gl_context_egl.h */
/* context_egl_uwp.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,19 +28,20 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef CONTEXT_EGL_H
#define CONTEXT_EGL_H
#ifndef CONTEXT_EGL_UWP_H
#define CONTEXT_EGL_UWP_H
#include <wrl.h>
#include "EGL/egl.h"
#include <EGL/egl.h>
#include "core/error_list.h"
#include "core/os/os.h"
#include "drivers/gl_context/context_gl.h"
using namespace Windows::UI::Core;
class ContextEGL : public ContextGL {
class ContextEGL_UWP : public ContextGL {
public:
enum Driver {
@ -79,8 +80,8 @@ public:
void cleanup();
ContextEGL(CoreWindow ^ p_window, Driver p_driver);
virtual ~ContextEGL();
ContextEGL_UWP(CoreWindow ^ p_window, Driver p_driver);
virtual ~ContextEGL_UWP();
};
#endif
#endif // CONTEXT_EGL_UWP_H

View File

@ -646,9 +646,9 @@ AppxPackager::~AppxPackager() {}
////////////////////////////////////////////////////////////////////
class EditorExportUWP : public EditorExportPlatform {
class EditorExportPlatformUWP : public EditorExportPlatform {
GDCLASS(EditorExportUWP, EditorExportPlatform);
GDCLASS(EditorExportPlatformUWP, EditorExportPlatform);
Ref<ImageTexture> logo;
@ -1035,13 +1035,13 @@ public:
r_features->push_back("s3tc");
r_features->push_back("etc");
switch ((int)p_preset->get("architecture/target")) {
case EditorExportUWP::ARM: {
case EditorExportPlatformUWP::ARM: {
r_features->push_back("arm");
} break;
case EditorExportUWP::X86: {
case EditorExportPlatformUWP::X86: {
r_features->push_back("32");
} break;
case EditorExportUWP::X64: {
case EditorExportPlatformUWP::X64: {
r_features->push_back("64");
} break;
}
@ -1123,13 +1123,13 @@ public:
String platform_infix;
switch (arch) {
case EditorExportUWP::ARM: {
case EditorExportPlatformUWP::ARM: {
platform_infix = "arm";
} break;
case EditorExportUWP::X86: {
case EditorExportPlatformUWP::X86: {
platform_infix = "x86";
} break;
case EditorExportUWP::X64: {
case EditorExportPlatformUWP::X64: {
platform_infix = "x64";
} break;
}
@ -1459,7 +1459,7 @@ public:
virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, Set<String> &p_features) {
}
EditorExportUWP() {
EditorExportPlatformUWP() {
Ref<Image> img = memnew(Image(_uwp_logo));
logo.instance();
logo->create_from_image(img);
@ -1478,7 +1478,7 @@ void register_uwp_exporter() {
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "export/uwp/debug_algorithm", PROPERTY_HINT_ENUM, "MD5,SHA1,SHA256"));
#endif // WINDOWS_ENABLED
Ref<EditorExportUWP> exporter;
Ref<EditorExportPlatformUWP> exporter;
exporter.instance();
EditorExport::get_singleton()->add_export_platform(exporter);
}

View File

@ -67,22 +67,22 @@ using namespace Windows::Devices::Sensors;
using namespace Windows::ApplicationModel::DataTransfer;
using namespace concurrency;
int OSUWP::get_video_driver_count() const {
int OS_UWP::get_video_driver_count() const {
return 2;
}
Size2 OSUWP::get_window_size() const {
Size2 OS_UWP::get_window_size() const {
Size2 size;
size.width = video_mode.width;
size.height = video_mode.height;
return size;
}
int OSUWP::get_current_video_driver() const {
int OS_UWP::get_current_video_driver() const {
return video_driver_index;
}
void OSUWP::set_window_size(const Size2 p_size) {
void OS_UWP::set_window_size(const Size2 p_size) {
Windows::Foundation::Size new_size;
new_size.Width = p_size.width;
@ -97,7 +97,7 @@ void OSUWP::set_window_size(const Size2 p_size) {
}
}
void OSUWP::set_window_fullscreen(bool p_enabled) {
void OS_UWP::set_window_fullscreen(bool p_enabled) {
ApplicationView ^ view = ApplicationView::GetForCurrentView();
@ -117,12 +117,12 @@ void OSUWP::set_window_fullscreen(bool p_enabled) {
}
}
bool OSUWP::is_window_fullscreen() const {
bool OS_UWP::is_window_fullscreen() const {
return ApplicationView::GetForCurrentView()->IsFullScreenMode;
}
void OSUWP::set_keep_screen_on(bool p_enabled) {
void OS_UWP::set_keep_screen_on(bool p_enabled) {
if (is_keep_screen_on() == p_enabled) return;
@ -134,7 +134,7 @@ void OSUWP::set_keep_screen_on(bool p_enabled) {
OS::set_keep_screen_on(p_enabled);
}
void OSUWP::initialize_core() {
void OS_UWP::initialize_core() {
last_button_state = 0;
@ -167,36 +167,36 @@ void OSUWP::initialize_core() {
cursor_shape = CURSOR_ARROW;
}
bool OSUWP::can_draw() const {
bool OS_UWP::can_draw() const {
return !minimized;
};
void OSUWP::set_window(Windows::UI::Core::CoreWindow ^ p_window) {
void OS_UWP::set_window(Windows::UI::Core::CoreWindow ^ p_window) {
window = p_window;
}
void OSUWP::screen_size_changed() {
void OS_UWP::screen_size_changed() {
gl_context->reset();
};
Error OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
main_loop = NULL;
outside = true;
ContextEGL::Driver opengl_api_type = ContextEGL::GLES_2_0;
ContextEGL_UWP::Driver opengl_api_type = ContextEGL_UWP::GLES_2_0;
if (p_video_driver == VIDEO_DRIVER_GLES2) {
opengl_api_type = ContextEGL::GLES_2_0;
opengl_api_type = ContextEGL_UWP::GLES_2_0;
}
bool gl_initialization_error = false;
gl_context = NULL;
while (!gl_context) {
gl_context = memnew(ContextEGL(window, opengl_api_type));
gl_context = memnew(ContextEGL_UWP(window, opengl_api_type));
if (gl_context->initialize() != OK) {
memdelete(gl_context);
@ -209,7 +209,7 @@ Error OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
}
p_video_driver = VIDEO_DRIVER_GLES2;
opengl_api_type = ContextEGL::GLES_2_0;
opengl_api_type = ContextEGL_UWP::GLES_2_0;
} else {
gl_initialization_error = true;
break;
@ -218,7 +218,7 @@ Error OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
}
while (true) {
if (opengl_api_type == ContextEGL::GLES_3_0) {
if (opengl_api_type == ContextEGL_UWP::GLES_3_0) {
if (RasterizerGLES3::is_viable() == OK) {
RasterizerGLES3::register_config();
RasterizerGLES3::make_current();
@ -226,7 +226,7 @@ Error OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
} else {
if (GLOBAL_GET("rendering/quality/driver/driver_fallback") == "Best") {
p_video_driver = VIDEO_DRIVER_GLES2;
opengl_api_type = ContextEGL::GLES_2_0;
opengl_api_type = ContextEGL_UWP::GLES_2_0;
continue;
} else {
gl_initialization_error = true;
@ -235,7 +235,7 @@ Error OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
}
}
if (opengl_api_type == ContextEGL::GLES_2_0) {
if (opengl_api_type == ContextEGL_UWP::GLES_2_0) {
if (RasterizerGLES2::is_viable() == OK) {
RasterizerGLES2::register_config();
RasterizerGLES2::make_current();
@ -349,7 +349,7 @@ Error OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
return OK;
}
void OSUWP::set_clipboard(const String &p_text) {
void OS_UWP::set_clipboard(const String &p_text) {
DataPackage ^ clip = ref new DataPackage();
clip->RequestedOperation = DataPackageOperation::Copy;
@ -358,7 +358,7 @@ void OSUWP::set_clipboard(const String &p_text) {
Clipboard::SetContent(clip);
};
String OSUWP::get_clipboard() const {
String OS_UWP::get_clipboard() const {
if (managed_object->clipboard != nullptr)
return managed_object->clipboard->Data();
@ -366,25 +366,25 @@ String OSUWP::get_clipboard() const {
return "";
};
void OSUWP::input_event(const Ref<InputEvent> &p_event) {
void OS_UWP::input_event(const Ref<InputEvent> &p_event) {
input->parse_input_event(p_event);
};
void OSUWP::delete_main_loop() {
void OS_UWP::delete_main_loop() {
if (main_loop)
memdelete(main_loop);
main_loop = NULL;
}
void OSUWP::set_main_loop(MainLoop *p_main_loop) {
void OS_UWP::set_main_loop(MainLoop *p_main_loop) {
input->set_main_loop(p_main_loop);
main_loop = p_main_loop;
}
void OSUWP::finalize() {
void OS_UWP::finalize() {
if (main_loop)
memdelete(main_loop);
@ -403,19 +403,19 @@ void OSUWP::finalize() {
joypad = nullptr;
}
void OSUWP::finalize_core() {
void OS_UWP::finalize_core() {
NetSocketPosix::cleanup();
}
void OSUWP::alert(const String &p_alert, const String &p_title) {
void OS_UWP::alert(const String &p_alert, const String &p_title) {
Platform::String ^ alert = ref new Platform::String(p_alert.c_str());
Platform::String ^ title = ref new Platform::String(p_title.c_str());
MessageDialog ^ msg = ref new MessageDialog(alert, title);
UICommand ^ close = ref new UICommand("Close", ref new UICommandInvokedHandler(managed_object, &OSUWP::ManagedType::alert_close));
UICommand ^ close = ref new UICommand("Close", ref new UICommandInvokedHandler(managed_object, &OS_UWP::ManagedType::alert_close));
msg->Commands->Append(close);
msg->DefaultCommandIndex = 0;
@ -424,17 +424,17 @@ void OSUWP::alert(const String &p_alert, const String &p_title) {
msg->ShowAsync();
}
void OSUWP::ManagedType::alert_close(IUICommand ^ command) {
void OS_UWP::ManagedType::alert_close(IUICommand ^ command) {
alert_close_handle = false;
}
void OSUWP::ManagedType::on_clipboard_changed(Platform::Object ^ sender, Platform::Object ^ ev) {
void OS_UWP::ManagedType::on_clipboard_changed(Platform::Object ^ sender, Platform::Object ^ ev) {
update_clipboard();
}
void OSUWP::ManagedType::update_clipboard() {
void OS_UWP::ManagedType::update_clipboard() {
DataPackageView ^ data = Clipboard::GetContent();
@ -446,7 +446,7 @@ void OSUWP::ManagedType::update_clipboard() {
}
}
void OSUWP::ManagedType::on_accelerometer_reading_changed(Accelerometer ^ sender, AccelerometerReadingChangedEventArgs ^ args) {
void OS_UWP::ManagedType::on_accelerometer_reading_changed(Accelerometer ^ sender, AccelerometerReadingChangedEventArgs ^ args) {
AccelerometerReading ^ reading = args->Reading;
@ -456,7 +456,7 @@ void OSUWP::ManagedType::on_accelerometer_reading_changed(Accelerometer ^ sender
reading->AccelerationZ));
}
void OSUWP::ManagedType::on_magnetometer_reading_changed(Magnetometer ^ sender, MagnetometerReadingChangedEventArgs ^ args) {
void OS_UWP::ManagedType::on_magnetometer_reading_changed(Magnetometer ^ sender, MagnetometerReadingChangedEventArgs ^ args) {
MagnetometerReading ^ reading = args->Reading;
@ -466,7 +466,7 @@ void OSUWP::ManagedType::on_magnetometer_reading_changed(Magnetometer ^ sender,
reading->MagneticFieldZ));
}
void OSUWP::ManagedType::on_gyroscope_reading_changed(Gyrometer ^ sender, GyrometerReadingChangedEventArgs ^ args) {
void OS_UWP::ManagedType::on_gyroscope_reading_changed(Gyrometer ^ sender, GyrometerReadingChangedEventArgs ^ args) {
GyrometerReading ^ reading = args->Reading;
@ -476,7 +476,7 @@ void OSUWP::ManagedType::on_gyroscope_reading_changed(Gyrometer ^ sender, Gyrome
reading->AngularVelocityZ));
}
void OSUWP::set_mouse_mode(MouseMode p_mode) {
void OS_UWP::set_mouse_mode(MouseMode p_mode) {
if (p_mode == MouseMode::MOUSE_MODE_CAPTURED) {
@ -501,41 +501,41 @@ void OSUWP::set_mouse_mode(MouseMode p_mode) {
SetEvent(mouse_mode_changed);
}
OSUWP::MouseMode OSUWP::get_mouse_mode() const {
OS_UWP::MouseMode OS_UWP::get_mouse_mode() const {
return mouse_mode;
}
Point2 OSUWP::get_mouse_position() const {
Point2 OS_UWP::get_mouse_position() const {
return Point2(old_x, old_y);
}
int OSUWP::get_mouse_button_state() const {
int OS_UWP::get_mouse_button_state() const {
return last_button_state;
}
void OSUWP::set_window_title(const String &p_title) {
void OS_UWP::set_window_title(const String &p_title) {
}
void OSUWP::set_video_mode(const VideoMode &p_video_mode, int p_screen) {
void OS_UWP::set_video_mode(const VideoMode &p_video_mode, int p_screen) {
video_mode = p_video_mode;
}
OS::VideoMode OSUWP::get_video_mode(int p_screen) const {
OS::VideoMode OS_UWP::get_video_mode(int p_screen) const {
return video_mode;
}
void OSUWP::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) const {
void OS_UWP::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) const {
}
String OSUWP::get_name() {
String OS_UWP::get_name() {
return "UWP";
}
OS::Date OSUWP::get_date(bool utc) const {
OS::Date OS_UWP::get_date(bool utc) const {
SYSTEMTIME systemtime;
if (utc)
@ -551,7 +551,7 @@ OS::Date OSUWP::get_date(bool utc) const {
date.dst = false;
return date;
}
OS::Time OSUWP::get_time(bool utc) const {
OS::Time OS_UWP::get_time(bool utc) const {
SYSTEMTIME systemtime;
if (utc)
@ -566,7 +566,7 @@ OS::Time OSUWP::get_time(bool utc) const {
return time;
}
OS::TimeZoneInfo OSUWP::get_time_zone_info() const {
OS::TimeZoneInfo OS_UWP::get_time_zone_info() const {
TIME_ZONE_INFORMATION info;
bool daylight = false;
if (GetTimeZoneInformation(&info) == TIME_ZONE_ID_DAYLIGHT)
@ -583,7 +583,7 @@ OS::TimeZoneInfo OSUWP::get_time_zone_info() const {
return ret;
}
uint64_t OSUWP::get_unix_time() const {
uint64_t OS_UWP::get_unix_time() const {
FILETIME ft;
SYSTEMTIME st;
@ -605,14 +605,14 @@ uint64_t OSUWP::get_unix_time() const {
return (*(uint64_t *)&ft - *(uint64_t *)&fep) / 10000000;
};
void OSUWP::delay_usec(uint32_t p_usec) const {
void OS_UWP::delay_usec(uint32_t p_usec) const {
int msec = p_usec < 1000 ? 1 : p_usec / 1000;
// no Sleep()
WaitForSingleObjectEx(GetCurrentThread(), msec, false);
}
uint64_t OSUWP::get_ticks_usec() const {
uint64_t OS_UWP::get_ticks_usec() const {
uint64_t ticks;
uint64_t time;
@ -626,13 +626,13 @@ uint64_t OSUWP::get_ticks_usec() const {
return time;
}
void OSUWP::process_events() {
void OS_UWP::process_events() {
joypad->process_controllers();
process_key_events();
}
void OSUWP::process_key_events() {
void OS_UWP::process_key_events() {
for (int i = 0; i < key_event_pos; i++) {
@ -653,7 +653,7 @@ void OSUWP::process_key_events() {
key_event_pos = 0;
}
void OSUWP::queue_key_event(KeyEvent &p_event) {
void OS_UWP::queue_key_event(KeyEvent &p_event) {
// This merges Char events with the previous Key event, so
// the unicode can be retrieved without sending duplicate events.
if (p_event.type == KeyEvent::MessageType::CHAR_EVENT_MESSAGE && key_event_pos > 0) {
@ -670,7 +670,7 @@ void OSUWP::queue_key_event(KeyEvent &p_event) {
key_event_buffer[key_event_pos++] = p_event;
}
void OSUWP::set_cursor_shape(CursorShape p_shape) {
void OS_UWP::set_cursor_shape(CursorShape p_shape) {
ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
@ -702,62 +702,62 @@ void OSUWP::set_cursor_shape(CursorShape p_shape) {
cursor_shape = p_shape;
}
void OSUWP::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
void OS_UWP::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
// TODO
}
Error OSUWP::execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id, String *r_pipe, int *r_exitcode, bool read_stderr) {
Error OS_UWP::execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id, String *r_pipe, int *r_exitcode, bool read_stderr) {
return FAILED;
};
Error OSUWP::kill(const ProcessID &p_pid) {
Error OS_UWP::kill(const ProcessID &p_pid) {
return FAILED;
};
Error OSUWP::set_cwd(const String &p_cwd) {
Error OS_UWP::set_cwd(const String &p_cwd) {
return FAILED;
}
String OSUWP::get_executable_path() const {
String OS_UWP::get_executable_path() const {
return "";
}
void OSUWP::set_icon(const Ref<Image> &p_icon) {
void OS_UWP::set_icon(const Ref<Image> &p_icon) {
}
bool OSUWP::has_environment(const String &p_var) const {
bool OS_UWP::has_environment(const String &p_var) const {
return false;
};
String OSUWP::get_environment(const String &p_var) const {
String OS_UWP::get_environment(const String &p_var) const {
return "";
};
bool OSUWP::set_environment(const String &p_var, const String &p_value) const {
bool OS_UWP::set_environment(const String &p_var, const String &p_value) const {
return false;
}
String OSUWP::get_stdin_string(bool p_block) {
String OS_UWP::get_stdin_string(bool p_block) {
return String();
}
void OSUWP::move_window_to_foreground() {
void OS_UWP::move_window_to_foreground() {
}
Error OSUWP::shell_open(String p_uri) {
Error OS_UWP::shell_open(String p_uri) {
return FAILED;
}
String OSUWP::get_locale() const {
String OS_UWP::get_locale() const {
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP // this should work on phone 8.1, but it doesn't
return "en";
@ -767,39 +767,39 @@ String OSUWP::get_locale() const {
#endif
}
void OSUWP::release_rendering_thread() {
void OS_UWP::release_rendering_thread() {
gl_context->release_current();
}
void OSUWP::make_rendering_thread() {
void OS_UWP::make_rendering_thread() {
gl_context->make_current();
}
void OSUWP::swap_buffers() {
void OS_UWP::swap_buffers() {
gl_context->swap_buffers();
}
bool OSUWP::has_touchscreen_ui_hint() const {
bool OS_UWP::has_touchscreen_ui_hint() const {
TouchCapabilities ^ tc = ref new TouchCapabilities();
return tc->TouchPresent != 0 || UIViewSettings::GetForCurrentView()->UserInteractionMode == UserInteractionMode::Touch;
}
bool OSUWP::has_virtual_keyboard() const {
bool OS_UWP::has_virtual_keyboard() const {
return UIViewSettings::GetForCurrentView()->UserInteractionMode == UserInteractionMode::Touch;
}
void OSUWP::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect) {
void OS_UWP::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect) {
InputPane ^ pane = InputPane::GetForCurrentView();
pane->TryShow();
}
void OSUWP::hide_virtual_keyboard() {
void OS_UWP::hide_virtual_keyboard() {
InputPane ^ pane = InputPane::GetForCurrentView();
pane->TryHide();
@ -818,7 +818,7 @@ static String format_error_message(DWORD id) {
return msg;
}
Error OSUWP::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) {
Error OS_UWP::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) {
String full_path = "game/" + p_path;
p_library_handle = (void *)LoadPackagedLibrary(full_path.c_str(), 0);
@ -830,14 +830,14 @@ Error OSUWP::open_dynamic_library(const String p_path, void *&p_library_handle,
return OK;
}
Error OSUWP::close_dynamic_library(void *p_library_handle) {
Error OS_UWP::close_dynamic_library(void *p_library_handle) {
if (!FreeLibrary((HMODULE)p_library_handle)) {
return FAILED;
}
return OK;
}
Error OSUWP::get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional) {
Error OS_UWP::get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional) {
p_symbol_handle = (void *)GetProcAddress((HMODULE)p_library_handle, p_name.utf8().get_data());
if (!p_symbol_handle) {
if (!p_optional) {
@ -850,7 +850,7 @@ Error OSUWP::get_dynamic_library_symbol_handle(void *p_library_handle, const Str
return OK;
}
void OSUWP::run() {
void OS_UWP::run() {
if (!main_loop)
return;
@ -874,35 +874,35 @@ void OSUWP::run() {
main_loop->finish();
}
MainLoop *OSUWP::get_main_loop() const {
MainLoop *OS_UWP::get_main_loop() const {
return main_loop;
}
String OSUWP::get_user_data_dir() const {
String OS_UWP::get_user_data_dir() const {
Windows::Storage::StorageFolder ^ data_folder = Windows::Storage::ApplicationData::Current->LocalFolder;
return String(data_folder->Path->Data()).replace("\\", "/");
}
bool OSUWP::_check_internal_feature_support(const String &p_feature) {
bool OS_UWP::_check_internal_feature_support(const String &p_feature) {
return p_feature == "pc" || p_feature == "s3tc";
}
OS::PowerState OSUWP::get_power_state() {
OS::PowerState OS_UWP::get_power_state() {
return power_manager->get_power_state();
}
int OSUWP::get_power_seconds_left() {
int OS_UWP::get_power_seconds_left() {
return power_manager->get_power_seconds_left();
}
int OSUWP::get_power_percent_left() {
int OS_UWP::get_power_percent_left() {
return power_manager->get_power_percent_left();
}
OSUWP::OSUWP() {
OS_UWP::OS_UWP() {
key_event_pos = 0;
force_quit = false;
@ -936,7 +936,7 @@ OSUWP::OSUWP() {
_set_logger(memnew(CompositeLogger(loggers)));
}
OSUWP::~OSUWP() {
OS_UWP::~OS_UWP() {
#ifdef STDOUT_FILE
fclose(stdo);
#endif

View File

@ -28,15 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef OSUWP_H
#define OSUWP_H
#ifndef OS_UWP_H
#define OS_UWP_H
#include "context_egl_uwp.h"
#include "core/math/transform_2d.h"
#include "core/os/input.h"
#include "core/os/os.h"
#include "core/ustring.h"
#include "drivers/xaudio2/audio_driver_xaudio2.h"
#include "gl_context_egl.h"
#include "joypad_uwp.h"
#include "main/input_default.h"
#include "power_uwp.h"
@ -52,7 +52,7 @@
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
class OSUWP : public OS {
class OS_UWP : public OS {
public:
struct KeyEvent {
@ -95,7 +95,7 @@ private:
VisualServer *visual_server;
int pressrc;
ContextEGL *gl_context;
ContextEGL_UWP *gl_context;
Windows::UI::Core::CoreWindow ^ window;
VideoMode video_mode;
@ -144,7 +144,7 @@ private:
/* clang-format off */
internal:
ManagedType() { alert_close_handle = false; }
property OSUWP* os;
property OS_UWP* os;
/* clang-format on */
};
ManagedType ^ managed_object;
@ -262,8 +262,8 @@ public:
void queue_key_event(KeyEvent &p_event);
OSUWP();
~OSUWP();
OS_UWP();
~OS_UWP();
};
#endif

View File

@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef PLATFORM_UWP_POWER_UWP_H_
#define PLATFORM_UWP_POWER_UWP_H_
#ifndef POWER_UWP_H
#define POWER_UWP_H
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
@ -53,4 +53,4 @@ public:
int get_power_percent_left();
};
#endif /* PLATFORM_UWP_POWER_UWP_H_ */
#endif // POWER_UWP_H

View File

@ -7,13 +7,12 @@ from platform_methods import run_in_subprocess
import platform_windows_builders
common_win = [
"godot_win.cpp",
"context_gl_win.cpp",
"crash_handler_win.cpp",
"godot_windows.cpp",
"context_gl_windows.cpp",
"crash_handler_windows.cpp",
"os_windows.cpp",
"ctxgl_procaddr.cpp",
"key_mapping_win.cpp",
"joypad.cpp",
"key_mapping_windows.cpp",
"joypad_windows.cpp",
"power_windows.cpp",
"windows_terminal_logger.cpp"
]

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* context_gl_win.cpp */
/* context_gl_windows.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -32,7 +32,7 @@
// Author: Juan Linietsky <reduzio@gmail.com>, (C) 2008
#include "context_gl_win.h"
#include "context_gl_windows.h"
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
@ -43,32 +43,32 @@
typedef HGLRC(APIENTRY *PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC, HGLRC, const int *);
void ContextGL_Win::release_current() {
void ContextGL_Windows::release_current() {
wglMakeCurrent(hDC, NULL);
}
void ContextGL_Win::make_current() {
void ContextGL_Windows::make_current() {
wglMakeCurrent(hDC, hRC);
}
int ContextGL_Win::get_window_width() {
int ContextGL_Windows::get_window_width() {
return OS::get_singleton()->get_video_mode().width;
}
int ContextGL_Win::get_window_height() {
int ContextGL_Windows::get_window_height() {
return OS::get_singleton()->get_video_mode().height;
}
void ContextGL_Win::swap_buffers() {
void ContextGL_Windows::swap_buffers() {
SwapBuffers(hDC);
}
void ContextGL_Win::set_use_vsync(bool p_use) {
void ContextGL_Windows::set_use_vsync(bool p_use) {
if (wglSwapIntervalEXT) {
wglSwapIntervalEXT(p_use ? 1 : 0);
@ -76,14 +76,14 @@ void ContextGL_Win::set_use_vsync(bool p_use) {
use_vsync = p_use;
}
bool ContextGL_Win::is_using_vsync() const {
bool ContextGL_Windows::is_using_vsync() const {
return use_vsync;
}
#define _WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
Error ContextGL_Win::initialize() {
Error ContextGL_Windows::initialize() {
static PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor
@ -172,14 +172,14 @@ Error ContextGL_Win::initialize() {
return OK;
}
ContextGL_Win::ContextGL_Win(HWND hwnd, bool p_opengl_3_context) {
ContextGL_Windows::ContextGL_Windows(HWND hwnd, bool p_opengl_3_context) {
opengl_3_context = p_opengl_3_context;
hWnd = hwnd;
use_vsync = false;
}
ContextGL_Win::~ContextGL_Win() {
ContextGL_Windows::~ContextGL_Windows() {
}
#endif

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* context_gl_win.h */
/* context_gl_windows.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -43,7 +43,7 @@
typedef bool(APIENTRY *PFNWGLSWAPINTERVALEXTPROC)(int interval);
class ContextGL_Win : public ContextGL {
class ContextGL_Windows : public ContextGL {
HDC hDC;
HGLRC hRC;
@ -68,8 +68,8 @@ public:
virtual void set_use_vsync(bool p_use);
virtual bool is_using_vsync() const;
ContextGL_Win(HWND hwnd, bool p_opengl_3_context);
virtual ~ContextGL_Win();
ContextGL_Windows(HWND hwnd, bool p_opengl_3_context);
virtual ~ContextGL_Windows();
};
#endif

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* crash_handler_win.cpp */
/* crash_handler_windows.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,6 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "crash_handler_windows.h"
#include "core/project_settings.h"
#include "main/main.h"
#include "os_windows.h"

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* crash_handler_win.h */
/* crash_handler_windows.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef CRASH_HANDLER_WIN_H
#define CRASH_HANDLER_WIN_H
#ifndef CRASH_HANDLER_WINDOWS_H
#define CRASH_HANDLER_WINDOWS_H
#include <windows.h>
@ -54,4 +54,4 @@ public:
~CrashHandler();
};
#endif
#endif // CRASH_HANDLER_WINDOWS_H

View File

@ -1,188 +0,0 @@
/*************************************************************************/
/* ctxgl_procaddr.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifdef OPENGL_ENABLED
#include "ctxgl_procaddr.h"
#include <GL/gl.h>
#include <stdio.h>
static PROC _gl_procs[] = {
(PROC)glCullFace,
(PROC)glFrontFace,
(PROC)glHint,
(PROC)glLineWidth,
(PROC)glPointSize,
(PROC)glPolygonMode,
(PROC)glScissor,
(PROC)glTexParameterf,
(PROC)glTexParameterfv,
(PROC)glTexParameteri,
(PROC)glTexParameteriv,
(PROC)glTexImage1D,
(PROC)glTexImage2D,
(PROC)glDrawBuffer,
(PROC)glClear,
(PROC)glClearColor,
(PROC)glClearStencil,
(PROC)glClearDepth,
(PROC)glStencilMask,
(PROC)glColorMask,
(PROC)glDepthMask,
(PROC)glDisable,
(PROC)glEnable,
(PROC)glFinish,
(PROC)glFlush,
(PROC)glBlendFunc,
(PROC)glLogicOp,
(PROC)glStencilFunc,
(PROC)glStencilOp,
(PROC)glDepthFunc,
(PROC)glPixelStoref,
(PROC)glPixelStorei,
(PROC)glReadBuffer,
(PROC)glReadPixels,
(PROC)glGetBooleanv,
(PROC)glGetDoublev,
(PROC)glGetError,
(PROC)glGetFloatv,
(PROC)glGetIntegerv,
(PROC)glGetString,
(PROC)glGetTexImage,
(PROC)glGetTexParameterfv,
(PROC)glGetTexParameteriv,
(PROC)glGetTexLevelParameterfv,
(PROC)glGetTexLevelParameteriv,
(PROC)glIsEnabled,
(PROC)glDepthRange,
(PROC)glViewport,
/* not detected in ATI */
(PROC)glDrawArrays,
(PROC)glDrawElements,
(PROC)glGetPointerv,
(PROC)glPolygonOffset,
(PROC)glCopyTexImage1D,
(PROC)glCopyTexImage2D,
(PROC)glCopyTexSubImage1D,
(PROC)glCopyTexSubImage2D,
(PROC)glTexSubImage1D,
(PROC)glTexSubImage2D,
(PROC)glBindTexture,
(PROC)glDeleteTextures,
(PROC)glGenTextures,
(PROC)glIsTexture,
0
};
static const char *_gl_proc_names[] = {
"glCullFace",
"glFrontFace",
"glHint",
"glLineWidth",
"glPointSize",
"glPolygonMode",
"glScissor",
"glTexParameterf",
"glTexParameterfv",
"glTexParameteri",
"glTexParameteriv",
"glTexImage1D",
"glTexImage2D",
"glDrawBuffer",
"glClear",
"glClearColor",
"glClearStencil",
"glClearDepth",
"glStencilMask",
"glColorMask",
"glDepthMask",
"glDisable",
"glEnable",
"glFinish",
"glFlush",
"glBlendFunc",
"glLogicOp",
"glStencilFunc",
"glStencilOp",
"glDepthFunc",
"glPixelStoref",
"glPixelStorei",
"glReadBuffer",
"glReadPixels",
"glGetBooleanv",
"glGetDoublev",
"glGetError",
"glGetFloatv",
"glGetIntegerv",
"glGetString",
"glGetTexImage",
"glGetTexParameterfv",
"glGetTexParameteriv",
"glGetTexLevelParameterfv",
"glGetTexLevelParameteriv",
"glIsEnabled",
"glDepthRange",
"glViewport",
/* not detected in ati */
"glDrawArrays",
"glDrawElements",
"glGetPointerv",
"glPolygonOffset",
"glCopyTexImage1D",
"glCopyTexImage2D",
"glCopyTexSubImage1D",
"glCopyTexSubImage2D",
"glTexSubImage1D",
"glTexSubImage2D",
"glBindTexture",
"glDeleteTextures",
"glGenTextures",
"glIsTexture",
0
};
PROC get_gl_proc_address(const char *p_address) {
PROC proc = wglGetProcAddress((const CHAR *)p_address);
if (!proc) {
int i = 0;
while (_gl_procs[i]) {
if (strcmp(p_address, _gl_proc_names[i]) == 0) {
return _gl_procs[i];
}
i++;
}
}
return proc;
}
#endif

View File

@ -1,39 +0,0 @@
/*************************************************************************/
/* ctxgl_procaddr.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef CTXGL_PROCADDR_H
#define CTXGL_PROCADDR_H
#ifdef OPENGL_ENABLED
#include <windows.h>
PROC get_gl_proc_address(const char *p_address);
#endif
#endif // CTXGL_PROCADDR_H

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* godot_win.cpp */
/* godot_windows.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -30,6 +30,7 @@
#include "main/main.h"
#include "os_windows.h"
#include <locale.h>
#include <stdio.h>

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* joypad.cpp */
/* joypad_windows.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "joypad.h"
#include "joypad_windows.h"
#include <oleauto.h>
#include <wbemidl.h>

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* joypad.h */
/* joypad_windows.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef JOYPAD_H
#define JOYPAD_H
#ifndef JOYPAD_WINDOWS_H
#define JOYPAD_WINDOWS_H
#include "os_windows.h"
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#include <xinput.h> // on unix the file is called "xinput.h", on windows I'm sure it won't mind
@ -145,4 +146,4 @@ private:
XInputSetState_t xinput_set_state;
};
#endif
#endif // JOYPAD_WINDOWS_H

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* key_mapping_win.cpp */
/* key_mapping_windows.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "key_mapping_win.h"
#include "key_mapping_windows.h"
#include <stdio.h>

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* key_mapping_win.h */
/* key_mapping_windows.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -45,4 +45,4 @@ public:
static unsigned int get_keysym(unsigned int p_code);
};
#endif
#endif // KEY_MAPPING_WINDOWS_H

View File

@ -43,15 +43,15 @@
#include "drivers/windows/rw_lock_windows.h"
#include "drivers/windows/semaphore_windows.h"
#include "drivers/windows/thread_windows.h"
#include "joypad.h"
#include "joypad_windows.h"
#include "lang_table.h"
#include "main/main.h"
#include "servers/audio_server.h"
#include "servers/visual/visual_server_raster.h"
#include "servers/visual/visual_server_wrap_mt.h"
#include "windows_terminal_logger.h"
#include <avrt.h>
#include <avrt.h>
#include <process.h>
#include <regstr.h>
#include <shlobj.h>
@ -1273,7 +1273,7 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
gl_context = NULL;
while (!gl_context) {
gl_context = memnew(ContextGL_Win(hWnd, gles3_context));
gl_context = memnew(ContextGL_Windows(hWnd, gles3_context));
if (gl_context->initialize() != OK) {
memdelete(gl_context);

View File

@ -31,16 +31,16 @@
#ifndef OS_WINDOWS_H
#define OS_WINDOWS_H
#include "context_gl_win.h"
#include "context_gl_windows.h"
#include "core/os/input.h"
#include "core/os/os.h"
#include "core/project_settings.h"
#include "crash_handler_win.h"
#include "crash_handler_windows.h"
#include "drivers/rtaudio/audio_driver_rtaudio.h"
#include "drivers/unix/ip_unix.h"
#include "drivers/wasapi/audio_driver_wasapi.h"
#include "drivers/winmidi/midi_driver_winmidi.h"
#include "key_mapping_win.h"
#include "key_mapping_windows.h"
#include "main/input_default.h"
#include "power_windows.h"
#include "servers/audio_server.h"
@ -87,7 +87,7 @@ class OS_Windows : public OS {
int old_x, old_y;
Point2i center;
#if defined(OPENGL_ENABLED)
ContextGL_Win *gl_context;
ContextGL_Windows *gl_context;
#endif
VisualServer *visual_server;
int pressrc;

View File

@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef PLATFORM_WINDOWS_POWER_WINDOWS_H_
#define PLATFORM_WINDOWS_POWER_WINDOWS_H_
#ifndef POWER_WINDOWS_H
#define POWER_WINDOWS_H
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
@ -55,4 +55,4 @@ public:
int get_power_percent_left();
};
#endif /* PLATFORM_WINDOWS_POWER_WINDOWS_H_ */
#endif // POWER_WINDOWS_H

View File

@ -28,15 +28,16 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifdef DEBUG_ENABLED
#define CRASH_HANDLER_ENABLED 1
#endif
#include "crash_handler_x11.h"
#include "core/os/os.h"
#include "core/project_settings.h"
#include "main/main.h"
#ifdef DEBUG_ENABLED
#define CRASH_HANDLER_ENABLED 1
#endif
#ifdef CRASH_HANDLER_ENABLED
#include <cxxabi.h>
#include <dlfcn.h>

View File

@ -45,4 +45,4 @@ public:
~CrashHandler();
};
#endif
#endif // CRASH_HANDLER_X11_H

View File

@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef X11_POWER_H_
#define X11_POWER_H_
#ifndef POWER_X11_H
#define POWER_X11_H
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
@ -63,4 +63,4 @@ public:
int get_power_percent_left();
};
#endif /* X11_POWER_H_ */
#endif // POWER_X11_H