From 02ea99129e8f3882914431374c60a7d80c5146e1 Mon Sep 17 00:00:00 2001 From: BastiaanOlij Date: Mon, 21 Aug 2017 00:17:24 +1000 Subject: 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. --- platform/javascript/os_javascript.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'platform/javascript/os_javascript.cpp') diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index e7981bf576..8242ed7df7 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -942,6 +942,8 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, VisualServer *visual_server = memnew(VisualServerRaster()); input = memnew(InputDefault); + camera_server = memnew(CameraServer); + EMSCRIPTEN_RESULT result; #define EM_CHECK(ev) \ if (result != EMSCRIPTEN_RESULT_SUCCESS) \ @@ -1076,6 +1078,7 @@ void OS_JavaScript::delete_main_loop() { void OS_JavaScript::finalize() { + memdelete(camera_server); memdelete(input); } -- cgit v1.2.3