Skip to content

PoC asset loading plugin - #130

Closed
CedricGuillemet wants to merge 10 commits into
BabylonJS:masterfrom
CedricGuillemet:assetLoadingPlugin
Closed

PoC asset loading plugin#130
CedricGuillemet wants to merge 10 commits into
BabylonJS:masterfrom
CedricGuillemet:assetLoadingPlugin

Conversation

@CedricGuillemet

@CedricGuillemet CedricGuillemet commented Jan 7, 2020

Copy link
Copy Markdown
Collaborator

This is a Proof of concept for plugins and more particularly asset loading/http requests.
Remarks/critics/ideas/... hugely welcome. I guess you have a better/more clear view of the plugin architecture :)

I added a Plugins folder at the root. Then 1 subfolder per plugin.
Console is a simple example.

#include <Console/Console.h>

then

runtime->Dispatch([](Babylon::Env& env)
        {
            Babylon::Console::CreateInstance(env, [](const char* message, auto)
            {
                OutputDebugStringA(message);
            });
        });

Things get more complicated with HTTP requests:

  • There might be some CPP involved. Do we create a plugin CMake to make a library or let Apps do it?
  • XMLHttpRequest has a depedency on Arcana. How can we avoid it?
  • Is there a better place in the directory tree for these files ?

An example of use on Android is:

#include <XMLHttpRequest/Android/XMLHttpRequestAndroid.h>

then in the App:

runtime->Dispatch([](Babylon::Env& env)
        {
            Babylon::XMLHttpRequestAndroid::CreateInstance(env, asset_manager);
        });

It doesn't build, don't even try.

@CedricGuillemet

CedricGuillemet commented Jan 14, 2020

Copy link
Copy Markdown
Collaborator Author

@bghgary @syntheticmagus

I did some changes and got some issues I need help with.

Changes:

Issues:

  • I get a crash when calling eventHandlerRef.Call({}); from SetReadyState. I don't know yet why it's failing


if (length != nullptr) {
*length = stringLength;
*length = ::WideCharToMultiByte(codePage, 0, stringValue, static_cast<int>(stringLength), nullptr, 0, nullptr, nullptr);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, don't call WideCharToMultiByte twice if both length and buffer are specified.

@CedricGuillemet

Copy link
Copy Markdown
Collaborator Author

Closing PR

CedricGuillemet added a commit to CedricGuillemet/BabylonNative that referenced this pull request Sep 2, 2026
9a569c7759 Merge pull request BabylonJS#144 from BabylonJS/bump/bgfx-swapchain2-guid
96add67bf0 Bump bgfx for IID_IDXGISwapChain2 GUID fix
ede5513a6b Merge pull request BabylonJS#143 from BabylonJS/bump/bgfx-uwp-frame-latency
67b4b74122 Bump bgfx for UWP IDXGISwapChain2 frame-latency fix
1a135dbf90 Updated bgfx and bx. (BabylonJS#142)
9e56bab412 Updated bgfx, bimg and bx. (BabylonJS#141)
865b8e6afe Updated bgfx. (BabylonJS#140)
06755e6bb8 Updated bgfx, bimg and bx. (BabylonJS#139)
f7333d92a0 Forward the remaining allocation-sizing BGFX_CONFIG_ settings (BabylonJS#138)
e7773eed1d Honor BGFX_CONFIG_ settings set by a parent project (BabylonJS#137)
5c98749de4 Merge pull request BabylonJS#135 from BabylonJS/sergio/sse4-minspec-x86-slices
92961f9ac4 Updated bgfx and bimg. (BabylonJS#136)
9d89f09347 Apply bx's SSE4.2 minspec to every x86 target, not just x86_64
6c5515826c Don't let -Xarch_x86_64 break Apple builds that use -Werror. (BabylonJS#134)
7062f1109a Fix arm64 builds: Apple SSE minspec and MSVC ARM64 (BabylonJS#133)
44adc64c88 Updated bgfx and bx. (BabylonJS#131)
8f7e445593 Merge pull request BabylonJS#130 from SergioRZMasson/fix-x86_64-sse-minspec
dd5bb1c019 Bump bx submodule to include the Windows platform.h fixes
191b723258 Propagate bx's x86_64 SSE4.2 minspec to the bx target
3b67f0c0c5 Updated bx, and bimg. (BabylonJS#129)
4c244b1a9f Updated bgfx, bimg, bx. (BabylonJS#128)

git-subtree-dir: Dependencies/bgfx.cmake
git-subtree-split: 9a569c775917e3dd2a8cfb8836aeddbe790a8deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants