|
@@ -32,6 +32,28 @@
|
|
|
|
|
|
#include "raylib.h"
|
|
#include "raylib.h"
|
|
|
|
|
|
|
|
+// Function specifiers in case library is build/used as a shared library
|
|
|
|
+// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll
|
|
|
|
+// NOTE: visibility("default") attribute makes symbols "visible" when compiled with -fvisibility=hidden
|
|
|
|
+#if defined(_WIN32)
|
|
|
|
+#if defined(__TINYC__)
|
|
|
|
+#define __declspec(x) __attribute__((x))
|
|
|
|
+#endif
|
|
|
|
+#if defined(BUILD_LIBTYPE_SHARED)
|
|
|
|
+#define RLIMGUIAPI __declspec(dllexport) // We are building the library as a Win32 shared library (.dll)
|
|
|
|
+#elif defined(USE_LIBTYPE_SHARED)
|
|
|
|
+#define RLIMGUIAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll)
|
|
|
|
+#endif
|
|
|
|
+#else
|
|
|
|
+#if defined(BUILD_LIBTYPE_SHARED)
|
|
|
|
+#define RLIMGUIAPI __attribute__((visibility("default"))) // We are building as a Unix shared library (.so/.dylib)
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifndef RLIMGUIAPI
|
|
|
|
+#define RLIMGUIAPI // Functions defined as 'extern' by default (implicit specifiers)
|
|
|
|
+#endif
|
|
|
|
+
|
|
#ifndef NO_FONT_AWESOME
|
|
#ifndef NO_FONT_AWESOME
|
|
#include "extras/IconsFontAwesome6.h"
|
|
#include "extras/IconsFontAwesome6.h"
|
|
#define FONT_AWESOME_ICON_SIZE 11
|
|
#define FONT_AWESOME_ICON_SIZE 11
|
|
@@ -50,25 +72,25 @@ extern "C" {
|
|
/// Calls ImGui_ImplRaylib_Init and sets the theme. Will install Font awesome by default
|
|
/// Calls ImGui_ImplRaylib_Init and sets the theme. Will install Font awesome by default
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="darkTheme">when true(default) the dark theme is used, when false the light theme is used</param>
|
|
/// <param name="darkTheme">when true(default) the dark theme is used, when false the light theme is used</param>
|
|
-void rlImGuiSetup(bool darkTheme);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiSetup(bool darkTheme);
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Starts a new ImGui Frame
|
|
/// Starts a new ImGui Frame
|
|
/// Calls ImGui_ImplRaylib_NewFrame, ImGui_ImplRaylib_ProcessEvents, and ImGui::NewFrame together
|
|
/// Calls ImGui_ImplRaylib_NewFrame, ImGui_ImplRaylib_ProcessEvents, and ImGui::NewFrame together
|
|
/// </summary>
|
|
/// </summary>
|
|
-void rlImGuiBegin(void);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiBegin(void);
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Ends an ImGui frame and submits all ImGui drawing to raylib for processing.
|
|
/// Ends an ImGui frame and submits all ImGui drawing to raylib for processing.
|
|
/// Calls ImGui:Render, an d ImGui_ImplRaylib_RenderDrawData to draw to the current raylib render target
|
|
/// Calls ImGui:Render, an d ImGui_ImplRaylib_RenderDrawData to draw to the current raylib render target
|
|
/// </summary>
|
|
/// </summary>
|
|
-void rlImGuiEnd(void);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiEnd(void);
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Cleanup ImGui and unload font atlas
|
|
/// Cleanup ImGui and unload font atlas
|
|
/// Calls ImGui_ImplRaylib_Shutdown
|
|
/// Calls ImGui_ImplRaylib_Shutdown
|
|
/// </summary>
|
|
/// </summary>
|
|
-void rlImGuiShutdown(void);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiShutdown(void);
|
|
|
|
|
|
// Advanced StartupAPI
|
|
// Advanced StartupAPI
|
|
|
|
|
|
@@ -77,19 +99,19 @@ void rlImGuiShutdown(void);
|
|
/// must be followed by rlImGuiEndInitImGui
|
|
/// must be followed by rlImGuiEndInitImGui
|
|
/// Called by ImGui_ImplRaylib_Init, and does the first part of setup, before fonts are rendered
|
|
/// Called by ImGui_ImplRaylib_Init, and does the first part of setup, before fonts are rendered
|
|
/// </summary>
|
|
/// </summary>
|
|
-void rlImGuiBeginInitImGui(void);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiBeginInitImGui(void);
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// End Custom initialization. Not needed if you call rlImGuiSetup. Only needed if you want to add custom setup code.
|
|
/// End Custom initialization. Not needed if you call rlImGuiSetup. Only needed if you want to add custom setup code.
|
|
/// must be proceeded by rlImGuiBeginInitImGui
|
|
/// must be proceeded by rlImGuiBeginInitImGui
|
|
/// Called by ImGui_ImplRaylib_Init and does the second part of setup, and renders fonts.
|
|
/// Called by ImGui_ImplRaylib_Init and does the second part of setup, and renders fonts.
|
|
/// </summary>
|
|
/// </summary>
|
|
-void rlImGuiEndInitImGui(void);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiEndInitImGui(void);
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Forces the font texture atlas to be recomputed and re-cached
|
|
/// Forces the font texture atlas to be recomputed and re-cached
|
|
/// </summary>
|
|
/// </summary>
|
|
-void rlImGuiReloadFonts(void);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiReloadFonts(void);
|
|
|
|
|
|
// Advanced Update API
|
|
// Advanced Update API
|
|
|
|
|
|
@@ -97,7 +119,7 @@ void rlImGuiReloadFonts(void);
|
|
/// Starts a new ImGui Frame with a specified delta time
|
|
/// Starts a new ImGui Frame with a specified delta time
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="dt">delta time, any value < 0 will use raylib GetFrameTime</param>
|
|
/// <param name="dt">delta time, any value < 0 will use raylib GetFrameTime</param>
|
|
-void rlImGuiBeginDelta(float deltaTime);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiBeginDelta(float deltaTime);
|
|
|
|
|
|
// ImGui Image API extensions
|
|
// ImGui Image API extensions
|
|
// Purely for convenience in working with raylib textures as images.
|
|
// Purely for convenience in working with raylib textures as images.
|
|
@@ -108,7 +130,7 @@ void rlImGuiBeginDelta(float deltaTime);
|
|
/// Uses the current ImGui Cursor position and the full texture size.
|
|
/// Uses the current ImGui Cursor position and the full texture size.
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="image">The raylib texture to draw</param>
|
|
/// <param name="image">The raylib texture to draw</param>
|
|
-void rlImGuiImage(const Texture *image);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiImage(const Texture *image);
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Draw a texture as an image in an ImGui Context at a specific size
|
|
/// Draw a texture as an image in an ImGui Context at a specific size
|
|
@@ -118,7 +140,7 @@ void rlImGuiImage(const Texture *image);
|
|
/// <param name="image">The raylib texture to draw</param>
|
|
/// <param name="image">The raylib texture to draw</param>
|
|
/// <param name="width">The width of the drawn image</param>
|
|
/// <param name="width">The width of the drawn image</param>
|
|
/// <param name="height">The height of the drawn image</param>
|
|
/// <param name="height">The height of the drawn image</param>
|
|
-void rlImGuiImageSize(const Texture *image, int width, int height);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiImageSize(const Texture *image, int width, int height);
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Draw a texture as an image in an ImGui Context at a specific size
|
|
/// Draw a texture as an image in an ImGui Context at a specific size
|
|
@@ -127,7 +149,7 @@ void rlImGuiImageSize(const Texture *image, int width, int height);
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="image">The raylib texture to draw</param>
|
|
/// <param name="image">The raylib texture to draw</param>
|
|
/// <param name="size">The size of drawn image</param>
|
|
/// <param name="size">The size of drawn image</param>
|
|
-void rlImGuiImageSizeV(const Texture* image, Vector2 size);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiImageSizeV(const Texture* image, Vector2 size);
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Draw a portion texture as an image in an ImGui Context at a defined size
|
|
/// Draw a portion texture as an image in an ImGui Context at a defined size
|
|
@@ -138,13 +160,13 @@ void rlImGuiImageSizeV(const Texture* image, Vector2 size);
|
|
/// <param name="destWidth">The width of the drawn image</param>
|
|
/// <param name="destWidth">The width of the drawn image</param>
|
|
/// <param name="destHeight">The height of the drawn image</param>
|
|
/// <param name="destHeight">The height of the drawn image</param>
|
|
/// <param name="sourceRect">The portion of the texture to draw as an image. Negative values for the width and height will flip the image</param>
|
|
/// <param name="sourceRect">The portion of the texture to draw as an image. Negative values for the width and height will flip the image</param>
|
|
-void rlImGuiImageRect(const Texture* image, int destWidth, int destHeight, Rectangle sourceRect);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiImageRect(const Texture* image, int destWidth, int destHeight, Rectangle sourceRect);
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Draws a render texture as an image an ImGui Context, automatically flipping the Y axis so it will show correctly on screen
|
|
/// Draws a render texture as an image an ImGui Context, automatically flipping the Y axis so it will show correctly on screen
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="image">The render texture to draw</param>
|
|
/// <param name="image">The render texture to draw</param>
|
|
-void rlImGuiImageRenderTexture(const RenderTexture* image);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiImageRenderTexture(const RenderTexture* image);
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Draws a render texture as an image an ImGui Context, automatically flipping the Y axis so it will show correctly on screen
|
|
/// Draws a render texture as an image an ImGui Context, automatically flipping the Y axis so it will show correctly on screen
|
|
@@ -152,7 +174,7 @@ void rlImGuiImageRenderTexture(const RenderTexture* image);
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="image">The render texture to draw</param>
|
|
/// <param name="image">The render texture to draw</param>
|
|
/// <param name="center">When true the image will be centered in the content area</param>
|
|
/// <param name="center">When true the image will be centered in the content area</param>
|
|
-void rlImGuiImageRenderTextureFit(const RenderTexture* image, bool center);
|
|
|
|
|
|
+RLIMGUIAPI void rlImGuiImageRenderTextureFit(const RenderTexture* image, bool center);
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Draws a texture as an image button in an ImGui context. Uses the current ImGui cursor position and the full size of the texture
|
|
/// Draws a texture as an image button in an ImGui context. Uses the current ImGui cursor position and the full size of the texture
|
|
@@ -169,7 +191,7 @@ bool rlImGuiImageButton(const char* name, const Texture* image);
|
|
/// <param name="image">The texture to draw</param>
|
|
/// <param name="image">The texture to draw</param>
|
|
/// <param name="size">The size of the button</param>
|
|
/// <param name="size">The size of the button</param>
|
|
/// <returns>True if the button was clicked</returns>
|
|
/// <returns>True if the button was clicked</returns>
|
|
-bool rlImGuiImageButtonSize(const char* name, const Texture* image, struct ImVec2 size);
|
|
|
|
|
|
+RLIMGUIAPI bool rlImGuiImageButtonSize(const char* name, const Texture* image, struct ImVec2 size);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
#ifdef __cplusplus
|
|
}
|
|
}
|