Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Apps/Playground/Android/BabylonNative/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ target_link_libraries(BabylonNativeJNI
GraphicsDevice
NativeCamera
NativeEngine
DataStream
NativeInput
NativeOptimizations
NativeXr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <Babylon/Plugins/NativeXr.h>
#include <Babylon/Plugins/NativeCamera.h>
#include <Babylon/Plugins/NativeOptimizations.h>
#include <Babylon/Plugins/DataStream.h>
#include <Babylon/Polyfills/Console.h>
#include <Babylon/Polyfills/Window.h>
#include <Babylon/Polyfills/XMLHttpRequest.h>
Expand Down Expand Up @@ -123,6 +124,7 @@ extern "C"
nativeInput = &Babylon::Plugins::NativeInput::CreateForJavaScript(env);

Babylon::Plugins::NativeCamera::Initialize(env);
Babylon::Plugins::DataStream::Initialize(env);
Babylon::Polyfills::Window::Initialize(env);

Babylon::Polyfills::XMLHttpRequest::Initialize(env);
Expand Down
1 change: 1 addition & 0 deletions Apps/Playground/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ target_link_libraries(Playground
PRIVATE GraphicsDevice
PRIVATE NativeCapture
PRIVATE NativeEngine
PRIVATE DataStream
PRIVATE NativeInput
PRIVATE NativeOptimizations
PRIVATE ScriptLoader
Expand Down
3 changes: 2 additions & 1 deletion Apps/Playground/UWP/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <Babylon/ScriptLoader.h>
#include <Babylon/Plugins/NativeEngine.h>
#include <Babylon/Plugins/NativeOptimizations.h>
#include <Babylon/Plugins/DataStream.h>
#include <Babylon/Polyfills/Console.h>
#include <Babylon/Polyfills/Window.h>
#include <Babylon/Polyfills/XMLHttpRequest.h>
Expand Down Expand Up @@ -393,7 +394,7 @@ void App::RestartRuntime(Windows::Foundation::Rect bounds)
m_nativeCanvas.emplace(Babylon::Polyfills::Canvas::Initialize(env));

Babylon::Polyfills::Window::Initialize(env);

Babylon::Plugins::DataStream::Initialize(env);
Babylon::Polyfills::XMLHttpRequest::Initialize(env);

Babylon::Plugins::NativeEngine::Initialize(env);
Expand Down
3 changes: 2 additions & 1 deletion Apps/Playground/Win32/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <Babylon/Plugins/NativeCamera.h>
#include <Babylon/Plugins/NativeInput.h>
#include <Babylon/Plugins/TestUtils.h>
#include <Babylon/Plugins/DataStream.h>
#include <Babylon/Polyfills/Console.h>
#include <Babylon/Polyfills/Window.h>
#include <Babylon/Polyfills/XMLHttpRequest.h>
Expand Down Expand Up @@ -177,7 +178,7 @@ namespace
});

Babylon::Polyfills::Window::Initialize(env);

Babylon::Plugins::DataStream::Initialize(env);
Babylon::Polyfills::XMLHttpRequest::Initialize(env);

nativeCanvas.emplace(Babylon::Polyfills::Canvas::Initialize(env));
Expand Down
2 changes: 2 additions & 0 deletions Apps/Playground/X11/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <Babylon/Plugins/NativeOptimizations.h>
#include <Babylon/Plugins/NativeInput.h>
#include <Babylon/Plugins/TestUtils.h>
#include <Babylon/Plugins/DataStream.h>
#include <Babylon/Polyfills/Console.h>
#include <Babylon/Polyfills/Window.h>
#include <Babylon/Polyfills/XMLHttpRequest.h>
Expand Down Expand Up @@ -76,6 +77,7 @@ namespace
});

Babylon::Polyfills::Window::Initialize(env);
Babylon::Plugins::DataStream::Initialize(env);
Babylon::Polyfills::XMLHttpRequest::Initialize(env);
nativeCanvas.emplace(Babylon::Polyfills::Canvas::Initialize(env));

Expand Down
3 changes: 2 additions & 1 deletion Apps/Playground/iOS/LibNativeBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#import <Babylon/Plugins/NativeInput.h>
#import <Babylon/Plugins/NativeOptimizations.h>
#import <Babylon/Plugins/NativeXr.h>
#import <Babylon/Plugins/DataStream.h>
#import <Babylon/Polyfills/Canvas.h>
#import <Babylon/Polyfills/Console.h>
#import <Babylon/Polyfills/Window.h>
Expand Down Expand Up @@ -81,7 +82,7 @@ - (void)init:(MTKView*)view screenScale:(float)inScreenScale width:(int)inWidth
nativeCanvas.emplace(Babylon::Polyfills::Canvas::Initialize(env));

Babylon::Polyfills::Window::Initialize(env);

Babylon::Plugins::DataStream::Initialize(env);
Babylon::Polyfills::XMLHttpRequest::Initialize(env);

Babylon::Plugins::NativeCamera::Initialize(env);
Expand Down
3 changes: 2 additions & 1 deletion Apps/Playground/macOS/ViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#import <Babylon/Graphics/Device.h>
#import <Babylon/Plugins/NativeEngine.h>
#import <Babylon/Plugins/NativeInput.h>
#import <Babylon/Plugins/DataStream.h>
#import <Babylon/Polyfills/Window.h>
#import <Babylon/Polyfills/XMLHttpRequest.h>
#import <Babylon/Polyfills/Canvas.h>
Expand Down Expand Up @@ -123,7 +124,7 @@ - (void)refreshBabylon {
});

Babylon::Polyfills::Window::Initialize(env);

Babylon::Plugins::DataStream::Initialize(env);
Babylon::Polyfills::XMLHttpRequest::Initialize(env);

nativeCanvas.emplace(Babylon::Polyfills::Canvas::Initialize(env));
Expand Down
3 changes: 2 additions & 1 deletion Apps/Playground/visionOS/LibNativeBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#import <Babylon/Plugins/NativeEngine.h>
#import <Babylon/Plugins/NativeInput.h>
#import <Babylon/Plugins/NativeOptimizations.h>
#import <Babylon/Plugins/DataStream.h>
#import <Babylon/Polyfills/Canvas.h>
#import <Babylon/Polyfills/Console.h>
#import <Babylon/Polyfills/Window.h>
Expand Down Expand Up @@ -60,7 +61,7 @@ - (bool)initializeWithWidth:(NSInteger)width height:(NSInteger)height {
self->_nativeCanvas.emplace(Babylon::Polyfills::Canvas::Initialize(env));

Babylon::Polyfills::Window::Initialize(env);

Babylon::Plugins::DataStream::Initialize(env);
Babylon::Polyfills::XMLHttpRequest::Initialize(env);

Babylon::Plugins::NativeEngine::Initialize(env);
Expand Down
1 change: 1 addition & 0 deletions Apps/UnitTests/Android/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ target_link_libraries(UnitTestsJNI
PRIVATE GraphicsDevice
PRIVATE NativeCamera
PRIVATE NativeEngine
PRIVATE DataStream
PRIVATE NativeInput
PRIVATE NativeOptimizations
PRIVATE NativeEncoding
Expand Down
1 change: 1 addition & 0 deletions Apps/UnitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ target_link_libraries(UnitTests
PRIVATE Console
PRIVATE GraphicsDevice
PRIVATE NativeEngine
PRIVATE DataStream
PRIVATE NativeEncoding
PRIVATE ScriptLoader
PRIVATE UrlLib
Expand Down
48 changes: 24 additions & 24 deletions Apps/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Apps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"getNightly": "node scripts/getNightly.js"
},
"dependencies": {
"babylonjs": "^8.28.2",
"babylonjs-gltf2interface": "^8.28.2",
"babylonjs-gui": "^8.28.2",
"babylonjs-loaders": "^8.28.2",
"babylonjs-materials": "^8.28.2",
"babylonjs": "^8.34.0",
"babylonjs-gltf2interface": "^8.34.0",
"babylonjs-gui": "^8.34.0",
"babylonjs-loaders": "^8.34.0",
"babylonjs-materials": "^8.34.0",
"jsc-android": "^241213.1.0",
"v8-android": "^7.8.2"
}
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ FetchContent_Declare(SPIRV-Cross
FetchContent_Declare(libwebp
GIT_REPOSITORY https://github.com/webmproject/libwebp.git
GIT_TAG 57e324e2eb99be46df46d77b65705e34a7ae616c)
FetchContent_Declare(miniz
GIT_REPOSITORY https://github.com/richgel999/miniz.git
GIT_TAG 174573d60290f447c13a2b1b3405de2b96e27d6c)
FetchContent_Declare(libdeflate
GIT_REPOSITORY https://github.com/ebiggers/libdeflate.git
GIT_TAG c8c56a20f8f621e6a966b716b31f1dedab6a41e3)

# --------------------------------------------------

FetchContent_MakeAvailable(CMakeExtensions)
Expand Down Expand Up @@ -102,6 +109,7 @@ option(BABYLON_NATIVE_PLUGIN_NATIVEOPTIMIZATIONS "Include Babylon Native Plugin
option(BABYLON_NATIVE_PLUGIN_NATIVETRACING "Include Babylon Native Plugin NativeTracing." ON)
option(BABYLON_NATIVE_PLUGIN_NATIVEXR "Include Babylon Native Plugin XR." ON)
option(BABYLON_NATIVE_PLUGIN_TESTUTILS "Include Babylon Native Plugin TestUtils." ON)
option(BABYLON_NATIVE_PLUGIN_DATASTREAM "Include Babylon Native Plugin DataStream." ON)

# Polyfills
option(BABYLON_NATIVE_POLYFILL_WINDOW "Include Babylon Native Polyfill Window." ON)
Expand Down
18 changes: 18 additions & 0 deletions Dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,21 @@ endif()
if(WINDOWS_STORE)
add_subdirectory(WindowsAppSDK)
endif()

# --------------------------------------------------
# miniz
# --------------------------------------------------
if(BABYLON_NATIVE_PLUGIN_DATASTREAM)
FetchContent_MakeAvailable_With_Message(miniz)
set_property(TARGET miniz PROPERTY UNITY_BUILD false)
endif()

# --------------------------------------------------
# libdeflate
# --------------------------------------------------
if(BABYLON_NATIVE_PLUGIN_DATASTREAM)
set(LIBDEFLATE_BUILD_SHARED_LIB OFF)
set(LIBDEFLATE_COMPRESSION_SUPPORT OFF)
FetchContent_MakeAvailable_With_Message(libdeflate)
set_property(TARGET libdeflate_static PROPERTY UNITY_BUILD false)
endif()
1 change: 1 addition & 0 deletions Install/Test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ target_link_libraries(TestInstall
NativeCamera
NativeCapture
NativeEngine
DataStream
NativeInput
NativeOptimizations
NativeTracing
Expand Down
56 changes: 55 additions & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2258,4 +2258,58 @@ 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.
```
```

# miniz

```
Copyright 2013-2014 RAD Game Tools and Valve Software
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC

All Rights Reserved.

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.
```

# libdeflate

```
Copyright 2016 Eric Biggers
Copyright 2024 Google LLC

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.
```
4 changes: 4 additions & 0 deletions Plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ endif()
if(BABYLON_NATIVE_PLUGIN_NATIVEENCODING)
add_subdirectory(NativeEncoding)
endif()

if(BABYLON_NATIVE_PLUGIN_DATASTREAM)
add_subdirectory(DataStream)
endif()
24 changes: 24 additions & 0 deletions Plugins/DataStream/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
set(SOURCES
"Include/Babylon/Plugins/DataStream.h"
"Source/DataStream.h"
"Source/DataStream.cpp"
"Source/TextDecoder.h"
"Source/ReadableStream.h"
"Source/DecompressionStream.h"
"Source/Response.h")

add_library(DataStream ${SOURCES})
warnings_as_errors(DataStream)

target_include_directories(DataStream PUBLIC
"Include")

target_link_libraries(DataStream
PUBLIC napi
PRIVATE miniz
PRIVATE libdeflate_static
PRIVATE bx
PRIVATE JsRuntimeInternal)

set_property(TARGET DataStream PROPERTY FOLDER Plugins)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCES})
Loading
Loading