Skip to content
This repository was archived by the owner on Dec 2, 2019. It is now read-only.

Conversation

@maddouri
Copy link

@maddouri maddouri commented Oct 21, 2018

Hi,

Its great that Nuklear doesn't depend on globals.
However, some of the demos do. This could be a problem if we want to create multiple windows with their own, separate states/contexts. (e.g. #451)

This PR is an attempt to get rid of the global state for the glfw_opengl3 demo.

EDIT: I forgot to mention that:

  1. I have also fixed what appears to be a typo:
    • nk_gflw3_scroll_callback() -> nk_glfw3_scroll_callback()
  2. I could remove the global state from other GLFW demos if this PR is accepted

* Embedd the GLFW state structure as a user pointer in the window
* For the callbacks, point to the GLFW state using nk_handle.ptr
* This should prevent segfaults when compiling w/ -O2
  and defining INCLUDE_ALL
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant