You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have a problem with multiple Nuklear windows
When I add another window, the events on the first one are not handled correctly anymore
For example, hovers only work when I also left-click and mouse scroll not work
Everything work when I use only one window
Here is in pseudo-code how its done:
update_gui_events()
{
nk_input_begin(context);
// ...// Calls to nk_input_*** to send inputs to Nuklear based on the current state// I'm using NK_KEYSTATE_BASED_INPUT// ...nk_input_end(context);
}
generate_gui()
{
if (nk_begin_titled(context, "win1", ...)
{
// ... Window 1 content
}
nk_end(context);
if (nk_begin_titled(context, "win2", ...)
{
// ... Window 2 content
}
nk_end(context);
// Hack// If I uncomment this line, the hover events seems to work on both windows// but the scroll problem is still present// nk_window_set_focus(context, "win1");
}
render_gui()
{
// ...// Engine specific calls to init the render// ...nk_buffer_init_fixed(&vertices, ...);
nk_buffer_init_fixed(&elements, ...);
nk_convert(ctx, command_buffer, &vertices, &elements, ...);
nk_draw_foreach(cmd, ctx, command_buffer)
{
// ...// Engine specific calls to draw the vertices// ...
}
nk_clear(ctx);
nk_buffer_free(&vertices);
nk_buffer_free(&elements);
// ...// Engine specific calls to end the render// ...
}
Then on each frame
update_gui_events()
generate_gui()
render_gui();
The text was updated successfully, but these errors were encountered:
Hi, I have a problem with multiple Nuklear windows
When I add another window, the events on the first one are not handled correctly anymore
For example, hovers only work when I also left-click and mouse scroll not work
Everything work when I use only one window
Here is in pseudo-code how its done:
Then on each frame
update_gui_events() generate_gui() render_gui();
The text was updated successfully, but these errors were encountered: