|
@@ -110,9 +110,9 @@ static void ImGuiNewFrame(float deltaTime)
|
|
|
io.DisplaySize.y = float(GetScreenHeight());
|
|
io.DisplaySize.y = float(GetScreenHeight());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const Vector2 ResolutionScale = GetWindowScaleDPI();
|
|
|
|
|
|
|
+ const Vector2 resolutionScale = GetWindowScaleDPI();
|
|
|
|
|
|
|
|
- io.DisplayFramebufferScale = ImVec2(ResolutionScale.x, ResolutionScale.y);
|
|
|
|
|
|
|
+ io.DisplayFramebufferScale = ImVec2(resolutionScale.x, resolutionScale.y);
|
|
|
|
|
|
|
|
io.DeltaTime = deltaTime;
|
|
io.DeltaTime = deltaTime;
|
|
|
|
|
|
|
@@ -400,7 +400,6 @@ static void SetupGlobals()
|
|
|
LastShiftPressed = false;
|
|
LastShiftPressed = false;
|
|
|
LastAltPressed = false;
|
|
LastAltPressed = false;
|
|
|
LastSuperPressed = false;
|
|
LastSuperPressed = false;
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void rlImGuiBeginInitImGui()
|
|
void rlImGuiBeginInitImGui()
|
|
@@ -465,8 +464,10 @@ void rlImGuiImage(const Texture* image)
|
|
|
{
|
|
{
|
|
|
if (!image)
|
|
if (!image)
|
|
|
return;
|
|
return;
|
|
|
- if (GlobalContext)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (GlobalContext)
|
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
|
|
|
+
|
|
|
ImGui::Image((ImTextureID)image, ImVec2(float(image->width), float(image->height)));
|
|
ImGui::Image((ImTextureID)image, ImVec2(float(image->width), float(image->height)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -474,8 +475,10 @@ bool rlImGuiImageButton(const char* name, const Texture* image)
|
|
|
{
|
|
{
|
|
|
if (!image)
|
|
if (!image)
|
|
|
return false;
|
|
return false;
|
|
|
- if (GlobalContext)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (GlobalContext)
|
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
|
|
|
+
|
|
|
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)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -483,8 +486,10 @@ bool rlImGuiImageButtonSize(const char* name, const Texture* image, ImVec2 size)
|
|
|
{
|
|
{
|
|
|
if (!image)
|
|
if (!image)
|
|
|
return false;
|
|
return false;
|
|
|
- if (GlobalContext)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (GlobalContext)
|
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
|
|
|
+
|
|
|
return ImGui::ImageButton(name, (ImTextureID)image, size);
|
|
return ImGui::ImageButton(name, (ImTextureID)image, size);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -492,8 +497,10 @@ void rlImGuiImageSize(const Texture* image, int width, int height)
|
|
|
{
|
|
{
|
|
|
if (!image)
|
|
if (!image)
|
|
|
return;
|
|
return;
|
|
|
- if (GlobalContext)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (GlobalContext)
|
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
|
|
|
+
|
|
|
ImGui::Image((ImTextureID)image, ImVec2(float(width), float(height)));
|
|
ImGui::Image((ImTextureID)image, ImVec2(float(width), float(height)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -501,17 +508,21 @@ void rlImGuiImageSizeV(const Texture* image, Vector2 size)
|
|
|
{
|
|
{
|
|
|
if (!image)
|
|
if (!image)
|
|
|
return;
|
|
return;
|
|
|
- if (GlobalContext)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (GlobalContext)
|
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
|
- ImGui::Image((ImTextureID)image, ImVec2(size.x, size.y));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ ImGui::Image((ImTextureID)image, ImVec2(size.x, size.y));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void rlImGuiImageRect(const Texture* image, int destWidth, int destHeight, Rectangle sourceRect)
|
|
void rlImGuiImageRect(const Texture* image, int destWidth, int destHeight, Rectangle sourceRect)
|
|
|
{
|
|
{
|
|
|
if (!image)
|
|
if (!image)
|
|
|
return;
|
|
return;
|
|
|
- if (GlobalContext)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (GlobalContext)
|
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
|
|
|
+
|
|
|
ImVec2 uv0;
|
|
ImVec2 uv0;
|
|
|
ImVec2 uv1;
|
|
ImVec2 uv1;
|
|
|
|
|
|
|
@@ -544,8 +555,10 @@ void rlImGuiImageRenderTexture(const RenderTexture* image)
|
|
|
{
|
|
{
|
|
|
if (!image)
|
|
if (!image)
|
|
|
return;
|
|
return;
|
|
|
|
|
+
|
|
|
if (GlobalContext)
|
|
if (GlobalContext)
|
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
|
|
|
+
|
|
|
rlImGuiImageRect(&image->texture, image->texture.width, image->texture.height, Rectangle{ 0,0, float(image->texture.width), -float(image->texture.height) });
|
|
rlImGuiImageRect(&image->texture, image->texture.width, image->texture.height, Rectangle{ 0,0, float(image->texture.width), -float(image->texture.height) });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -553,7 +566,8 @@ void rlImGuiImageRenderTextureFit(const RenderTexture* image, bool center)
|
|
|
{
|
|
{
|
|
|
if (!image)
|
|
if (!image)
|
|
|
return;
|
|
return;
|
|
|
- if (GlobalContext)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (GlobalContext)
|
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
ImGui::SetCurrentContext(GlobalContext);
|
|
|
|
|
|
|
|
ImVec2 area = ImGui::GetContentRegionAvail();
|
|
ImVec2 area = ImGui::GetContentRegionAvail();
|