mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-03 22:51:06 +01:00 
			
		
		
		
	Moved the optional "courtesy maths operators" (#define IMGUI_DEFINE_MATH_OPERATORS) implementation from imgui_internal.h in imgui.h. (#6164, #6137, #5966, #2832)
This commit is contained in:
		
							
								
								
									
										42
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										42
									
								
								imgui.cpp
									
									
									
									
									
								
							@@ -386,22 +386,28 @@ CODE
 | 
			
		||||
 When you are not sure about an old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files.
 | 
			
		||||
 You can read releases logs https://github.com/ocornut/imgui/releases for more details.
 | 
			
		||||
 | 
			
		||||
 - 2023/02/15 (1.89.4) - moved the optional "courtesy maths operators" implementation from imgui_internal.h in imgui.h.
 | 
			
		||||
                         Even though we encourage using your own maths types and operators by setting up IM_VEC2_CLASS_EXTRA,
 | 
			
		||||
                         it has been frequently requested by people to use our own. We had an opt-in define which was
 | 
			
		||||
                         previously fulfilled in imgui_internal.h. It is now fulfilled in imgui.h. (#6164)
 | 
			
		||||
                           - OK:     #define IMGUI_DEFINE_MATH_OPERATORS / #include "imgui.h" / #include "imgui_internal.h"
 | 
			
		||||
                           - Error:  #include "imgui.h" / #define IMGUI_DEFINE_MATH_OPERATORS / #include "imgui_internal.h"
 | 
			
		||||
 - 2023/02/07 (1.89.3) - backends: renamed "imgui_impl_sdl.cpp" to "imgui_impl_sdl2.cpp" and "imgui_impl_sdl.h" to "imgui_impl_sdl2.h". (#6146) This is in prevision for the future release of SDL3.
 | 
			
		||||
 - 2022/10/26 (1.89) - commented out redirecting OpenPopupContextItem() which was briefly the name of OpenPopupOnItemClick() from 1.77 to 1.79.
 | 
			
		||||
 - 2022/10/12 (1.89) - removed runtime patching of invalid "%f"/"%0.f" format strings for DragInt()/SliderInt(). This was obsoleted in 1.61 (May 2018). See 1.61 changelog for details.
 | 
			
		||||
 - 2022/09/26 (1.89) - renamed and merged keyboard modifiers key enums and flags into a same set. Kept inline redirection enums (will obsolete).
 | 
			
		||||
                         - ImGuiKey_ModCtrl  and ImGuiModFlags_Ctrl  -> ImGuiMod_Ctrl
 | 
			
		||||
                         - ImGuiKey_ModShift and ImGuiModFlags_Shift -> ImGuiMod_Shift
 | 
			
		||||
                         - ImGuiKey_ModAlt   and ImGuiModFlags_Alt   -> ImGuiMod_Alt
 | 
			
		||||
                         - ImGuiKey_ModSuper and ImGuiModFlags_Super -> ImGuiMod_Super
 | 
			
		||||
                       the ImGuiKey_ModXXX were introduced in 1.87 and mostly used by backends.
 | 
			
		||||
                       the ImGuiModFlags_XXX have been exposed in imgui.h but not really used by any public api only by third-party extensions.
 | 
			
		||||
                       exceptionally commenting out the older ImGuiKeyModFlags_XXX names ahead of obsolescence schedule to reduce confusion and because they were not meant to be used anyway.
 | 
			
		||||
 - 2022/09/20 (1.89) - ImGuiKey is now a typed enum, allowing ImGuiKey_XXX symbols to be named in debuggers.
 | 
			
		||||
                       this will require uses of legacy backend-dependent indices to be casted, e.g.
 | 
			
		||||
                          - with imgui_impl_glfw:  IsKeyPressed(GLFW_KEY_A) -> IsKeyPressed((ImGuiKey)GLFW_KEY_A);
 | 
			
		||||
                          - with imgui_impl_win32: IsKeyPressed('A')        -> IsKeyPressed((ImGuiKey)'A')
 | 
			
		||||
                          - etc. However if you are upgrading code you might well use the better, backend-agnostic IsKeyPressed(ImGuiKey_A) now!
 | 
			
		||||
 - 2022/10/26 (1.89)   - commented out redirecting OpenPopupContextItem() which was briefly the name of OpenPopupOnItemClick() from 1.77 to 1.79.
 | 
			
		||||
 - 2022/10/12 (1.89)   - removed runtime patching of invalid "%f"/"%0.f" format strings for DragInt()/SliderInt(). This was obsoleted in 1.61 (May 2018). See 1.61 changelog for details.
 | 
			
		||||
 - 2022/09/26 (1.89)   - renamed and merged keyboard modifiers key enums and flags into a same set. Kept inline redirection enums (will obsolete).
 | 
			
		||||
                           - ImGuiKey_ModCtrl  and ImGuiModFlags_Ctrl  -> ImGuiMod_Ctrl
 | 
			
		||||
                           - ImGuiKey_ModShift and ImGuiModFlags_Shift -> ImGuiMod_Shift
 | 
			
		||||
                           - ImGuiKey_ModAlt   and ImGuiModFlags_Alt   -> ImGuiMod_Alt
 | 
			
		||||
                           - ImGuiKey_ModSuper and ImGuiModFlags_Super -> ImGuiMod_Super
 | 
			
		||||
                         the ImGuiKey_ModXXX were introduced in 1.87 and mostly used by backends.
 | 
			
		||||
                         the ImGuiModFlags_XXX have been exposed in imgui.h but not really used by any public api only by third-party extensions.
 | 
			
		||||
                         exceptionally commenting out the older ImGuiKeyModFlags_XXX names ahead of obsolescence schedule to reduce confusion and because they were not meant to be used anyway.
 | 
			
		||||
 - 2022/09/20 (1.89)   - ImGuiKey is now a typed enum, allowing ImGuiKey_XXX symbols to be named in debuggers.
 | 
			
		||||
                         this will require uses of legacy backend-dependent indices to be casted, e.g.
 | 
			
		||||
                            - with imgui_impl_glfw:  IsKeyPressed(GLFW_KEY_A) -> IsKeyPressed((ImGuiKey)GLFW_KEY_A);
 | 
			
		||||
                            - with imgui_impl_win32: IsKeyPressed('A')        -> IsKeyPressed((ImGuiKey)'A')
 | 
			
		||||
                            - etc. However if you are upgrading code you might well use the better, backend-agnostic IsKeyPressed(ImGuiKey_A) now!
 | 
			
		||||
 - 2022/09/12 (1.89) - removed the bizarre legacy default argument for 'TreePush(const void* ptr = NULL)', always pass a pointer value explicitly. NULL/nullptr is ok but require cast, e.g. TreePush((void*)nullptr);
 | 
			
		||||
 - 2022/09/05 (1.89) - commented out redirecting functions/enums names that were marked obsolete in 1.77 and 1.78 (June 2020):
 | 
			
		||||
                         - DragScalar(), DragScalarN(), DragFloat(), DragFloat2(), DragFloat3(), DragFloat4(): For old signatures ending with (..., const char* format, float power = 1.0f) -> use (..., format ImGuiSliderFlags_Logarithmic) if power != 1.0f.
 | 
			
		||||
@@ -860,12 +866,12 @@ CODE
 | 
			
		||||
#define _CRT_SECURE_NO_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "imgui.h"
 | 
			
		||||
#ifndef IMGUI_DISABLE
 | 
			
		||||
 | 
			
		||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
 | 
			
		||||
#define IMGUI_DEFINE_MATH_OPERATORS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "imgui.h"
 | 
			
		||||
#ifndef IMGUI_DISABLE
 | 
			
		||||
#include "imgui_internal.h"
 | 
			
		||||
 | 
			
		||||
// System includes
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user