diff --git a/examples/imgui_impl_allegro5.cpp b/examples/imgui_impl_allegro5.cpp index 228ae0cb..c82b7cc8 100644 --- a/examples/imgui_impl_allegro5.cpp +++ b/examples/imgui_impl_allegro5.cpp @@ -1,4 +1,5 @@ -// ImGui Allegro 5 bindings +// ImGui Renderer + Platform Binding for: Allegro 5 +// (Info: Allegro 5 is a cross-platform general purpose library for handling windows, inputs, graphics, etc.) // Implemented features: // [X] User texture binding. Use 'ALLEGRO_BITMAP*' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. diff --git a/examples/imgui_impl_allegro5.h b/examples/imgui_impl_allegro5.h index 4b75dffa..9fc25920 100644 --- a/examples/imgui_impl_allegro5.h +++ b/examples/imgui_impl_allegro5.h @@ -1,4 +1,5 @@ -// ImGui Allegro 5 bindings +// ImGui Renderer + Platform Binding for: Allegro 5 +// (Info: Allegro 5 is a cross-platform general purpose library for handling windows, inputs, graphics, etc.) // Implemented features: // [X] User texture binding. Use 'ALLEGRO_BITMAP*' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. diff --git a/examples/imgui_impl_dx10.cpp b/examples/imgui_impl_dx10.cpp index 112bace8..6b165118 100644 --- a/examples/imgui_impl_dx10.cpp +++ b/examples/imgui_impl_dx10.cpp @@ -1,4 +1,5 @@ -// ImGui Win32 + DirectX10 binding +// ImGui Renderer for: DirectX10 +// This needs to be used along with a Platform Binding (e.g. Win32) // Implemented features: // [X] User texture binding. Use 'ID3D10ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. diff --git a/examples/imgui_impl_dx10.h b/examples/imgui_impl_dx10.h index c375351b..5d972013 100644 --- a/examples/imgui_impl_dx10.h +++ b/examples/imgui_impl_dx10.h @@ -1,4 +1,5 @@ -// ImGui Win32 + DirectX10 binding +// ImGui Renderer for: DirectX10 +// This needs to be used along with a Platform Binding (e.g. Win32) // Implemented features: // [X] User texture binding. Use 'ID3D10ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index 12536a53..44e5737a 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -1,4 +1,5 @@ -// ImGui Win32 + DirectX11 binding +// ImGui Renderer for: DirectX11 +// This needs to be used along with a Platform Binding (e.g. Win32) // Implemented features: // [X] User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. diff --git a/examples/imgui_impl_dx11.h b/examples/imgui_impl_dx11.h index 10e0d963..62fb627e 100644 --- a/examples/imgui_impl_dx11.h +++ b/examples/imgui_impl_dx11.h @@ -1,4 +1,5 @@ -// ImGui Win32 + DirectX11 binding +// ImGui Renderer for: DirectX11 +// This needs to be used along with a Platform Binding (e.g. Win32) // Implemented features: // [X] User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. diff --git a/examples/imgui_impl_dx9.cpp b/examples/imgui_impl_dx9.cpp index 17e4bcda..8be032d5 100644 --- a/examples/imgui_impl_dx9.cpp +++ b/examples/imgui_impl_dx9.cpp @@ -1,4 +1,5 @@ -// ImGui Win32 + DirectX9 binding +// ImGui Renderer for: DirectX9 +// This needs to be used along with a Platform Binding (e.g. Win32) // Implemented features: // [X] User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. diff --git a/examples/imgui_impl_dx9.h b/examples/imgui_impl_dx9.h index eb52eabe..32e78241 100644 --- a/examples/imgui_impl_dx9.h +++ b/examples/imgui_impl_dx9.h @@ -1,4 +1,5 @@ -// ImGui Win32 + DirectX9 binding +// ImGui Renderer for: DirectX9 +// This needs to be used along with a Platform Binding (e.g. Win32) // Implemented features: // [X] User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. diff --git a/examples/imgui_impl_glfw.cpp b/examples/imgui_impl_glfw.cpp index 578752c6..187331b6 100644 --- a/examples/imgui_impl_glfw.cpp +++ b/examples/imgui_impl_glfw.cpp @@ -1,9 +1,8 @@ -// ImGui GLFW binding with OpenGL3 + shaders -// (GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.) -// (GL3W is a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc.) +// ImGui Platform Binding for: GLFW +// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan..) +// (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.) // Implemented features: -// [X] User texture binding. Cast 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. // [X] Gamepad navigation mapping. Enable with 'io.NavFlags |= ImGuiNavFlags_EnableGamepad'. // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. @@ -21,13 +20,8 @@ // 2018-01-25: Inputs: Honoring the io.WantMoveMouse by repositioning the mouse by using navigation and ImGuiNavFlags_MoveMouse is set. // 2018-01-20: Inputs: Added Horizontal Mouse Wheel support. // 2018-01-18: Inputs: Added mapping for ImGuiKey_Insert. -// 2018-01-07: OpenGL: Changed GLSL shader version from 330 to 150. (Also changed GL context from 3.3 to 3.2 in example's main.cpp) -// 2017-09-01: OpenGL: Save and restore current bound sampler. Save and restore current polygon mode. // 2017-08-25: Inputs: MousePos set to -FLT_MAX,-FLT_MAX when mouse is unavailable/missing (instead of -1,-1). -// 2017-05-01: OpenGL: Fixed save and restore of current blend function state. // 2016-10-15: Misc: Added a void* user_data parameter to Clipboard function handlers. -// 2016-09-05: OpenGL: Fixed save and restore of current scissor rectangle. -// 2016-04-30: OpenGL: Fixed save and restore of current GL_ACTIVE_TEXTURE. #include "imgui.h" #include "imgui_impl_glfw.h" diff --git a/examples/imgui_impl_glfw.h b/examples/imgui_impl_glfw.h index d1b42eed..c6cb4c8a 100644 --- a/examples/imgui_impl_glfw.h +++ b/examples/imgui_impl_glfw.h @@ -1,9 +1,8 @@ -// ImGui GLFW binding with OpenGL3 + shaders -// (GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.) -// (GL3W is a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc.) +// ImGui Platform Binding for: GLFW +// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan..) +// (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.) // Implemented features: -// [X] User texture binding. Cast 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. // [X] Gamepad navigation mapping. Enable with 'io.NavFlags |= ImGuiNavFlags_EnableGamepad'. // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. diff --git a/examples/imgui_impl_marmalade.cpp b/examples/imgui_impl_marmalade.cpp index 947bcbd6..1b6fd6ef 100644 --- a/examples/imgui_impl_marmalade.cpp +++ b/examples/imgui_impl_marmalade.cpp @@ -1,4 +1,4 @@ -// ImGui Marmalade binding with IwGx +// ImGui Renderer + Platform Binding for: Marmalade + IwGx // Implemented features: // [X] User texture binding. Use 'CIwTexture*' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. diff --git a/examples/imgui_impl_marmalade.h b/examples/imgui_impl_marmalade.h index c41a5e8f..884ea9e4 100644 --- a/examples/imgui_impl_marmalade.h +++ b/examples/imgui_impl_marmalade.h @@ -1,4 +1,4 @@ -// ImGui Marmalade binding with IwGx +// ImGui Renderer + Platform Binding for: Marmalade + IwGx // Implemented features: // [X] User texture binding. Use 'CIwTexture*' as ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. diff --git a/examples/imgui_impl_opengl2.cpp b/examples/imgui_impl_opengl2.cpp index f77695d6..3d47702b 100644 --- a/examples/imgui_impl_opengl2.cpp +++ b/examples/imgui_impl_opengl2.cpp @@ -1,5 +1,8 @@ +// ImGui Renderer for: OpenGL2 (legacy OpenGL, fixed pipeline) +// This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..) + // **DO NOT USE THIS CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)** -// **Prefer using the code in the opengl3_example/ folder** +// **Prefer using the code in imgui_impl_opengl3.cpp** // This code is mostly provided as a reference to learn how ImGui integration works, because it is shorter to read. // If your code is using GL3+ context or any semi modern OpenGL calls, using this is likely to make everything more // complicated, will require your code to reset every single OpenGL attributes to their initial state, and might diff --git a/examples/imgui_impl_opengl2.h b/examples/imgui_impl_opengl2.h index c1ef2f5e..a80dfac4 100644 --- a/examples/imgui_impl_opengl2.h +++ b/examples/imgui_impl_opengl2.h @@ -1,3 +1,13 @@ +// ImGui Renderer for: OpenGL2 (legacy OpenGL, fixed pipeline) +// This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..) + +// **DO NOT USE THIS CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)** +// **Prefer using the code in imgui_impl_opengl3.cpp** +// This code is mostly provided as a reference to learn how ImGui integration works, because it is shorter to read. +// If your code is using GL3+ context or any semi modern OpenGL calls, using this is likely to make everything more +// complicated, will require your code to reset every single OpenGL attributes to their initial state, and might +// confuse your GPU driver. +// The GL2 code is unable to reset attributes or even call e.g. "glUseProgram(0)" because they don't exist in that API. IMGUI_API bool ImGui_ImplOpenGL2_Init(); IMGUI_API void ImGui_ImplOpenGL2_Shutdown(); diff --git a/examples/imgui_impl_opengl3.cpp b/examples/imgui_impl_opengl3.cpp index fcb8ca5f..af5ccd02 100644 --- a/examples/imgui_impl_opengl3.cpp +++ b/examples/imgui_impl_opengl3.cpp @@ -1,3 +1,7 @@ +// ImGui Renderer for: OpenGL3 (modern OpenGL with shaders / programmatic pipeline) +// This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..) +// (Note: We are using GL3W as a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc..) + // CHANGELOG // (minor and older changes stripped away, please see git history for details) // 2018-XX-XX: OpenGL: Offset projection matrix and clipping rectangle by io.DisplayPos (which will be non-zero for multi-viewport applications). diff --git a/examples/imgui_impl_opengl3.h b/examples/imgui_impl_opengl3.h index eaf8cf8a..9a9e9971 100644 --- a/examples/imgui_impl_opengl3.h +++ b/examples/imgui_impl_opengl3.h @@ -1,3 +1,6 @@ +// ImGui Renderer for: OpenGL3 (modern OpenGL with shaders / programmatic pipeline) +// This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..) +// (Note: We are using GL3W as a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc..) IMGUI_API bool ImGui_ImplOpenGL3_Init(); IMGUI_API void ImGui_ImplOpenGL3_Shutdown(); diff --git a/examples/imgui_impl_sdl2.cpp b/examples/imgui_impl_sdl2.cpp index 75ea617d..21b26aab 100644 --- a/examples/imgui_impl_sdl2.cpp +++ b/examples/imgui_impl_sdl2.cpp @@ -1,6 +1,6 @@ -// ImGui SDL2 binding with OpenGL3 -// (SDL is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.) -// (GL3W is a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc.) +// ImGui Platform Binding for: SDL2 +// This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) +// (Info: SDL2 is a cross-platform general purpose library for handling windows, inputs, graphics context creation, etc.) // Implemented features: // [X] User texture binding. Cast 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. diff --git a/examples/imgui_impl_sdl2.h b/examples/imgui_impl_sdl2.h index b19c0f5e..4a181283 100644 --- a/examples/imgui_impl_sdl2.h +++ b/examples/imgui_impl_sdl2.h @@ -1,9 +1,6 @@ -// ImGui SDL2 binding with OpenGL3 -// (SDL is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.) -// (GL3W is a helper library to access OpenGL functions since there is no standard header to access modern OpenGL functions easily. Alternatives are GLEW, Glad, etc.) - -// Implemented features: -// [X] User texture binding. Cast 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID in imgui.cpp. +// ImGui Platform Binding for: SDL2 +// This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) +// (Info: SDL2 is a cross-platform general purpose library for handling windows, inputs, graphics context creation, etc.) // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). diff --git a/examples/imgui_impl_vulkan.cpp b/examples/imgui_impl_vulkan.cpp index 42ca412f..312bb486 100644 --- a/examples/imgui_impl_vulkan.cpp +++ b/examples/imgui_impl_vulkan.cpp @@ -1,4 +1,5 @@ -// ImGui GLFW binding with Vulkan + shaders +// ImGui Renderer for: Vulkan +// This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..) // Missing features: // [ ] User texture binding. Changes of ImTextureID aren't supported by this binding! See https://github.com/ocornut/imgui/pull/914 @@ -10,17 +11,12 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) -// 2018-XX-XX: Draw: Offset projection matrix and clipping rectangle by io.DisplayPos (which will be non-zero for multi-viewport applications). +// 2018-XX-XX: Vulkan: Offset projection matrix and clipping rectangle by io.DisplayPos (which will be non-zero for multi-viewport applications). // 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback, ImGui_ImplVulkan_Render() calls ImGui_ImplVulkan_RenderDrawData() itself. // 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves. -// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space. -// 2018-01-20: Inputs: Added Horizontal Mouse Wheel support. -// 2018-01-18: Inputs: Added mapping for ImGuiKey_Insert. -// 2017-08-25: Inputs: MousePos set to -FLT_MAX,-FLT_MAX when mouse is unavailable/missing (instead of -1,-1). // 2017-05-15: Vulkan: Fix scissor offset being negative. Fix new Vulkan validation warnings. Set required depth member for buffer image copy. // 2016-11-13: Vulkan: Fix validation layer warnings and errors and redeclare gl_PerVertex. // 2016-10-18: Vulkan: Add location decorators & change to use structs as in/out in glsl, update embedded spv (produced with glslangValidator -x). Null the released resources. -// 2016-10-15: Misc: Added a void* user_data parameter to Clipboard function handlers. // 2016-08-27: Vulkan: Fix Vulkan example for use when a depth buffer is active. #include "imgui.h" diff --git a/examples/imgui_impl_vulkan.h b/examples/imgui_impl_vulkan.h index 0a0e9be0..c27c11ee 100644 --- a/examples/imgui_impl_vulkan.h +++ b/examples/imgui_impl_vulkan.h @@ -1,4 +1,5 @@ -// ImGui GLFW binding with Vulkan + shaders +// ImGui Renderer for: Vulkan +// This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..) // Missing features: // [ ] User texture binding. Changes of ImTextureID aren't supported by this binding! See https://github.com/ocornut/imgui/pull/914 diff --git a/examples/imgui_impl_win32.cpp b/examples/imgui_impl_win32.cpp index 1df7b9f2..f538590a 100644 --- a/examples/imgui_impl_win32.cpp +++ b/examples/imgui_impl_win32.cpp @@ -1,3 +1,6 @@ +// ImGui Platform Binding for: Windows (standard windows API for 32 and 64 bits applications) +// This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) + #include "imgui.h" #include "imgui_impl_win32.h" #define WIN32_LEAN_AND_MEAN diff --git a/examples/imgui_impl_win32.h b/examples/imgui_impl_win32.h index 086cf032..4f5d65e6 100644 --- a/examples/imgui_impl_win32.h +++ b/examples/imgui_impl_win32.h @@ -1,3 +1,5 @@ +// ImGui Platform Binding for: Windows (standard windows API for 32 and 64 bits applications) +// This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) IMGUI_API bool ImGui_ImplWin32_Init(void* hwnd); IMGUI_API void ImGui_ImplWin32_Shutdown();