Skip to content

Conversation

@hwarmington
Copy link
Contributor

No description provided.

@hwarmington hwarmington marked this pull request as ready for review March 26, 2025 05:31
Napi::Value Context::GetCanvas(const Napi::CallbackInfo& info)
{
throw Napi::Error::New(info.Env(), "not implemented");
return m_canvas->Value();
Copy link
Contributor

Choose a reason for hiding this comment

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

This returns NULL value and this code:

return Napi::Pointer<NativeCanvas>::Create(info.Env(), m_canvas);

returns an object that doesn't support getContext.
I tried to do a loop back like this in exprience.js :

context = context.canvas.getContext();

Any idea @bghgary ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ping me offline.

Copy link
Contributor

Choose a reason for hiding this comment

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

After chatting with Gary, there are a few changes needed in Canvas/Context to make it more robust. I can take care of these changes.

@CedricGuillemet
Copy link
Contributor

Replacement PR : #1491 . Closing.

CedricGuillemet added a commit that referenced this pull request Apr 4, 2025
Replaces #1488

- Fix wrongly named `CreateInstance` with `Initialize`
- Canvas/Context unit test
- Implement `GetCanvas`
- Fix parameters and objectReference between Canvas and Context
- Keep and return the object reference created with `getContext`
- Install specified CMake version for Windows platform (see
#1492 )
- Update to Babylon.js 8.0

---------

Co-authored-by: Sergio R. Z. Masson <[email protected]>
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.

3 participants