Custom rendering inside windows
Hello! I've been messing around with Nuklear, and I have to say, this is very cool library you have here, and also very well-organized!
The only real roadblock I have hit with it is that I can't do any custom rendering inside the windows. Custom OpenGL code inside a window, for example.
I've tried callbacks so far, thinking that any rendering within them would be called on top of the window that they belong to. As it turns out, the callbacks get processed/executed inside nk_convert, before any window drawing happens, so my triangle test gets covered up with the window I'm trying to target. The SDL2 OpenGL ES 2 demo has been my testbed, so I commented out the line glDrawElements(GL_TRIANGLES, (GLsizei)cmd->elem_count, GL_UNSIGNED_SHORT, offset); to see what the result would be. As expected, the windows are no longer rendered, and the triangle test is drawn exactly where it should be.
Another thing I have tried was hackishly setting up the triangle test to render based on userdata. It almost worked, but userdata doesn't seem to work per-window, so windows dragged over it render behind it, while the window borders/buttons are in front of it.
The last thing I tried was using widgets to get the job done, but once again, no dice. Like the other two solutions, widgets don't seem geared toward plugging custom rendering routines into specific parts of windows.
Of all three attempts, the callback method with nk_push_custom has been the cleanest and most favorable, except all the windows draw on top of it.
Is there something I'm missing? I've been scouring the source code and demos to no avail. Is there any function that can be called similarly to nk_push_custom (nk_push_custom(nk_window_get_canvas(ctx),nk_window_get_content_region(ctx),triangle_test,nk_handle_ptr(NULL));) which will do exactly the same thing, but on top of the window it belongs to instead of behind it? Or is this currently impossible in Nuklear?
Any suggestions would be nice, thank you!
Source: vurtun/nuklear