Browse Source

Swapped struct ImVec2 in header for Vector2

Vesper 11 months ago
parent
commit
9acdbbf255
3 changed files with 4 additions and 4 deletions
  1. 1 1
      README.md
  2. 2 2
      rlImGui.cpp
  3. 1 1
      rlImGui.h

+ 1 - 1
README.md

@@ -64,7 +64,7 @@ void rlImGuiImageRenderTexture(const RenderTexture* image);
 void rlImGuiImageRenderTextureFit(const RenderTexture* image, bool center);
 void rlImGuiImageRenderTextureFit(const RenderTexture* image, bool center);
 
 
 bool rlImGuiImageButton(const Texture *image);
 bool rlImGuiImageButton(const Texture *image);
-bool rlImGuiImageButtonSize(const char* name, const Texture* image, struct ImVec2 size);
+bool rlImGuiImageButtonSize(const char* name, const Texture* image, Vector2 size);
 ```
 ```
 
 
 # C vs C++
 # C vs C++

+ 2 - 2
rlImGui.cpp

@@ -495,7 +495,7 @@ bool rlImGuiImageButton(const char* name, const Texture* image)
     return ImGui::ImageButton(name, (ImTextureID)image, ImVec2(float(image->width), float(image->height)));
     return ImGui::ImageButton(name, (ImTextureID)image, ImVec2(float(image->width), float(image->height)));
 }
 }
 
 
-bool rlImGuiImageButtonSize(const char* name, const Texture* image, ImVec2 size)
+bool rlImGuiImageButtonSize(const char* name, const Texture* image, Vector2 size)
 {
 {
     if (!image)
     if (!image)
         return false;
         return false;
@@ -503,7 +503,7 @@ bool rlImGuiImageButtonSize(const char* name, const Texture* image, ImVec2 size)
     if (GlobalContext)
     if (GlobalContext)
         ImGui::SetCurrentContext(GlobalContext);
         ImGui::SetCurrentContext(GlobalContext);
    
    
-    return ImGui::ImageButton(name, (ImTextureID)image, size);
+    return ImGui::ImageButton(name, (ImTextureID)image, ImVec2(size.x, size.y));
 }
 }
 
 
 void rlImGuiImageSize(const Texture* image, int width, int height)
 void rlImGuiImageSize(const Texture* image, int width, int height)

+ 1 - 1
rlImGui.h

@@ -193,7 +193,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>
-RLIMGUIAPI bool rlImGuiImageButtonSize(const char* name, const Texture* image, struct ImVec2 size);
+RLIMGUIAPI bool rlImGuiImageButtonSize(const char* name, const Texture* image, Vector2 size);
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }