summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/context_gl_windows.h21
-rw-r--r--platform/windows/detect.py3
-rw-r--r--platform/windows/os_windows.cpp13
-rw-r--r--platform/windows/os_windows.h1
4 files changed, 21 insertions, 17 deletions
diff --git a/platform/windows/context_gl_windows.h b/platform/windows/context_gl_windows.h
index 09801b9146..d23fba50e1 100644
--- a/platform/windows/context_gl_windows.h
+++ b/platform/windows/context_gl_windows.h
@@ -37,13 +37,12 @@
#include "core/error_list.h"
#include "core/os/os.h"
-#include "drivers/gl_context/context_gl.h"
#include <windows.h>
typedef bool(APIENTRY *PFNWGLSWAPINTERVALEXTPROC)(int interval);
-class ContextGL_Windows : public ContextGL {
+class ContextGL_Windows {
HDC hDC;
HGLRC hRC;
@@ -55,21 +54,21 @@ class ContextGL_Windows : public ContextGL {
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT;
public:
- virtual void release_current();
+ void release_current();
- virtual void make_current();
+ void make_current();
- virtual int get_window_width();
- virtual int get_window_height();
- virtual void swap_buffers();
+ int get_window_width();
+ int get_window_height();
+ void swap_buffers();
- virtual Error initialize();
+ Error initialize();
- virtual void set_use_vsync(bool p_use);
- virtual bool is_using_vsync() const;
+ void set_use_vsync(bool p_use);
+ bool is_using_vsync() const;
ContextGL_Windows(HWND hwnd, bool p_opengl_3_context);
- virtual ~ContextGL_Windows();
+ ~ContextGL_Windows();
};
#endif
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 426a5e9e61..2f7334657f 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -1,6 +1,5 @@
import methods
import os
-import sys
def is_active():
@@ -197,6 +196,8 @@ def configure_msvc(env, manual_msvc_config):
## Compile/link flags
env.AppendUnique(CCFLAGS=['/MT', '/Gd', '/GR', '/nologo'])
+ if int(env['MSVC_VERSION'].split('.')[0]) >= 14: #vs2015 and later
+ env.AppendUnique(CCFLAGS=['/utf-8'])
env.AppendUnique(CXXFLAGS=['/TP']) # assume all sources are C++
if manual_msvc_config: # should be automatic if SCons found it
if os.getenv("WindowsSdkDir") is not None:
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 6125455e74..1a5050a15a 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -384,8 +384,6 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
outside = true;
if (main_loop && mouse_mode != MOUSE_MODE_CAPTURED)
main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_EXIT);
- if (input)
- input->set_mouse_in_window(false);
} break;
case WM_INPUT: {
@@ -480,8 +478,6 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (main_loop && mouse_mode != MOUSE_MODE_CAPTURED)
main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER);
- if (input)
- input->set_mouse_in_window(true);
CursorShape c = cursor_shape;
cursor_shape = CURSOR_MAX;
@@ -670,7 +666,9 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
mb->set_button_index(BUTTON_XBUTTON2);
mb->set_doubleclick(true);
} break;
- default: { return 0; }
+ default: {
+ return 0;
+ }
}
mb->set_control((wParam & MK_CONTROL) != 0);
@@ -2297,6 +2295,11 @@ void OS_Windows::set_cursor_shape(CursorShape p_shape) {
cursor_shape = p_shape;
}
+OS::CursorShape OS_Windows::get_cursor_shape() const {
+
+ return cursor_shape;
+}
+
void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
if (p_cursor.is_valid()) {
Ref<Texture> texture = p_cursor;
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 2d03532c69..c15e1cabc3 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -273,6 +273,7 @@ public:
virtual String get_clipboard() const;
void set_cursor_shape(CursorShape p_shape);
+ CursorShape get_cursor_shape() const;
virtual void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot);
void GetMaskBitmaps(HBITMAP hSourceBitmap, COLORREF clrTransparent, OUT HBITMAP &hAndMaskBitmap, OUT HBITMAP &hXorMaskBitmap);
void set_icon(const Ref<Image> &p_icon);