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
No original nuklear source files were modified. A project was created with some support code
to build Nuklear.dll (x64) with all API functions exported and ready to be used from .NET
Updating should be as easy as updating the submodule and rebuilding the project.
The custom device class implements actual drawing functions,
it has to inherit from at least NuklearDevice.
NuklearDeviceTex allows you to specify your custom texture class which
replaces the internal texture handle integers, just for convenience. You can return
your own texture handle integers in NuklearDevice and handle textures manually.
Optionally it can implement the IFrameBuffered interface which calls the Render
function only when the GUI actually changes. It it supposed to be rendered to a framebuffer
which is in turn rendered to the screen every frame in RenderFinal
classDevice:NuklearDeviceTex<Texture>,IFrameBuffered{publicoverrideTextureCreateTexture(intW,intH,IntPtrData){// Create a texture from raw image datareturnnull;}voidIFrameBuffered.BeginBuffering(){// Begin rendering to framebuffer}publicoverridevoidSetBuffer(NkVertex[]VertexBuffer,ushort[]IndexBuffer){// Called once before Render, upload your vertex buffer and index buffer here}publicoverridevoidRender(NkHandleUserdata,TextureTexture,NkRectClipRect,uintOffset,uintCount){// Render to either framebuffer or screen// If IFrameBuffered isn't implemented, it's called every frame, else only when the GUI actually changes// Called multiple times per frame, uses the vertex and index buffer that has been sent to SetBuffer}voidIFrameBuffered.EndBuffering(){// End rendering to frame buffer}voidIFrameBuffered.RenderFinal(){// Called each frame, render to screen finally}}
Sending events; just call these when you capture the events from your input API. It's irrelevant when they're called.
They are internally queued and dispatched to Nuklear on every frame.
Using the GUI, note that the while loop represents an OnRender function in your renderer code. At the end of the Frame
call, the actual rendering functions are dispatched.
NuklearAPI.Init(Device);while(true){// OptionalNuklearAPI.SetDeltaTime(Dt);NuklearAPI.Frame(()=>{NuklearAPI.Window("Test Window",100,100,200,200,Flags,()=>{NuklearAPI.LayoutRowDynamic(35);if(NuklearAPI.ButtonLabel("Some Button"))Console.WriteLine("You pressed Some Button!");});});}
TODO
Demo application
Higher level binding
Support for multiple contexts, want to draw a GUI and some example on a 3D in-game screen at the same time?