Browse Source

style cleanups

Jeff Myers 2 years ago
parent
commit
f094baeebc
1 changed files with 25 additions and 11 deletions
  1. 25 11
      rlImGui.cpp

+ 25 - 11
rlImGui.cpp

@@ -110,9 +110,9 @@ static void ImGuiNewFrame(float deltaTime)
         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;
 
@@ -400,7 +400,6 @@ static void SetupGlobals()
 	LastShiftPressed = false;
 	LastAltPressed = false;
 	LastSuperPressed = false;
-
 }
 
 void rlImGuiBeginInitImGui()
@@ -465,8 +464,10 @@ void rlImGuiImage(const Texture* image)
 {
 	if (!image)
 		return;
-	if (GlobalContext)
+	
+    if (GlobalContext)
 		ImGui::SetCurrentContext(GlobalContext);
+    
     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)
 		return false;
-	if (GlobalContext)
+	
+    if (GlobalContext)
 		ImGui::SetCurrentContext(GlobalContext);
+    
     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)
 		return false;
-	if (GlobalContext)
+	
+    if (GlobalContext)
 		ImGui::SetCurrentContext(GlobalContext);
+   
     return ImGui::ImageButton(name, (ImTextureID)image, size);
 }
 
@@ -492,8 +497,10 @@ void rlImGuiImageSize(const Texture* image, int width, int height)
 {
 	if (!image)
 		return;
-	if (GlobalContext)
+	
+    if (GlobalContext)
 		ImGui::SetCurrentContext(GlobalContext);
+    
     ImGui::Image((ImTextureID)image, ImVec2(float(width), float(height)));
 }
 
@@ -501,17 +508,21 @@ void rlImGuiImageSizeV(const Texture* image, Vector2 size)
 {
 	if (!image)
 		return;
-	if (GlobalContext)
+	
+    if (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)
 {
 	if (!image)
 		return;
-	if (GlobalContext)
+	
+    if (GlobalContext)
 		ImGui::SetCurrentContext(GlobalContext);
+    
     ImVec2 uv0;
     ImVec2 uv1;
 
@@ -544,8 +555,10 @@ void rlImGuiImageRenderTexture(const RenderTexture* image)
 {
     if (!image)
         return;
+    
     if (GlobalContext)
         ImGui::SetCurrentContext(GlobalContext);
+    
     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)
 		return;
-	if (GlobalContext)
+	
+    if (GlobalContext)
 		ImGui::SetCurrentContext(GlobalContext);
 
     ImVec2 area = ImGui::GetContentRegionAvail();