From cc0e43e6314e977d10d034f030de478194a0dd70 Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 7 Apr 2020 11:02:29 +0200 Subject: [PATCH] Backends: Comments next to include, misc minor comments/tweaks, fix imgui_impl_osx.h using IMGUI_API instead of IMGUI_IMPL_API. (#3105) --- examples/imgui_impl_allegro5.h | 5 ++--- examples/imgui_impl_dx10.h | 5 ++--- examples/imgui_impl_dx11.h | 5 ++--- examples/imgui_impl_dx12.h | 5 ++--- examples/imgui_impl_dx9.h | 5 ++--- examples/imgui_impl_glfw.h | 3 +-- examples/imgui_impl_glut.h | 3 +-- examples/imgui_impl_marmalade.h | 5 ++--- examples/imgui_impl_metal.h | 2 +- examples/imgui_impl_opengl2.h | 3 +-- examples/imgui_impl_opengl3.h | 3 +-- examples/imgui_impl_osx.h | 10 +++++----- examples/imgui_impl_sdl.h | 3 +-- examples/imgui_impl_vulkan.h | 3 +-- examples/imgui_impl_win32.h | 6 +++--- 15 files changed, 27 insertions(+), 39 deletions(-) diff --git a/examples/imgui_impl_allegro5.h b/examples/imgui_impl_allegro5.h index c105fea6f..f41e4c909 100644 --- a/examples/imgui_impl_allegro5.h +++ b/examples/imgui_impl_allegro5.h @@ -14,8 +14,7 @@ // https://github.com/ocornut/imgui, Original Allegro 5 code by @birthggd #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API struct ALLEGRO_DISPLAY; union ALLEGRO_EVENT; @@ -26,6 +25,6 @@ IMGUI_IMPL_API void ImGui_ImplAllegro5_NewFrame(); IMGUI_IMPL_API void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data); IMGUI_IMPL_API bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* event); -// Use if you want to reset your rendering device without losing ImGui state. +// Use if you want to reset your rendering device without losing Dear ImGui state. IMGUI_IMPL_API bool ImGui_ImplAllegro5_CreateDeviceObjects(); IMGUI_IMPL_API void ImGui_ImplAllegro5_InvalidateDeviceObjects(); diff --git a/examples/imgui_impl_dx10.h b/examples/imgui_impl_dx10.h index 341bd7dfe..d974ba8e3 100644 --- a/examples/imgui_impl_dx10.h +++ b/examples/imgui_impl_dx10.h @@ -10,8 +10,7 @@ // https://github.com/ocornut/imgui #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API struct ID3D10Device; @@ -20,6 +19,6 @@ IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown(); IMGUI_IMPL_API void ImGui_ImplDX10_NewFrame(); IMGUI_IMPL_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data); -// Use if you want to reset your rendering device without losing ImGui state. +// Use if you want to reset your rendering device without losing Dear ImGui state. IMGUI_IMPL_API void ImGui_ImplDX10_InvalidateDeviceObjects(); IMGUI_IMPL_API bool ImGui_ImplDX10_CreateDeviceObjects(); diff --git a/examples/imgui_impl_dx11.h b/examples/imgui_impl_dx11.h index d73516444..cccadcd2c 100644 --- a/examples/imgui_impl_dx11.h +++ b/examples/imgui_impl_dx11.h @@ -10,8 +10,7 @@ // https://github.com/ocornut/imgui #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API struct ID3D11Device; struct ID3D11DeviceContext; @@ -21,6 +20,6 @@ IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); -// Use if you want to reset your rendering device without losing ImGui state. +// Use if you want to reset your rendering device without losing Dear ImGui state. IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); diff --git a/examples/imgui_impl_dx12.h b/examples/imgui_impl_dx12.h index df95b2055..52dab0ba3 100644 --- a/examples/imgui_impl_dx12.h +++ b/examples/imgui_impl_dx12.h @@ -12,8 +12,7 @@ // https://github.com/ocornut/imgui #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API enum DXGI_FORMAT; struct ID3D12Device; @@ -32,6 +31,6 @@ IMGUI_IMPL_API void ImGui_ImplDX12_Shutdown(); IMGUI_IMPL_API void ImGui_ImplDX12_NewFrame(); IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandList* graphics_command_list); -// Use if you want to reset your rendering device without losing ImGui state. +// Use if you want to reset your rendering device without losing Dear ImGui state. IMGUI_IMPL_API void ImGui_ImplDX12_InvalidateDeviceObjects(); IMGUI_IMPL_API bool ImGui_ImplDX12_CreateDeviceObjects(); diff --git a/examples/imgui_impl_dx9.h b/examples/imgui_impl_dx9.h index f630eeaa0..b93c89f7d 100644 --- a/examples/imgui_impl_dx9.h +++ b/examples/imgui_impl_dx9.h @@ -10,8 +10,7 @@ // https://github.com/ocornut/imgui #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API struct IDirect3DDevice9; @@ -20,6 +19,6 @@ IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown(); IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame(); IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); -// Use if you want to reset your rendering device without losing ImGui state. +// Use if you want to reset your rendering device without losing Dear ImGui state. IMGUI_IMPL_API bool ImGui_ImplDX9_CreateDeviceObjects(); IMGUI_IMPL_API void ImGui_ImplDX9_InvalidateDeviceObjects(); diff --git a/examples/imgui_impl_glfw.h b/examples/imgui_impl_glfw.h index f7f6f8c24..f62f44f31 100644 --- a/examples/imgui_impl_glfw.h +++ b/examples/imgui_impl_glfw.h @@ -17,8 +17,7 @@ // Only override if your GL version doesn't handle this GLSL version. Keep NULL if unsure! #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API struct GLFWwindow; diff --git a/examples/imgui_impl_glut.h b/examples/imgui_impl_glut.h index 68326dcec..9acb77fb4 100644 --- a/examples/imgui_impl_glut.h +++ b/examples/imgui_impl_glut.h @@ -16,8 +16,7 @@ // https://github.com/ocornut/imgui #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API IMGUI_IMPL_API bool ImGui_ImplGLUT_Init(); IMGUI_IMPL_API void ImGui_ImplGLUT_InstallFuncs(); diff --git a/examples/imgui_impl_marmalade.h b/examples/imgui_impl_marmalade.h index 6ff1cc23d..9e92d899f 100644 --- a/examples/imgui_impl_marmalade.h +++ b/examples/imgui_impl_marmalade.h @@ -9,15 +9,14 @@ // https://github.com/ocornut/imgui #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API IMGUI_IMPL_API bool ImGui_Marmalade_Init(bool install_callbacks); IMGUI_IMPL_API void ImGui_Marmalade_Shutdown(); IMGUI_IMPL_API void ImGui_Marmalade_NewFrame(); IMGUI_IMPL_API void ImGui_Marmalade_RenderDrawData(ImDrawData* draw_data); -// Use if you want to reset your rendering device without losing ImGui state. +// Use if you want to reset your rendering device without losing Dear ImGui state. IMGUI_IMPL_API void ImGui_Marmalade_InvalidateDeviceObjects(); IMGUI_IMPL_API bool ImGui_Marmalade_CreateDeviceObjects(); diff --git a/examples/imgui_impl_metal.h b/examples/imgui_impl_metal.h index bf43ef66e..f6e8fd2bc 100644 --- a/examples/imgui_impl_metal.h +++ b/examples/imgui_impl_metal.h @@ -9,7 +9,7 @@ // If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp. // https://github.com/ocornut/imgui -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API @class MTLRenderPassDescriptor; @protocol MTLDevice, MTLCommandBuffer, MTLRenderCommandEncoder; diff --git a/examples/imgui_impl_opengl2.h b/examples/imgui_impl_opengl2.h index 4e0185fcc..9b72cbba3 100644 --- a/examples/imgui_impl_opengl2.h +++ b/examples/imgui_impl_opengl2.h @@ -17,8 +17,7 @@ // The GL2 code is unable to reset attributes or even call e.g. "glUseProgram(0)" because they don't exist in that API. #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API IMGUI_IMPL_API bool ImGui_ImplOpenGL2_Init(); IMGUI_IMPL_API void ImGui_ImplOpenGL2_Shutdown(); diff --git a/examples/imgui_impl_opengl3.h b/examples/imgui_impl_opengl3.h index 9a651dc40..d55935a16 100644 --- a/examples/imgui_impl_opengl3.h +++ b/examples/imgui_impl_opengl3.h @@ -22,8 +22,7 @@ // Only override if your GL version doesn't handle this GLSL version. See GLSL version table at the top of imgui_impl_opengl3.cpp. #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API // Backend API IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL); diff --git a/examples/imgui_impl_osx.h b/examples/imgui_impl_osx.h index 52b44a6d6..dae5c0cef 100644 --- a/examples/imgui_impl_osx.h +++ b/examples/imgui_impl_osx.h @@ -8,12 +8,12 @@ // Issues: // [ ] Platform: Keys are all generally very broken. Best using [event keycode] and not [event characters].. -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API @class NSEvent; @class NSView; -IMGUI_API bool ImGui_ImplOSX_Init(); -IMGUI_API void ImGui_ImplOSX_Shutdown(); -IMGUI_API void ImGui_ImplOSX_NewFrame(NSView *_Nullable view); -IMGUI_API bool ImGui_ImplOSX_HandleEvent(NSEvent *_Nonnull event, NSView *_Nullable view); +IMGUI_IMPL_API bool ImGui_ImplOSX_Init(); +IMGUI_IMPL_API void ImGui_ImplOSX_Shutdown(); +IMGUI_IMPL_API void ImGui_ImplOSX_NewFrame(NSView *_Nullable view); +IMGUI_IMPL_API bool ImGui_ImplOSX_HandleEvent(NSEvent *_Nonnull event, NSView *_Nullable view); diff --git a/examples/imgui_impl_sdl.h b/examples/imgui_impl_sdl.h index ae2261d5b..bf207ba02 100644 --- a/examples/imgui_impl_sdl.h +++ b/examples/imgui_impl_sdl.h @@ -15,8 +15,7 @@ // https://github.com/ocornut/imgui #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API struct SDL_Window; typedef union SDL_Event SDL_Event; diff --git a/examples/imgui_impl_vulkan.h b/examples/imgui_impl_vulkan.h index ce02b4c2b..c85b5f28c 100644 --- a/examples/imgui_impl_vulkan.h +++ b/examples/imgui_impl_vulkan.h @@ -21,8 +21,7 @@ // Read comments in imgui_impl_vulkan.h. #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API #include // Initialization data, for ImGui_ImplVulkan_Init() diff --git a/examples/imgui_impl_win32.h b/examples/imgui_impl_win32.h index 328a37244..8923bd634 100644 --- a/examples/imgui_impl_win32.h +++ b/examples/imgui_impl_win32.h @@ -8,14 +8,14 @@ // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. #pragma once - -#include "imgui.h" +#include "imgui.h" // IMGUI_IMPL_API IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); -// Configuration: Disable gamepad support or linking with xinput.lib +// Configuration +// - Disable gamepad support or linking with xinput.lib //#define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD //#define IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT