Skip to content

[contrib.glfw3] new project version 3.4.0.20240731 #22303

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged

Conversation

ypujante
Copy link
Contributor

This contains 2 new versions with the following release notes for the underlying project:

3.4.0.20240731 - 2024-07-31

  • Added emscripten_glfw_get_clipboard_string the C version of emscripten::glfw3::GetClipboardString to
    retrieve the clipboard asynchronously
  • Added a helper class emscripten::glfw3::FutureClipboardString to greatly simplify the more frequent use-cases
  • GetClipboardString::value() now returns the internal clipboard in case of error, instead of throwing exception
  • Added optimizationLevel option to the emscripten port

3.4.0.20240727 - 2024-07-27

  • Introduced C++ API (namespace emscripten::glfw3) included with GLFW3/emscripten_glfw3.h:
    • provides a more correct API with sensible defaults (ex: std::string_view / std::optional<std::string_view>
      vs char const * which may or may not be nullptr)
    • allow for C++ only API (ex: std::future)
    • the C API is still available if you would rather stick to it
  • Implemented emscripten::glfw3::GetClipboardString which provides a way of fetching the global
    clipboard in a browser environment (glfwGetClipboardString is not the right API due to the asynchronous nature
    of the underlying platform API).
  • The cursor position is no longer clamped to the window size, and as a result, can have negative values or values
    greater than the window size.
    Note that GLFW implements a similar behavior on the macOS desktop platform.
  • Implemented glfwSetWindowPosCallback
  • Added support for GLFW Window Attribute GLFW_HOVERED
  • Fixed #6: emscripten_glfw_make_canvas_resizable does not clean up properly.
  • Fixed an issue with opacity: when using opacity, the handle is not working unless its z-index is higher than the
    canvas z-index

@ypujante
Copy link
Contributor Author

ypujante commented Aug 2, 2024

@sbc100 Hi Sam. All tests are passing. Any chance my PR gets in before the next emscripten release? I have some changes (async clipboard access) that are pretty important for a problem I am trying to solve in ImGui.

I also wanted to let you know a few things:

  • contrib.glfw3 is now officially supported in ImGui since the latest release (1.91.0) and that is really cool :). As far as I know this is the first project with official support.
  • I released an actual application/tool that uses contrib.glfw3 and ImGui: WebGPU Shader Toy
  • For the purpose of this tool, I actually turned ImGui into an emscripten port which is by far the most complex port I wrote so far. But it is really cool because it makes using ImGui trivial: --use-port=imgui.py:backend=glfw:renderer=wgpu

@sbc100 sbc100 merged commit 4a98562 into emscripten-core:main Aug 2, 2024
27 checks passed
@sbc100
Copy link
Collaborator

sbc100 commented Aug 2, 2024

  • I released an actual application/tool that uses contrib.glfw3 and ImGui: WebGPU Shader Toy

Nice! @kainino0x might be interested in that

@ypujante
Copy link
Contributor Author

ypujante commented Aug 2, 2024

Thank you @sbc100!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

emscripten_glfw_make_canvas_resizable does not cleanup properly
2 participants