Skip to content

Commit 11ca510

Browse files
committed
Merge remote-tracking branch 'origin/master' into async-fixes
2 parents c999153 + 9237670 commit 11ca510

File tree

204 files changed

+643661
-3541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+643661
-3541
lines changed

.clang-format

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,36 @@
1-
# https://releases.llvm.org/8.0.0/tools/clang/docs/ClangFormatStyleOptions.html
2-
---
3-
BasedOnStyle: LLVM
41
---
52
Language: Cpp
3+
# BasedOnStyle: LLVM
64

75
AccessModifierOffset: -4
86
AlignAfterOpenBracket: DontAlign
9-
AlignOperands: false
10-
AlwaysBreakTemplateDeclarations: true
11-
BreakBeforeBraces: Allman
7+
AlignEscapedNewlines: Left
8+
BraceWrapping:
9+
AfterCaseLabel: true
10+
AfterClass: true
11+
AfterControlStatement: Always
12+
AfterEnum: true
13+
AfterFunction: true
14+
AfterNamespace: true
15+
AfterObjCDeclaration: true
16+
AfterStruct: true
17+
AfterUnion: true
18+
AfterExternBlock: true
19+
BeforeCatch: true
20+
BeforeElse: true
21+
BeforeWhile: true
22+
BreakBeforeBraces: Custom
1223
BreakConstructorInitializers: BeforeComma
24+
BreakStringLiterals: false
1325
ColumnLimit: 0
1426
FixNamespaceComments: false
1527
IndentCaseLabels: true
1628
IndentWidth: 4
29+
KeepEmptyLinesAtTheStartOfBlocks: false
1730
NamespaceIndentation: All
31+
ReflowComments: false
32+
PackConstructorInitializers: Never
1833
PointerAlignment: Left
19-
SortIncludes: false
34+
SortIncludes: Never
35+
SortUsingDeclarations: false
2036
SpaceAfterTemplateKeyword: false
21-
---

.github/jobs/linux.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ parameters:
44
CC: ''
55
CXX: ''
66
JSEngine: ''
7-
7+
88
jobs:
99
- job: ${{ parameters.name }}
1010
timeoutInMinutes: 30
1111
pool:
1212
vmImage: ${{ parameters.vmImage }}
13-
13+
1414
variables:
1515
CC: ${{ parameters.CC }}
1616
CXX: ${{ parameters.CXX }}
@@ -32,13 +32,13 @@ jobs:
3232

3333
- script: |
3434
sudo apt-get update
35-
sudo apt-get install libjavascriptcoregtk-4.0-dev libgl1-mesa-dev libcurl4-openssl-dev ${{ parameters.CC }} libc++-9-dev libc++abi-9-dev libnode-dev
35+
sudo apt-get install libjavascriptcoregtk-4.0-dev libgl1-mesa-dev libcurl4-openssl-dev
3636
displayName: 'Install packages'
3737
3838
- script: |
3939
mkdir build
4040
cd build
41-
cmake .. -GNinja -DJSCORE_LIBRARY=/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so -DNAPI_JAVASCRIPT_ENGINE=${{ parameters.JSEngine }} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBGFX_CONFIG_MEMORY_TRACKING=ON -DBGFX_CONFIG_DEBUG=ON -DCMAKE_UNITY_BUILD=${UNITY_BUILD}
41+
cmake .. -GNinja -DJSCORE_LIBRARY=/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so -DNAPI_JAVASCRIPT_ENGINE=${{ parameters.JSEngine }} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBGFX_CONFIG_DEBUG=ON -DCMAKE_UNITY_BUILD=${UNITY_BUILD}
4242
ninja
4343
displayName: 'Build X11'
4444

.github/jobs/win32.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- script: |
4444
mkdir build${{ variables.solutionName }}
4545
cd build${{ variables.solutionName }}
46-
cmake -G "Visual Studio 16 2019" -A ${{ parameters.platform }} ${{ variables.jsEngineDefine }} -DBGFX_CONFIG_MEMORY_TRACKING=ON -DBGFX_CONFIG_DEBUG=ON -DGRAPHICS_API=${{ parameters.graphics_api }} -DCMAKE_UNITY_BUILD=${UNITY_BUILD} ..
46+
cmake -G "Visual Studio 16 2019" -A ${{ parameters.platform }} ${{ variables.jsEngineDefine }} -DBGFX_CONFIG_DEBUG=ON -DGRAPHICS_API=${{ parameters.graphics_api }} -DCMAKE_UNITY_BUILD=${UNITY_BUILD} ..
4747
displayName: 'Generate ${{ variables.solutionName }} solution'
4848
4949
- task: MSBuild@1

.github/workflows/nightly.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,18 @@ jobs:
1414
uses: actions/checkout@master
1515
with:
1616
submodules: 'recursive'
17-
- name: Download babylon.max.js
18-
run: curl.exe -o Apps/node_modules/babylonjs/babylon.max.js --create-dirs https://preview.babylonjs.com/babylon.max.js
19-
- name: Download babylon.max.js.map
20-
run: curl.exe -o Apps/node_modules/babylonjs/babylon.max.js.map --create-dirs https://preview.babylonjs.com/babylon.max.js.map
21-
- name: Download babylonjs.materials.js
22-
run: curl.exe -o Apps/node_modules/babylonjs-materials/babylonjs.materials.js --create-dirs https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.js
23-
- name: Download babylonjs.materials.js.map
24-
run: curl.exe -o Apps/node_modules/babylonjs-materials/babylonjs.materials.js.map --create-dirs https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.js.map
25-
- name: Download babylon.loaders.js
26-
run: curl.exe -o Apps/node_modules/babylonjs-loaders/babylonjs.loaders.js --create-dirs https://preview.babylonjs.com/loaders/babylonjs.loaders.js
27-
- name: Download babylon.loaders.js.map
28-
run: curl.exe -o Apps/node_modules/babylonjs-loaders/babylonjs.loaders.js.map --create-dirs https://preview.babylonjs.com/loaders/babylonjs.loaders.js.map
29-
- name: Download babylon.gui.js
30-
run: curl.exe -o Apps/node_modules/babylonjs-gui/babylon.gui.js --create-dirs https://preview.babylonjs.com/gui/babylon.gui.js
31-
- name: Download babylon.gui.js.map
32-
run: curl.exe -o Apps/node_modules/babylonjs-gui/babylon.gui.js.map --create-dirs https://preview.babylonjs.com/gui/babylon.gui.js.map
33-
- name: Download chai.js
34-
run: curl.exe -o Apps/node_modules/chai/chai.js --create-dirs https://unpkg.com/chai/chai.js
35-
- name: Download mocha.js
36-
run: curl.exe -o Apps/node_modules/mocha/mocha.js --create-dirs https://unpkg.com/mocha/mocha.js
17+
- name: NPM Install
18+
run: npm install
19+
working-directory: ./Apps
20+
- name: NPM download nightly
21+
run: npm run getNightly
22+
working-directory: ./Apps
3723
- name: View Apps\node_modules content
3824
run: Get-ChildItem -Path .\Apps\node_modules -Recurse
3925
- name: Make Solution
4026
run: mkdir buildWin32_x64 &&
4127
cd buildWin32_x64 &&
42-
cmake -G "Visual Studio 16 2019" -A x64 -DBGFX_CONFIG_MEMORY_TRACKING=ON -DBGFX_CONFIG_DEBUG=ON ..
28+
cmake -G "Visual Studio 16 2019" -A x64 -DBGFX_CONFIG_DEBUG=ON ..
4329
- name: Add msbuild to PATH
4430
uses: microsoft/[email protected]
4531
- name: Build Win32

Apps/Playground/Android/app/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ android {
4242
applicationId "com.android.babylonnative.playground"
4343
minSdkVersion "${platformVersion}"
4444
targetSdkVersion 28
45+
ndkVersion "23.1.7779620"
46+
if (project.hasProperty("NDK_VERSION")) {
47+
def NDKVersion = project.property("NDK_VERSION")
48+
ndkVersion "${NDK_VERSION}"
49+
}
4550
externalNativeBuild {
4651
cmake {
4752
abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
@@ -61,10 +66,6 @@ android {
6166
} else {
6267
abiFilters "arm64-v8a", "armeabi-v7a", "x86"
6368
}
64-
if (project.hasProperty("NDK_VERSION")) {
65-
def NDKVersion = project.property("NDK_VERSION")
66-
ndkVersion "${NDK_VERSION}"
67-
}
6869
}
6970
}
7071

Apps/Playground/Android/app/src/main/cpp/BabylonNativeJNI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ extern "C"
119119

120120
g_nativeInput = &Babylon::Plugins::NativeInput::CreateForJavaScript(env);
121121

122-
Babylon::Plugins::Camera::Initialize(env);
122+
Babylon::Plugins::NativeCamera::Initialize(env);
123123
Babylon::Polyfills::Window::Initialize(env);
124124

125125
Babylon::Polyfills::XMLHttpRequest::Initialize(env);

Apps/Playground/Android/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ buildscript {
44

55
repositories {
66
google()
7+
mavenCentral()
78
jcenter()
89
}
910
dependencies {
@@ -17,6 +18,7 @@ buildscript {
1718
allprojects {
1819
repositories {
1920
google()
21+
mavenCentral()
2022
jcenter()
2123
}
2224
}

Apps/Playground/UWP/App.cpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,25 @@
1010
#include <Babylon/Polyfills/XMLHttpRequest.h>
1111
#include <Babylon/Polyfills/Canvas.h>
1212

13-
#include <pplawait.h>
14-
#include <winrt/Windows.ApplicationModel.h>
15-
1613
#include <winrt/windows.ui.core.h>
1714

15+
namespace
16+
{
17+
template <typename T>
18+
T from_cx(Platform::Object^ from)
19+
{
20+
T to{ nullptr };
21+
22+
if (from != nullptr)
23+
{
24+
winrt::check_hresult(reinterpret_cast<::IUnknown*>(from)
25+
->QueryInterface(winrt::guid_of<T>(), winrt::put_abi(to)));
26+
}
27+
28+
return to;
29+
}
30+
}
31+
1832
using namespace Windows::ApplicationModel;
1933
using namespace Windows::ApplicationModel::Core;
2034
using namespace Windows::ApplicationModel::Activation;
@@ -348,7 +362,7 @@ void App::RestartRuntime(Windows::Foundation::Rect bounds)
348362
m_displayScale = static_cast<float>(displayInformation->RawPixelsPerViewPixel);
349363
size_t width = static_cast<size_t>(bounds.Width * m_displayScale);
350364
size_t height = static_cast<size_t>(bounds.Height * m_displayScale);
351-
auto* window = reinterpret_cast<winrt::Windows::UI::Core::ICoreWindow*>(CoreWindow::GetForCurrentThread());
365+
auto window = from_cx<winrt::Windows::Foundation::IInspectable>(CoreWindow::GetForCurrentThread());
352366

353367
Babylon::Graphics::WindowConfiguration graphicsConfig{};
354368
graphicsConfig.Window = window;

Apps/Playground/Win32/App.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ namespace
142142
Babylon::Plugins::NativeCapture::Initialize(env);
143143

144144
// Initialize Camera
145-
Babylon::Plugins::Camera::Initialize(env);
145+
Babylon::Plugins::NativeCamera::Initialize(env);
146146

147147
// Initialize NativeXr plugin.
148148
Babylon::Plugins::NativeXr::Initialize(env);

Apps/Playground/iOS/LibNativeBridge.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ - (void)init:(MTKView*)view width:(int)inWidth height:(int)inHeight xrView:(void
7676
g_nativeXr->SetSessionStateChangedCallback([](bool isXrActive){ g_isXrActive = isXrActive; });
7777

7878
// Initialize Camera
79-
Babylon::Plugins::Camera::Initialize(env);
79+
Babylon::Plugins::NativeCamera::Initialize(env);
8080

8181
nativeInput = &Babylon::Plugins::NativeInput::CreateForJavaScript(env);
8282
});

0 commit comments

Comments
 (0)