summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/SCsub2
-rw-r--r--platform/windows/context_gl_win.cpp1
-rw-r--r--platform/windows/detect.py6
-rw-r--r--platform/windows/joypad.cpp (renamed from platform/windows/joystick.cpp)157
-rw-r--r--platform/windows/joypad.h (renamed from platform/windows/joystick.h)39
-rw-r--r--platform/windows/key_mapping_win.cpp2
-rw-r--r--platform/windows/os_windows.cpp48
-rw-r--r--platform/windows/os_windows.h6
-rw-r--r--platform/windows/platform_config.h3
9 files changed, 125 insertions, 139 deletions
diff --git a/platform/windows/SCsub b/platform/windows/SCsub
index 32c23b906a..ae8c07384f 100644
--- a/platform/windows/SCsub
+++ b/platform/windows/SCsub
@@ -11,7 +11,7 @@ common_win = [
"tcp_server_winsock.cpp",
"packet_peer_udp_winsock.cpp",
"stream_peer_winsock.cpp",
- "joystick.cpp",
+ "joypad.cpp",
]
restarget = "godot_res" + env["OBJSUFFIX"]
diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp
index 136ac310f6..6b60ade5f0 100644
--- a/platform/windows/context_gl_win.cpp
+++ b/platform/windows/context_gl_win.cpp
@@ -40,7 +40,6 @@
//
//
-#define WINVER 0x0500
#include "context_gl_win.h"
//#include "drivers/opengl/glwrapper.h"
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 28030afa82..1f3c7a7654 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -207,6 +207,10 @@ def build_res_file(target, source, env):
def configure(env):
env.Append(CPPPATH=['#platform/windows'])
+
+ # Targeted Windows version: Vista (and later)
+ env.Append(CPPFLAGS=['-D_WIN32_WINNT=0x0600'])
+
env['is_mingw'] = False
if (os.name == "nt" and os.getenv("VCINSTALLDIR")):
# build using visual studio
@@ -315,7 +319,7 @@ def configure(env):
mingw_prefix = ""
if (env["bits"] == "default"):
- env["bits"] = "32"
+ env["bits"] = "64" if "PROGRAMFILES(X86)" in os.environ else "32"
if (env["bits"] == "32"):
env.Append(LINKFLAGS=['-static'])
diff --git a/platform/windows/joystick.cpp b/platform/windows/joypad.cpp
index 3fdf20a472..6ea23ebb28 100644
--- a/platform/windows/joystick.cpp
+++ b/platform/windows/joypad.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* joystick.cpp */
+/* joypad.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -26,8 +26,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-//author: Andreas Haas <hondres, liugam3@gmail.com>
-#include "joystick.h"
+#include "joypad.h"
#include <iostream>
#include <wbemidl.h>
#include <oleauto.h>
@@ -39,15 +38,15 @@
DWORD WINAPI _xinput_get_state(DWORD dwUserIndex, XINPUT_STATE* pState) { return ERROR_DEVICE_NOT_CONNECTED; }
DWORD WINAPI _xinput_set_state(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration) { return ERROR_DEVICE_NOT_CONNECTED; }
-joystick_windows::joystick_windows() {
+JoypadWindows::JoypadWindows() {
}
-joystick_windows::joystick_windows(InputDefault* _input, HWND* hwnd) {
+JoypadWindows::JoypadWindows(InputDefault* _input, HWND* hwnd) {
input = _input;
hWnd = hwnd;
- joystick_count = 0;
+ joypad_count = 0;
dinput = NULL;
xinput_dll = NULL;
xinput_get_state = NULL;
@@ -55,8 +54,8 @@ joystick_windows::joystick_windows(InputDefault* _input, HWND* hwnd) {
load_xinput();
- for (int i = 0; i < JOYSTICKS_MAX; i++)
- attached_joysticks[i] = false;
+ for (int i = 0; i < JOYPADS_MAX; i++)
+ attached_joypads[i] = false;
HRESULT result;
@@ -64,35 +63,35 @@ joystick_windows::joystick_windows(InputDefault* _input, HWND* hwnd) {
if (FAILED(result)) {
printf("failed init DINPUT: %ld\n", result);
}
- probe_joysticks();
+ probe_joypads();
}
-joystick_windows::~joystick_windows() {
+JoypadWindows::~JoypadWindows() {
- close_joystick();
+ close_joypad();
dinput->Release();
unload_xinput();
}
-bool joystick_windows::have_device(const GUID &p_guid) {
+bool JoypadWindows::have_device(const GUID &p_guid) {
- for (int i = 0; i < JOYSTICKS_MAX; i++) {
+ for (int i = 0; i < JOYPADS_MAX; i++) {
- if (d_joysticks[i].guid == p_guid) {
+ if (d_joypads[i].guid == p_guid) {
- d_joysticks[i].confirmed = true;
+ d_joypads[i].confirmed = true;
return true;
}
}
return false;
}
-int joystick_windows::check_free_joy_slot() const {
+int JoypadWindows::check_free_joy_slot() const {
- for (int i = 0; i < JOYSTICKS_MAX; i++) {
+ for (int i = 0; i < JOYPADS_MAX; i++) {
- if (!attached_joysticks[i])
+ if (!attached_joypads[i])
return i;
}
return -1;
@@ -100,7 +99,7 @@ int joystick_windows::check_free_joy_slot() const {
// adapted from SDL2, works a lot better than the MSDN version
-bool joystick_windows::is_xinput_device(const GUID *p_guid) {
+bool JoypadWindows::is_xinput_device(const GUID *p_guid) {
static GUID IID_ValveStreamingGamepad = { MAKELONG(0x28DE, 0x11FF), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } };
static GUID IID_X360WiredGamepad = { MAKELONG(0x045E, 0x02A1), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } };
@@ -144,7 +143,7 @@ bool joystick_windows::is_xinput_device(const GUID *p_guid) {
return false;
}
-bool joystick_windows::setup_dinput_joystick(const DIDEVICEINSTANCE* instance) {
+bool JoypadWindows::setup_dinput_joypad(const DIDEVICEINSTANCE* instance) {
HRESULT hr;
int num = check_free_joy_slot();
@@ -152,8 +151,8 @@ bool joystick_windows::setup_dinput_joystick(const DIDEVICEINSTANCE* instance) {
if (have_device(instance->guidInstance) || num == -1)
return false;
- d_joysticks[joystick_count] = dinput_gamepad();
- dinput_gamepad* joy = &d_joysticks[joystick_count];
+ d_joypads[joypad_count] = dinput_gamepad();
+ dinput_gamepad* joy = &d_joypads[joypad_count];
const DWORD devtype = (instance->dwDevType & 0xFF);
@@ -177,7 +176,7 @@ bool joystick_windows::setup_dinput_joystick(const DIDEVICEINSTANCE* instance) {
guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
- id_to_change = joystick_count;
+ id_to_change = joypad_count;
joy->di_joy->SetDataFormat(&c_dfDIJoystick2);
joy->di_joy->SetCooperativeLevel(*hWnd, DISCL_FOREGROUND);
@@ -188,13 +187,13 @@ bool joystick_windows::setup_dinput_joystick(const DIDEVICEINSTANCE* instance) {
input->joy_connection_changed(num, true, instance->tszProductName, uid);
joy->attached = true;
joy->id = num;
- attached_joysticks[num] = true;
+ attached_joypads[num] = true;
joy->confirmed = true;
- joystick_count++;
+ joypad_count++;
return true;
}
-void joystick_windows::setup_joystick_object(const DIDEVICEOBJECTINSTANCE *ob, int p_joy_id) {
+void JoypadWindows::setup_joypad_object(const DIDEVICEOBJECTINSTANCE *ob, int p_joy_id) {
if (ob->dwType & DIDFT_AXIS) {
@@ -225,7 +224,7 @@ void joystick_windows::setup_joystick_object(const DIDEVICEOBJECTINSTANCE *ob, i
prop_range.lMin = -MAX_JOY_AXIS;
prop_range.lMax = +MAX_JOY_AXIS;
- dinput_gamepad &joy = d_joysticks[p_joy_id];
+ dinput_gamepad &joy = d_joypads[p_joy_id];
res = IDirectInputDevice8_SetProperty(joy.di_joy, DIPROP_RANGE, &prop_range.diph);
@@ -246,100 +245,100 @@ void joystick_windows::setup_joystick_object(const DIDEVICEOBJECTINSTANCE *ob, i
}
}
-BOOL CALLBACK joystick_windows::enumCallback(const DIDEVICEINSTANCE* instance, void* pContext) {
+BOOL CALLBACK JoypadWindows::enumCallback(const DIDEVICEINSTANCE* instance, void* pContext) {
- joystick_windows* self = (joystick_windows*)pContext;
+ JoypadWindows* self = (JoypadWindows*)pContext;
if (self->is_xinput_device(&instance->guidProduct)) {;
return DIENUM_CONTINUE;
}
- self->setup_dinput_joystick(instance);
+ self->setup_dinput_joypad(instance);
return DIENUM_CONTINUE;
}
-BOOL CALLBACK joystick_windows::objectsCallback(const DIDEVICEOBJECTINSTANCE *instance, void *context) {
+BOOL CALLBACK JoypadWindows::objectsCallback(const DIDEVICEOBJECTINSTANCE *instance, void *context) {
- joystick_windows* self = (joystick_windows*)context;
- self->setup_joystick_object(instance, self->id_to_change);
+ JoypadWindows* self = (JoypadWindows*)context;
+ self->setup_joypad_object(instance, self->id_to_change);
return DIENUM_CONTINUE;
}
-void joystick_windows::close_joystick(int id) {
+void JoypadWindows::close_joypad(int id) {
if (id == -1) {
- for (int i = 0; i < JOYSTICKS_MAX; i++) {
+ for (int i = 0; i < JOYPADS_MAX; i++) {
- close_joystick(i);
+ close_joypad(i);
}
return;
}
- if (!d_joysticks[id].attached) return;
+ if (!d_joypads[id].attached) return;
- d_joysticks[id].di_joy->Unacquire();
- d_joysticks[id].di_joy->Release();
- d_joysticks[id].attached = false;
- attached_joysticks[d_joysticks[id].id] = false;
- d_joysticks[id].guid.Data1 = d_joysticks[id].guid.Data2 = d_joysticks[id].guid.Data3 = 0;
- input->joy_connection_changed(d_joysticks[id].id, false, "");
- joystick_count--;
+ d_joypads[id].di_joy->Unacquire();
+ d_joypads[id].di_joy->Release();
+ d_joypads[id].attached = false;
+ attached_joypads[d_joypads[id].id] = false;
+ d_joypads[id].guid.Data1 = d_joypads[id].guid.Data2 = d_joypads[id].guid.Data3 = 0;
+ input->joy_connection_changed(d_joypads[id].id, false, "");
+ joypad_count--;
}
-void joystick_windows::probe_joysticks() {
+void JoypadWindows::probe_joypads() {
DWORD dwResult;
for (DWORD i = 0; i < XUSER_MAX_COUNT; i++) {
- ZeroMemory(&x_joysticks[i].state, sizeof(XINPUT_STATE));
+ ZeroMemory(&x_joypads[i].state, sizeof(XINPUT_STATE));
- dwResult = xinput_get_state(i, &x_joysticks[i].state);
+ dwResult = xinput_get_state(i, &x_joypads[i].state);
if ( dwResult == ERROR_SUCCESS) {
int id = check_free_joy_slot();
- if (id != -1 && !x_joysticks[i].attached) {
-
- x_joysticks[i].attached = true;
- x_joysticks[i].id = id;
- x_joysticks[i].ff_timestamp = 0;
- x_joysticks[i].ff_end_timestamp = 0;
- x_joysticks[i].vibrating = false;
- attached_joysticks[id] = true;
+ if (id != -1 && !x_joypads[i].attached) {
+
+ x_joypads[i].attached = true;
+ x_joypads[i].id = id;
+ x_joypads[i].ff_timestamp = 0;
+ x_joypads[i].ff_end_timestamp = 0;
+ x_joypads[i].vibrating = false;
+ attached_joypads[id] = true;
input->joy_connection_changed(id, true, "XInput Gamepad","__XINPUT_DEVICE__");
}
}
- else if (x_joysticks[i].attached) {
+ else if (x_joypads[i].attached) {
- x_joysticks[i].attached = false;
- attached_joysticks[x_joysticks[i].id] = false;
- input->joy_connection_changed(x_joysticks[i].id, false, "");
+ x_joypads[i].attached = false;
+ attached_joypads[x_joypads[i].id] = false;
+ input->joy_connection_changed(x_joypads[i].id, false, "");
}
}
- for (int i = 0; i < joystick_count; i++) {
+ for (int i = 0; i < joypad_count; i++) {
- d_joysticks[i].confirmed = false;
+ d_joypads[i].confirmed = false;
}
dinput->EnumDevices(DI8DEVCLASS_GAMECTRL, enumCallback, this, DIEDFL_ATTACHEDONLY);
- for (int i = 0; i < joystick_count; i++) {
+ for (int i = 0; i < joypad_count; i++) {
- if (!d_joysticks[i].confirmed) {
+ if (!d_joypads[i].confirmed) {
- close_joystick(i);
+ close_joypad(i);
}
}
}
-unsigned int joystick_windows::process_joysticks(unsigned int p_last_id) {
+unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) {
HRESULT hr;
for (int i = 0; i < XUSER_MAX_COUNT; i++) {
- xinput_gamepad &joy = x_joysticks[i];
+ xinput_gamepad &joy = x_joypads[i];
if (!joy.attached) {
continue;
}
@@ -368,20 +367,20 @@ unsigned int joystick_windows::process_joysticks(unsigned int p_last_id) {
Vector2 strength = input->get_joy_vibration_strength(joy.id);
float duration = input->get_joy_vibration_duration(joy.id);
if (strength.x == 0 && strength.y == 0) {
- joystick_vibration_stop_xinput(i, timestamp);
+ joypad_vibration_stop_xinput(i, timestamp);
} else {
- joystick_vibration_start_xinput(i, strength.x, strength.y, duration, timestamp);
+ joypad_vibration_start_xinput(i, strength.x, strength.y, duration, timestamp);
}
} else if (joy.vibrating && joy.ff_end_timestamp != 0) {
uint64_t current_time = OS::get_singleton()->get_ticks_usec();
if (current_time >= joy.ff_end_timestamp)
- joystick_vibration_stop_xinput(i, current_time);
+ joypad_vibration_stop_xinput(i, current_time);
}
}
- for (int i = 0; i < JOYSTICKS_MAX; i++) {
+ for (int i = 0; i < JOYPADS_MAX; i++) {
- dinput_gamepad* joy = &d_joysticks[i];
+ dinput_gamepad* joy = &d_joypads[i];
if (!joy->attached)
continue;
@@ -438,7 +437,7 @@ unsigned int joystick_windows::process_joysticks(unsigned int p_last_id) {
return p_last_id;
}
-unsigned int joystick_windows::post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad) {
+unsigned int JoypadWindows::post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad) {
int dpad_val = 0;
@@ -487,7 +486,7 @@ unsigned int joystick_windows::post_hat(unsigned int p_last_id, int p_device, DW
return input->joy_hat(p_last_id, p_device, dpad_val);
};
-InputDefault::JoyAxis joystick_windows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool p_negate) const {
+InputDefault::JoyAxis JoypadWindows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool p_negate) const {
InputDefault::JoyAxis jx;
if (Math::abs(p_val) < MIN_JOY_AXIS) {
@@ -519,8 +518,8 @@ InputDefault::JoyAxis joystick_windows::axis_correct(int p_val, bool p_xinput, b
return jx;
}
-void joystick_windows::joystick_vibration_start_xinput(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp) {
- xinput_gamepad &joy = x_joysticks[p_device];
+void JoypadWindows::joypad_vibration_start_xinput(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp) {
+ xinput_gamepad &joy = x_joypads[p_device];
if (joy.attached) {
XINPUT_VIBRATION effect;
effect.wLeftMotorSpeed = (65535 * p_strong_magnitude);
@@ -533,8 +532,8 @@ void joystick_windows::joystick_vibration_start_xinput(int p_device, float p_wea
}
}
-void joystick_windows::joystick_vibration_stop_xinput(int p_device, uint64_t p_timestamp) {
- xinput_gamepad &joy = x_joysticks[p_device];
+void JoypadWindows::joypad_vibration_stop_xinput(int p_device, uint64_t p_timestamp) {
+ xinput_gamepad &joy = x_joypads[p_device];
if (joy.attached) {
XINPUT_VIBRATION effect;
effect.wLeftMotorSpeed = 0;
@@ -547,7 +546,7 @@ void joystick_windows::joystick_vibration_stop_xinput(int p_device, uint64_t p_t
}
-void joystick_windows::load_xinput() {
+void JoypadWindows::load_xinput() {
xinput_get_state = &_xinput_get_state;
xinput_set_state = &_xinput_set_state;
@@ -576,7 +575,7 @@ void joystick_windows::load_xinput() {
xinput_set_state = set_func;
}
-void joystick_windows::unload_xinput() {
+void JoypadWindows::unload_xinput() {
if (xinput_dll) {
diff --git a/platform/windows/joystick.h b/platform/windows/joypad.h
index 6de05bf108..63eee8c015 100644
--- a/platform/windows/joystick.h
+++ b/platform/windows/joypad.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* joystick.h */
+/* joypad.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -26,9 +26,8 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-//author: Andreas Haas <hondres, liugam3@gmail.com>
-#ifndef JOYSTICK_H
-#define JOYSTICK_H
+#ifndef JOYPAD_H
+#define JOYPAD_H
#include "os_windows.h"
#define DIRECTINPUT_VERSION 0x0800
@@ -48,19 +47,19 @@ if(x != NULL) \
#define XUSER_MAX_COUNT 4
#endif
-class joystick_windows
+class JoypadWindows
{
public:
- joystick_windows();
- joystick_windows(InputDefault* _input, HWND* hwnd);
- ~joystick_windows();
+ JoypadWindows();
+ JoypadWindows(InputDefault* _input, HWND* hwnd);
+ ~JoypadWindows();
- void probe_joysticks();
- unsigned int process_joysticks(unsigned int p_last_id);
+ void probe_joypads();
+ unsigned int process_joypads(unsigned int p_last_id);
private:
enum {
- JOYSTICKS_MAX = 16,
+ JOYPADS_MAX = 16,
JOY_AXIS_COUNT = 6,
MIN_JOY_AXIS = 10,
MAX_JOY_AXIS = 32768,
@@ -120,16 +119,16 @@ private:
InputDefault* input;
int id_to_change;
- int joystick_count;
- bool attached_joysticks[JOYSTICKS_MAX];
- dinput_gamepad d_joysticks[JOYSTICKS_MAX];
- xinput_gamepad x_joysticks[XUSER_MAX_COUNT];
+ int joypad_count;
+ bool attached_joypads[JOYPADS_MAX];
+ dinput_gamepad d_joypads[JOYPADS_MAX];
+ xinput_gamepad x_joypads[XUSER_MAX_COUNT];
static BOOL CALLBACK enumCallback(const DIDEVICEINSTANCE* p_instance, void* p_context);
static BOOL CALLBACK objectsCallback(const DIDEVICEOBJECTINSTANCE* instance, void* context);
- void setup_joystick_object(const DIDEVICEOBJECTINSTANCE* ob, int p_joy_id);
- void close_joystick(int id = -1);
+ void setup_joypad_object(const DIDEVICEOBJECTINSTANCE* ob, int p_joy_id);
+ void close_joypad(int id = -1);
void load_xinput();
void unload_xinput();
@@ -138,9 +137,9 @@ private:
bool have_device(const GUID &p_guid);
bool is_xinput_device(const GUID* p_guid);
- bool setup_dinput_joystick(const DIDEVICEINSTANCE* instance);
- void joystick_vibration_start_xinput(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp);
- void joystick_vibration_stop_xinput(int p_device, uint64_t p_timestamp);
+ bool setup_dinput_joypad(const DIDEVICEINSTANCE* instance);
+ void joypad_vibration_start_xinput(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp);
+ void joypad_vibration_stop_xinput(int p_device, uint64_t p_timestamp);
InputDefault::JoyAxis axis_correct(int p_val, bool p_xinput = false, bool p_trigger = false, bool p_negate = false) const;
XInputGetState_t xinput_get_state;
diff --git a/platform/windows/key_mapping_win.cpp b/platform/windows/key_mapping_win.cpp
index 00a0ca79c7..9ab222e9ee 100644
--- a/platform/windows/key_mapping_win.cpp
+++ b/platform/windows/key_mapping_win.cpp
@@ -26,8 +26,8 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#define WINVER 0x0500
#include "key_mapping_win.h"
+
#include <stdio.h>
struct _WinTranslatePair {
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 445f4fc328..6256cb58e0 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -30,11 +30,11 @@
#include "os_windows.h"
#include "drivers/gles3/rasterizer_gles3.h"
-#include "drivers/unix/memory_pool_static_malloc.h"
-#include "os/memory_pool_dynamic_static.h"
+
#include "drivers/windows/thread_windows.h"
#include "drivers/windows/semaphore_windows.h"
#include "drivers/windows/mutex_windows.h"
+#include "drivers/windows/rw_lock_windows.h"
#include "main/main.h"
#include "drivers/windows/file_access_windows.h"
#include "drivers/windows/dir_access_windows.h"
@@ -48,10 +48,10 @@
#include "packet_peer_udp_winsock.h"
#include "stream_peer_winsock.h"
#include "lang_table.h"
-#include "os/memory_pool_dynamic_prealloc.h"
+
#include "globals.h"
#include "io/marshalls.h"
-#include "joystick.h"
+#include "joypad.h"
#include "shlobj.h"
#include <regstr.h>
@@ -167,8 +167,6 @@ const char * OS_Windows::get_audio_driver_name(int p_driver) const {
return AudioDriverManagerSW::get_driver(p_driver)->get_name();
}
-static MemoryPoolStatic *mempool_static=NULL;
-static MemoryPoolDynamic *mempool_dynamic=NULL;
void OS_Windows::initialize_core() {
@@ -183,6 +181,7 @@ void OS_Windows::initialize_core() {
ThreadWindows::make_default();
SemaphoreWindows::make_default();
MutexWindows::make_default();
+ RWLockWindows::make_default();
FileAccess::make_default<FileAccessWindows>(FileAccess::ACCESS_RESOURCES);
FileAccess::make_default<FileAccessWindows>(FileAccess::ACCESS_USERDATA);
@@ -196,15 +195,6 @@ void OS_Windows::initialize_core() {
StreamPeerWinsock::make_default();
PacketPeerUDPWinsock::make_default();
- mempool_static = new MemoryPoolStaticMalloc;
-#if 1
- mempool_dynamic = memnew( MemoryPoolDynamicStatic );
-#else
-#define DYNPOOL_SIZE 4*1024*1024
- void * buffer = malloc( DYNPOOL_SIZE );
- mempool_dynamic = memnew( MemoryPoolDynamicPrealloc(buffer,DYNPOOL_SIZE) );
-
-#endif
// We need to know how often the clock is updated
if( !QueryPerformanceFrequency((LARGE_INTEGER *)&ticks_per_second) )
@@ -687,7 +677,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
print_line("input lang change");
} break;
- #if WINVER >= 0x0700 // for windows 7
+ #if WINVER >= 0x0601 // for windows 7
case WM_TOUCH: {
BOOL bHandled = FALSE;
@@ -724,7 +714,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
#endif
case WM_DEVICECHANGE: {
- joystick->probe_joysticks();
+ joypad->probe_joypads();
} break;
case WM_SETCURSOR: {
@@ -1087,13 +1077,15 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_
RasterizerGLES3::make_current();
#else
- #ifdef DX9_ENABLED
+ // FIXME: Does DX support still work now that rasterizer is no longer used?
+#ifdef DX9_ENABLED
rasterizer = memnew( RasterizerDX9(hWnd) );
- #endif
+#endif
#endif
visual_server = memnew( VisualServerRaster );
- //if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) {
+ // FIXME: Reimplement threaded rendering? Or remove?
+// if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) {
//
// visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD));
// }
@@ -1128,7 +1120,7 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_
visual_server->init();
input = memnew( InputDefault );
- joystick = memnew (joystick_windows(input, &hWnd));
+ joypad = memnew (JoypadWindows(input, &hWnd));
AudioDriverManagerSW::get_driver(p_audio_driver)->set_singleton();
@@ -1261,7 +1253,7 @@ void OS_Windows::finalize() {
main_loop=NULL;
- memdelete(joystick);
+ memdelete(joypad);
memdelete(input);
visual_server->finish();
@@ -1304,10 +1296,6 @@ void OS_Windows::finalize_core() {
memdelete(process_map);
- if (mempool_dynamic)
- memdelete( mempool_dynamic );
- delete mempool_static;
-
TCPServerWinsock::cleanup();
StreamPeerWinsock::cleanup();
@@ -1940,7 +1928,7 @@ void OS_Windows::process_events() {
MSG msg;
- last_id = joystick->process_joysticks(last_id);
+ last_id = joypad->process_joypads(last_id);
while(PeekMessageW(&msg,NULL,0,0,PM_REMOVE)) {
@@ -2128,7 +2116,7 @@ void OS_Windows::set_icon(const Image& p_icon) {
encode_uint32(0,&icon_bmp[36]);
uint8_t *wr=&icon_bmp[40];
- DVector<uint8_t>::Read r= icon.get_data().read();
+ PoolVector<uint8_t>::Read r= icon.get_data().read();
for(int i=0;i<h;i++) {
@@ -2382,7 +2370,7 @@ String OS_Windows::get_data_dir() const {
if (has_environment("APPDATA")) {
- bool use_godot = Globals::get_singleton()->get("application/use_shared_user_dir");
+ bool use_godot = GlobalConfig::get_singleton()->get("application/use_shared_user_dir");
if (!use_godot)
return (OS::get_singleton()->get_environment("APPDATA")+"/"+an).replace("\\","/");
else
@@ -2390,7 +2378,7 @@ String OS_Windows::get_data_dir() const {
}
}
- return Globals::get_singleton()->get_resource_path();
+ return GlobalConfig::get_singleton()->get_resource_path();
}
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 19367c758b..7ca89e6366 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -29,8 +29,6 @@
#ifndef OS_WINDOWS_H
#define OS_WINDOWS_H
-#define WINVER 0x0600
-
#include "os/input.h"
#include "os/os.h"
#include "context_gl_win.h"
@@ -63,7 +61,7 @@
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
-class joystick_windows;
+class JoypadWindows;
class OS_Windows : public OS {
enum {
@@ -135,7 +133,7 @@ class OS_Windows : public OS {
CursorShape cursor_shape;
InputDefault *input;
- joystick_windows *joystick;
+ JoypadWindows *joypad;
#ifdef RTAUDIO_ENABLED
AudioDriverRtAudio driver_rtaudio;
diff --git a/platform/windows/platform_config.h b/platform/windows/platform_config.h
index 19885c4afb..0e16753156 100644
--- a/platform/windows/platform_config.h
+++ b/platform/windows/platform_config.h
@@ -30,5 +30,4 @@
//#else
//#include <alloca.h>
//#endif
-//#define GLES2_INCLUDE_H "GL/glew.h"
-#define GLES3_INCLUDE_H "gl_context/glad/glad.h"
+#define GLES3_INCLUDE_H "glad/glad.h"