diff options
author | BastiaanOlij <mux213@gmail.com> | 2017-08-21 00:17:24 +1000 |
---|---|---|
committer | Bastiaan Olij <mux213@gmail.com> | 2019-06-15 21:30:32 +1000 |
commit | 02ea99129e8f3882914431374c60a7d80c5146e1 (patch) | |
tree | 6e41adaa70a2d5a3441ba6c1d455d9b63ea8c1de /platform/uwp | |
parent | 0a3c21d999559617cc9cdfe261d631e6d1267374 (diff) |
Adding a new Camera Server implementation to Godot.
This is a new singleton where camera sources such as webcams or cameras on a mobile phone can register themselves with the Server.
Other parts of Godot can interact with this to obtain images from the camera as textures.
This work includes additions to the Visual Server to use this functionality to present the camera image in the background. This is specifically targetted at AR applications.
Diffstat (limited to 'platform/uwp')
-rw-r--r-- | platform/uwp/os_uwp.cpp | 6 | ||||
-rw-r--r-- | platform/uwp/os_uwp.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index f9d22481dd..9d9be44ce5 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -302,6 +302,10 @@ Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_a } visual_server->init(); + + ///@TODO implement a subclass for UWP and instantiate that instead + camera_server = memnew(CameraServer); + input = memnew(InputDefault); joypad = ref new JoypadUWP(input); @@ -400,6 +404,8 @@ void OS_UWP::finalize() { memdelete(input); + memdelete(camera_server); + joypad = nullptr; } diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index 1bb68bc75d..b7a7248f19 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -41,6 +41,7 @@ #include "main/input_default.h" #include "power_uwp.h" #include "servers/audio_server.h" +#include "servers/camera_server.h" #include "servers/visual/rasterizer.h" #include "servers/visual_server.h" @@ -95,6 +96,8 @@ private: VisualServer *visual_server; int pressrc; + CameraServer *camera_server; + ContextEGL_UWP *gl_context; Windows::UI::Core::CoreWindow ^ window; |