Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Questions on porting this to GLFW #4

Open
sro5h opened this issue Nov 1, 2021 · 0 comments
Open

Questions on porting this to GLFW #4

sro5h opened this issue Nov 1, 2021 · 0 comments

Comments

@sro5h
Copy link

sro5h commented Nov 1, 2021

I am trying to port this to GLFW and have a few question regarding the implementation. When defining the observer for Sdl2DestroyWindow the Sdl2Window parameter is marked with [in] and () at the end.

  1. Shouldn't that be [inout] as SDL_DestroyWindow changes the data referenced by the Sdl2Window component?
  2. As far as i understand the parantheses at the end they define an empty predicate that always evaluates to true. So is the expression equivalent to [in] ?flecs.systems.sdl2.window.Window?
  3. If so, why is the Sdl2Window parameter for the SdlDestroyWindow observer marked as optional?

Furthermore i have the problem that GLFW uses callbacks to pass on input events. I tried to pass the ecs_world_t to the callback as a context parameter and used ecs_singleton_get_mut(EcsInput). But then i hit an assert telling me that the world is in readonly mode. How can i modify components from callbacks?

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

No branches or pull requests

1 participant