1 /********************************************************************************************** 2 * 3 * raylib-nuklear - Nuklear for Raylib. 4 * 5 * FEATURES: 6 * - Use the nuklear immediate-mode graphical user interface in raylib. 7 * 8 * DEPENDENCIES: 9 * - raylib 4.2 https://www.raylib.com/ 10 * - nuklear https://github.com/Immediate-Mode-UI/Nuklear 11 * 12 * LICENSE: zlib/libpng 13 * 14 * raylib-nuklear is licensed under an unmodified zlib/libpng license, which is an OSI-certified, 15 * BSD-like license that allows static linking with closed source software: 16 * 17 * Copyright (c) 2020 Rob Loach (@RobLoach) 18 * 19 * This software is provided "as-is", without any express or implied warranty. In no event 20 * will the authors be held liable for any damages arising from the use of this software. 21 * 22 * Permission is granted to anyone to use this software for any purpose, including commercial 23 * applications, and to alter it and redistribute it freely, subject to the following restrictions: 24 * 25 * 1. The origin of this software must not be misrepresented; you must not claim that you 26 * wrote the original software. If you use this software in a product, an acknowledgment 27 * in the product documentation would be appreciated but is not required. 28 * 29 * 2. Altered source versions must be plainly marked as such, and must not be misrepresented 30 * as being the original software. 31 * 32 * 3. This notice may not be removed or altered from any source distribution. 33 * 34 **********************************************************************************************/ 35 36 module raylib_nuklear; 37 38 import raylib; 39 public import nuklear; 40 41 extern (C) @nogc nothrow: 42 43 nk_context* InitNuklear (int fontSize); // Initialize the Nuklear GUI context 44 nk_context* InitNuklearEx (Font font, float fontSize); // Initialize the Nuklear GUI context, with a custom font 45 void UpdateNuklear (nk_context* ctx); // Update the input state and internal components for Nuklear 46 void DrawNuklear (nk_context* ctx); // Render the Nuklear GUI on the screen 47 void UnloadNuklear (nk_context* ctx); // Deinitialize the Nuklear context 48 nk_color ColorToNuklear (Color color); // Convert a raylib Color to a Nuklear color object 49 nk_colorf ColorToNuklearF (Color color); // Convert a raylib Color to a Nuklear floating color 50 Color ColorFromNuklear (nk_color color); // Convert a Nuklear color to a raylib Color 51 Color ColorFromNuklearF (nk_colorf color); // Convert a Nuklear floating color to a raylib Color 52 Rectangle RectangleFromNuklear (nk_context* ctx, nk_rect_ rect); // Convert a Nuklear rectangle to a raylib Rectangle 53 nk_rect_ RectangleToNuklear (nk_context* ctx, Rectangle rect); // Convert a raylib Rectangle to a Nuklear Rectangle 54 nk_image_ TextureToNuklear (Texture tex); // Convert a raylib Texture to A Nuklear image 55 Texture TextureFromNuklear (nk_image_ img); // Convert a Nuklear image to a raylib Texture 56 nk_image_ LoadNuklearImage (const(char)* path); // Load a Nuklear image 57 void UnloadNuklearImage (nk_image_ img); // Unload a Nuklear image. And free its data 58 void CleanupNuklearImage (nk_image_ img); // Frees the data stored by the Nuklear image 59 void SetNuklearScaling (nk_context* ctx, float scaling); // Sets the scaling for the given Nuklear context 60 float GetNuklearScaling (nk_context* ctx); // Retrieves the scaling of the given Nuklear context 61 62 // RAYLIB_NUKLEAR_H