Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
f7bd21a0
Unverified
Commit
f7bd21a0
authored
Apr 29, 2017
by
George Marques
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compilation for UWP
parent
abe09919
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
161 additions
and
50 deletions
+161
-50
rasterizer_gles3.cpp
drivers/gles3/rasterizer_gles3.cpp
+1
-1
audio_driver_xaudio2.h
drivers/xaudio2/audio_driver_xaudio2.h
+0
-1
SCsub
platform/uwp/SCsub
+1
-0
app.h
platform/uwp/app.h
+1
-1
os_uwp.cpp
platform/uwp/os_uwp.cpp
+25
-44
os_uwp.h
platform/uwp/os_uwp.h
+4
-3
power_uwp.cpp
platform/uwp/power_uwp.cpp
+74
-0
power_uwp.h
platform/uwp/power_uwp.h
+55
-0
No files found.
drivers/gles3/rasterizer_gles3.cpp
View file @
f7bd21a0
...
...
@@ -72,7 +72,7 @@ RasterizerScene *RasterizerGLES3::get_scene() {
#define _EXT_DEBUG_SEVERITY_LOW_ARB 0x9148
#define _EXT_DEBUG_OUTPUT 0x92E0
#if
def WINDOWS_ENABLED
#if
(defined WINDOWS_ENABLED) && !(defined UWP_ENABLED)
#define GLAPIENTRY APIENTRY
#else
#define GLAPIENTRY
...
...
drivers/xaudio2/audio_driver_xaudio2.h
View file @
f7bd21a0
...
...
@@ -34,7 +34,6 @@
#include "core/os/thread.h"
#include "servers/audio_server.h"
#include <mmreg.h>
#include <mmsystem.h>
#include <windows.h>
#include <wrl/client.h>
...
...
platform/uwp/SCsub
View file @
f7bd21a0
...
...
@@ -9,6 +9,7 @@ files = [
'#platform/windows/stream_peer_winsock.cpp'
,
'#platform/windows/key_mapping_win.cpp'
,
'joypad_uwp.cpp'
,
'power_uwp.cpp'
,
'gl_context_egl.cpp'
,
'app.cpp'
,
'os_uwp.cpp'
,
...
...
platform/uwp/app.h
View file @
f7bd21a0
...
...
@@ -107,7 +107,7 @@ namespace GodotUWP
int
last_touch_y
[
32
];
int
number_of_contacts
;
Windows
::
Foundation
::
Point
last_mouse_pos
;
}
}
;
}
/* clang-format on */
platform/uwp/os_uwp.cpp
View file @
f7bd21a0
...
...
@@ -28,24 +28,22 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "os_uwp.h"
#include "drivers/gles2/rasterizer_gles2.h"
#include "drivers/gles3/rasterizer_gles3.h"
#include "drivers/unix/ip_unix.h"
#include "drivers/windows/dir_access_windows.h"
#include "drivers/windows/file_access_windows.h"
#include "drivers/windows/mutex_windows.h"
#include "drivers/windows/rw_lock_windows.h"
#include "drivers/windows/semaphore_windows.h"
#include "main/main.h"
#include "os/memory_pool_dynamic_static.h"
#include "servers/audio_server.h"
#include "servers/visual/visual_server_raster.h"
#include "thread_uwp.h"
//#include "servers/visual/visual_server_wrap_mt.h"
#include "drivers/unix/ip_unix.h"
#include "global_config.h"
#include "io/marshalls.h"
#include "
os/memory_pool_dynamic_prealloc
.h"
#include "
main/main
.h"
#include "platform/windows/packet_peer_udp_winsock.h"
#include "platform/windows/stream_peer_winsock.h"
#include "platform/windows/tcp_server_winsock.h"
#include "servers/audio_server.h"
#include "servers/visual/visual_server_raster.h"
#include "thread_uwp.h"
#include <ppltasks.h>
#include <wrl.h>
...
...
@@ -149,9 +147,6 @@ const char *OSUWP::get_audio_driver_name(int p_driver) const {
return
AudioDriverManager
::
get_driver
(
p_driver
)
->
get_name
();
}
static
MemoryPoolStatic
*
mempool_static
=
NULL
;
static
MemoryPoolDynamic
*
mempool_dynamic
=
NULL
;
void
OSUWP
::
initialize_core
()
{
last_button_state
=
0
;
...
...
@@ -161,32 +156,19 @@ void OSUWP::initialize_core() {
ThreadUWP
::
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
);
FileAccess
::
make_default
<
FileAccessWindows
>
(
FileAccess
::
ACCESS_FILESYSTEM
);
//FileAccessBufferedFA<FileAccessWindows>::make_default();
DirAccess
::
make_default
<
DirAccessWindows
>
(
DirAccess
::
ACCESS_RESOURCES
);
DirAccess
::
make_default
<
DirAccessWindows
>
(
DirAccess
::
ACCESS_USERDATA
);
DirAccess
::
make_default
<
DirAccessWindows
>
(
DirAccess
::
ACCESS_FILESYSTEM
);
//TCPServerWinsock::make_default();
//StreamPeerWinsock::make_default();
TCPServerWinsock
::
make_default
();
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
))
ticks_per_second
=
1000
;
...
...
@@ -259,13 +241,18 @@ void OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_aud
set_video_mode
(
vm
);
gl_context
->
make_current
();
rasterizer
=
memnew
(
RasterizerGLES2
);
visual_server
=
memnew
(
VisualServerRaster
(
rasterizer
));
RasterizerGLES3
::
register_config
();
RasterizerGLES3
::
make_current
();
visual_server
=
memnew
(
VisualServerRaster
);
// 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));
}
*/
//
physics_server
=
memnew
(
PhysicsServerSW
);
...
...
@@ -288,7 +275,7 @@ void OSUWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_aud
ERR_PRINT
(
"Initializing audio failed."
);
}
power_manager
=
memnew
(
Power
WinRT
);
power_manager
=
memnew
(
Power
UWP
);
managed_object
->
update_clipboard
();
...
...
@@ -381,14 +368,6 @@ void OSUWP::finalize() {
if
(
gl_context
)
memdelete
(
gl_context
);
#endif
if
(
rasterizer
)
memdelete
(
rasterizer
);
/*
if (debugger_connection_console) {
memdelete(debugger_connection_console);
}
*/
memdelete
(
input
);
...
...
@@ -400,11 +379,8 @@ void OSUWP::finalize() {
joypad
=
nullptr
;
}
void
OSUWP
::
finalize_core
()
{
if
(
mempool_dynamic
)
memdelete
(
mempool_dynamic
);
delete
mempool_static
;
void
OSUWP
::
finalize_core
()
{
}
void
OSUWP
::
vprint
(
const
char
*
p_format
,
va_list
p_list
,
bool
p_stderr
)
{
...
...
@@ -880,15 +856,20 @@ String OSUWP::get_data_dir() const {
return
String
(
data_folder
->
Path
->
Data
()).
replace
(
"
\\
"
,
"/"
);
}
PowerState
OSWinrt
::
get_power_state
()
{
bool
OSUWP
::
check_feature_support
(
const
String
&
p_feature
)
{
return
VisualServer
::
get_singleton
()
->
has_os_feature
(
p_feature
);
}
PowerState
OSUWP
::
get_power_state
()
{
return
power_manager
->
get_power_state
();
}
int
OS
Winrt
::
get_power_seconds_left
()
{
int
OS
UWP
::
get_power_seconds_left
()
{
return
power_manager
->
get_power_seconds_left
();
}
int
OS
Winrt
::
get_power_percent_left
()
{
int
OS
UWP
::
get_power_percent_left
()
{
return
power_manager
->
get_power_percent_left
();
}
...
...
platform/uwp/os_uwp.h
View file @
f7bd21a0
...
...
@@ -38,7 +38,7 @@
#include "main/input_default.h"
#include "os/input.h"
#include "os/os.h"
#include "power_
winrt
.h"
#include "power_
uwp
.h"
#include "servers/audio_server.h"
#include "servers/physics/physics_server_sw.h"
#include "servers/physics_2d/physics_2d_server_sw.h"
...
...
@@ -94,7 +94,6 @@ private:
int
old_x
,
old_y
;
Point2i
center
;
VisualServer
*
visual_server
;
Rasterizer
*
rasterizer
;
PhysicsServer
*
physics_server
;
Physics2DServer
*
physics_2d_server
;
int
pressrc
;
...
...
@@ -107,7 +106,7 @@ private:
AudioDriverXAudio2
audio_driver
;
Power
WinRT
*
power_manager
;
Power
UWP
*
power_manager
;
MouseMode
mouse_mode
;
bool
alt_mem
;
...
...
@@ -237,6 +236,8 @@ public:
virtual
void
move_window_to_foreground
();
virtual
String
get_data_dir
()
const
;
virtual
bool
check_feature_support
(
const
String
&
p_feature
);
void
set_gl_context
(
ContextEGL
*
p_context
);
void
screen_size_changed
();
...
...
platform/uwp/power_uwp.cpp
0 → 100644
View file @
f7bd21a0
/*************************************************************************/
/* power_uwp.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* 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. */
/*************************************************************************/
#include "power_uwp.h"
PowerUWP
::
PowerUWP
()
:
nsecs_left
(
-
1
),
percent_left
(
-
1
),
power_state
(
POWERSTATE_UNKNOWN
)
{
}
PowerUWP
::~
PowerUWP
()
{
}
bool
PowerUWP
::
UpdatePowerInfo
()
{
// TODO, WinRT: Battery info is available on at least one WinRT platform (Windows Phone 8). Implement UpdatePowerInfo as appropriate. */
/* Notes from SDL:
- the Win32 function, GetSystemPowerStatus, is not available for use on WinRT
- Windows Phone 8 has a 'Battery' class, which is documented as available for C++
- More info on WP8's Battery class can be found at http://msdn.microsoft.com/library/windowsphone/develop/jj207231
*/
return
false
;
}
PowerState
PowerUWP
::
get_power_state
()
{
if
(
UpdatePowerInfo
())
{
return
power_state
;
}
else
{
WARN_PRINT
(
"Power management is not implemented on this platform, defaulting to POWERSTATE_UNKNOWN"
);
return
POWERSTATE_UNKNOWN
;
}
}
int
PowerUWP
::
get_power_seconds_left
()
{
if
(
UpdatePowerInfo
())
{
return
nsecs_left
;
}
else
{
WARN_PRINT
(
"Power management is not implemented on this platform, defaulting to -1"
);
return
-
1
;
}
}
int
PowerUWP
::
get_power_percent_left
()
{
if
(
UpdatePowerInfo
())
{
return
percent_left
;
}
else
{
WARN_PRINT
(
"Power management is not implemented on this platform, defaulting to -1"
);
return
-
1
;
}
}
platform/uwp/power_uwp.h
0 → 100644
View file @
f7bd21a0
/*************************************************************************/
/* power_uwp.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* 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 PLATFORM_UWP_POWER_UWP_H_
#define PLATFORM_UWP_POWER_UWP_H_
#include "os/dir_access.h"
#include "os/file_access.h"
#include "os/power.h"
class
PowerUWP
{
private
:
int
nsecs_left
;
int
percent_left
;
PowerState
power_state
;
bool
UpdatePowerInfo
();
public
:
PowerUWP
();
virtual
~
PowerUWP
();
PowerState
get_power_state
();
int
get_power_seconds_left
();
int
get_power_percent_left
();
};
#endif
/* PLATFORM_UWP_POWER_UWP_H_ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment