4848extern "C" {
4949#endif
5050
51- NK_API struct nk_context * InitNuklear (int fontSize ); // Initialize the Nuklear GUI context.
52- NK_API struct nk_context * InitNuklearEx (Font font , float fontSize ); // Initialize the Nuklear GUI context, with a custom font.
53- NK_API void UpdateNuklear (struct nk_context * ctx ); // Update the input state and internal components for Nuklear.
54- NK_API void DrawNuklear (struct nk_context * ctx ); // Render the Nuklear GUI on the screen.
55- NK_API void UnloadNuklear (struct nk_context * ctx ); // Deinitialize the Nuklear context.
56- NK_API struct nk_color ColorToNuklear (Color color ); // Convert a raylib Color to a Nuklear color object.
57- NK_API struct nk_colorf ColorToNuklearF (Color color ); // Convert a raylib Color to a Nuklear floating color.
58- NK_API struct Color ColorFromNuklear (struct nk_color color ); // Convert a Nuklear color to a raylib Color.
59- NK_API struct Color ColorFromNuklearF (struct nk_colorf color ); // Convert a Nuklear floating color to a raylib Color.
60- NK_API struct Rectangle RectangleFromNuklear (struct nk_rect rect ); // Convert a Nuklear rectangle to a raylib Rectangle.
61- NK_API struct nk_rect RectangleToNuklear (Rectangle rect ); // Convert a raylib Rectangle to a Nuklear Rectangle.
62- NK_API struct nk_image TextureToNuklear (Texture tex ); // Convert a raylib Texture to A Nuklear image.
51+ NK_API struct nk_context * InitNuklear (int fontSize ); // Initialize the Nuklear GUI context
52+ NK_API struct nk_context * InitNuklearEx (Font font , float fontSize ); // Initialize the Nuklear GUI context, with a custom font
53+ NK_API void UpdateNuklear (struct nk_context * ctx ); // Update the input state and internal components for Nuklear
54+ NK_API void DrawNuklear (struct nk_context * ctx ); // Render the Nuklear GUI on the screen
55+ NK_API void UnloadNuklear (struct nk_context * ctx ); // Deinitialize the Nuklear context
56+ NK_API struct nk_color ColorToNuklear (Color color ); // Convert a raylib Color to a Nuklear color object
57+ NK_API struct nk_colorf ColorToNuklearF (Color color ); // Convert a raylib Color to a Nuklear floating color
58+ NK_API struct Color ColorFromNuklear (struct nk_color color ); // Convert a Nuklear color to a raylib Color
59+ NK_API struct Color ColorFromNuklearF (struct nk_colorf color ); // Convert a Nuklear floating color to a raylib Color
60+ NK_API struct Rectangle RectangleFromNuklear (struct nk_rect rect ); // Convert a Nuklear rectangle to a raylib Rectangle
61+ NK_API struct nk_rect RectangleToNuklear (Rectangle rect ); // Convert a raylib Rectangle to a Nuklear Rectangle
62+ NK_API struct nk_image TextureToNuklear (Texture tex ); // Convert a raylib Texture to A Nuklear image
6363NK_API struct Texture TextureFromNuklear (struct nk_image img ); // Convert a Nuklear image to a raylib Texture
64- NK_API struct nk_image LoadNuklearImage (const char * path ); // Load a Nuklear image.
64+ NK_API struct nk_image LoadNuklearImage (const char * path ); // Load a Nuklear image
6565NK_API void UnloadNuklearImage (struct nk_image img ); // Unload a Nuklear image. And free its data
6666NK_API void CleanupNuklearImage (struct nk_image img ); // Frees the data stored by the Nuklear image
6767
@@ -750,19 +750,19 @@ NK_API struct nk_image TextureToNuklear(Texture tex)
750750 // For the texture
751751 struct nk_image img ;
752752 Texture * stored_tex = malloc (sizeof (Texture ));
753-
753+
754754 // Copy the data from the texture given into the new texture
755755 stored_tex -> id = tex .id ;
756756 stored_tex -> width = tex .width ;
757757 stored_tex -> height = tex .height ;
758758 stored_tex -> mipmaps = tex .mipmaps ;
759759 stored_tex -> format = tex .format ;
760-
760+
761761 // Initialize the nk_image struct
762762 img .handle .ptr = stored_tex ;
763- img .w = stored_tex -> width ;
764- img .h = stored_tex -> height ;
765-
763+ img .w = ( nk_ushort ) stored_tex -> width ;
764+ img .h = ( nk_ushort ) stored_tex -> height ;
765+
766766 return img ;
767767}
768768
@@ -775,14 +775,14 @@ NK_API struct Texture TextureFromNuklear(struct nk_image img)
775775 // And get back the stored texture
776776 Texture tex ;
777777 Texture * stored_tex = (Texture * )img .handle .ptr ;
778-
778+
779779 // Copy the data from the stored texture to the texture
780780 tex .id = stored_tex -> id ;
781781 tex .width = stored_tex -> width ;
782782 tex .height = stored_tex -> height ;
783783 tex .mipmaps = stored_tex -> mipmaps ;
784784 tex .format = stored_tex -> format ;
785-
785+
786786 return tex ;
787787}
788788
@@ -793,8 +793,7 @@ NK_API struct Texture TextureFromNuklear(struct nk_image img)
793793 */
794794NK_API struct nk_image LoadNuklearImage (const char * path )
795795{
796- Texture tex = LoadTexture (path );
797- return TextureToNuklear (tex );
796+ return TextureToNuklear (LoadTexture (path ));
798797}
799798
800799/**
@@ -806,7 +805,7 @@ NK_API void UnloadNuklearImage(struct nk_image img)
806805{
807806 Texture tex = TextureFromNuklear (img );
808807 UnloadTexture (tex );
809- free (img . handle . ptr );
808+ CleanupNuklearImage (img );
810809}
811810
812811/**
0 commit comments