{"id":21487000,"url":"https://github.com/sbarisic/nukleardotnet","last_synced_at":"2025-08-19T21:31:52.133Z","repository":{"id":48521005,"uuid":"116756719","full_name":"sbarisic/NuklearDotNet","owner":"sbarisic","description":".NET binding for the Nuklear immediate mode GUI","archived":false,"fork":false,"pushed_at":"2023-12-26T13:27:25.000Z","size":5657,"stargazers_count":188,"open_issues_count":9,"forks_count":15,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-23T13:28:18.911Z","etag":null,"topics":["binding","csharp","dotnet","dotnet-framework","gui","imgui","nuklear","pinvoke"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbarisic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-01-09T02:45:19.000Z","updated_at":"2024-11-13T19:51:32.000Z","dependencies_parsed_at":"2022-07-26T17:32:11.241Z","dependency_job_id":null,"html_url":"https://github.com/sbarisic/NuklearDotNet","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbarisic%2FNuklearDotNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbarisic%2FNuklearDotNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbarisic%2FNuklearDotNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbarisic%2FNuklearDotNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbarisic","download_url":"https://codeload.github.com/sbarisic/NuklearDotNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230367928,"owners_count":18215338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binding","csharp","dotnet","dotnet-framework","gui","imgui","nuklear","pinvoke"],"created_at":"2024-11-23T13:25:42.857Z","updated_at":"2024-12-19T03:10:22.500Z","avatar_url":"https://github.com/sbarisic.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NuklearDotNet\nLICENSE: Dual-licensed under MIT and The Unlicense. Your choice.\n\n.NET binding for the Nuklear immediate mode GUI\nhttps://github.com/vurtun/nuklear\n\nNuklearSharp ( https://github.com/leafi/NuklearSharp ) was my original inspiration for this.\n\nNo original nuklear source files were modified. A project was created with some support code \nto build Nuklear.dll (x64) with all API functions exported and ready to be used from .NET\n\nUpdating should be as easy as updating the submodule and rebuilding the project.\n\nCurrently this binding is used in my game engine project, so i implement stuff as i need it.\nhttps://github.com/sbarisic/libTech\n\nContributions welcome.\n\n# Implemented devices\n\n* Raylib\nIn the example project, this binding was directly included\nhttps://github.com/ChrisDill/Raylib-cs\n\n* SFML\n\n# Screenshots\n\n![alt text](https://raw.githubusercontent.com/sbarisic/NuklearDotNet/master/screenshots/a.png \"Hello World!\")\n\n# Code samples\n\nThe custom device class implements actual drawing functions,\nit has to inherit from at least NuklearDevice.\nNuklearDeviceTex\u003cT\u003e allows you to specify your custom texture class which\nreplaces the internal texture handle integers, just for convenience. You can return\nyour own texture handle integers in NuklearDevice and handle textures manually.\n\nOptionally it can implement the IFrameBuffered interface which calls the Render\nfunction only when the GUI actually changes. It it supposed to be rendered to a framebuffer\nwhich is in turn rendered to the screen every frame in RenderFinal\n\n```cs\nclass Device : NuklearDeviceTex\u003cTexture\u003e, IFrameBuffered {\n\tpublic override Texture CreateTexture(int W, int H, IntPtr Data) {\n\t\t// Create a texture from raw image data\n\t\treturn null;\n\t}\n\n\tvoid IFrameBuffered.BeginBuffering() {\n\t\t// Begin rendering to framebuffer\n\t}\n\t\n\tpublic override void SetBuffer(NkVertex[] VertexBuffer, ushort[] IndexBuffer) {\n\t\t// Called once before Render, upload your vertex buffer and index buffer here\n\t}\n\n\tpublic override void Render(NkHandle Userdata, Texture Texture, NkRect ClipRect, uint Offset, uint Count) {\n\t\t// Render to either framebuffer or screen\n\t\t// If IFrameBuffered isn't implemented, it's called every frame, else only when the GUI actually changes\n\t\t// Called multiple times per frame, uses the vertex and index buffer that has been sent to SetBuffer\n\t}\n\n\tvoid IFrameBuffered.EndBuffering() {\n\t\t// End rendering to frame buffer\n\t}\n\n\tvoid IFrameBuffered.RenderFinal() {\n\t\t// Called each frame, render to screen finally\n\t}\n}\n```\n\nSending events; just call these when you capture the events from your input API. It's irrelevant when they're called.\nThey are internally queued and dispatched to Nuklear on every frame.\n\n\n```cs\n\tDevice.OnMouseButton(Button, X, Y, Down)\n\tDevice.OnMouseMove(X, Y)\n\tDevice.OnScroll(X, Y)\n\tDevice.OnText(Text)\n\tDevice.OnKey(Key, Down)\n```\n\nUsing the GUI, note that the while loop represents an OnRender function in your renderer code. At the end of the Frame\ncall, the actual rendering functions are dispatched.\n\n```cs\nNuklearAPI.Init(Device);\n\nwhile (true) {\n\n\t// Optional\n\tNuklearAPI.SetDeltaTime(Dt);\n\t\n\tNuklearAPI.Frame(() =\u003e {\n\t\tNuklearAPI.Window(\"Test Window\", 100, 100, 200, 200, Flags, () =\u003e {\n\t\t\tNuklearAPI.LayoutRowDynamic(35);\n\t\t\t\n\t\t\tif (NuklearAPI.ButtonLabel(\"Some Button\"))\n\t\t\t\tConsole.WriteLine(\"You pressed Some Button!\");\n\t\t});\n\t});\n\n}\n\n```\n\n# TODO\n\n* Demo application\n* Higher level binding\n* Support for multiple contexts, want to draw a GUI and some example on a 3D in-game screen at the same time?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbarisic%2Fnukleardotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbarisic%2Fnukleardotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbarisic%2Fnukleardotnet/lists"}