diff --git a/backends/imgui_impl_dx10.cpp b/backends/imgui_impl_dx10.cpp index d6dfe397a..16256feb2 100644 --- a/backends/imgui_impl_dx10.cpp +++ b/backends/imgui_impl_dx10.cpp @@ -595,7 +595,7 @@ void ImGui_ImplDX10_NewFrame() // If you are new to dear imgui or creating a new binding for dear imgui, it is recommended that you completely ignore this section first.. //-------------------------------------------------------------------------------------------------------- -// Helper structure we store in the void* RenderUserData field of each ImGuiViewport to easily retrieve our backend data. +// Helper structure we store in the void* RendererUserData field of each ImGuiViewport to easily retrieve our backend data. struct ImGui_ImplDX10_ViewportData { IDXGISwapChain* SwapChain; @@ -612,7 +612,7 @@ static void ImGui_ImplDX10_CreateWindow(ImGuiViewport* viewport) viewport->RendererUserData = vd; // PlatformHandleRaw should always be a HWND, whereas PlatformHandle might be a higher-level handle (e.g. GLFWWindow*, SDL_Window*). - // Some backends will leave PlatformHandleRaw NULL, in which case we assume PlatformHandle will contain the HWND. + // Some backends will leave PlatformHandleRaw == 0, in which case we assume PlatformHandle will contain the HWND. HWND hwnd = viewport->PlatformHandleRaw ? (HWND)viewport->PlatformHandleRaw : (HWND)viewport->PlatformHandle; IM_ASSERT(hwnd != 0); @@ -646,7 +646,7 @@ static void ImGui_ImplDX10_CreateWindow(ImGuiViewport* viewport) static void ImGui_ImplDX10_DestroyWindow(ImGuiViewport* viewport) { - // The main viewport (owned by the application) will always have RendererUserData == NULL here since we didn't create the data for it. + // The main viewport (owned by the application) will always have RendererUserData == 0 here since we didn't create the data for it. if (ImGui_ImplDX10_ViewportData* vd = (ImGui_ImplDX10_ViewportData*)viewport->RendererUserData) { if (vd->SwapChain) diff --git a/backends/imgui_impl_dx11.cpp b/backends/imgui_impl_dx11.cpp index 5117b7fbb..69d097e0d 100644 --- a/backends/imgui_impl_dx11.cpp +++ b/backends/imgui_impl_dx11.cpp @@ -612,7 +612,7 @@ void ImGui_ImplDX11_NewFrame() // If you are new to dear imgui or creating a new binding for dear imgui, it is recommended that you completely ignore this section first.. //-------------------------------------------------------------------------------------------------------- -// Helper structure we store in the void* RenderUserData field of each ImGuiViewport to easily retrieve our backend data. +// Helper structure we store in the void* RendererUserData field of each ImGuiViewport to easily retrieve our backend data. struct ImGui_ImplDX11_ViewportData { IDXGISwapChain* SwapChain; @@ -629,7 +629,7 @@ static void ImGui_ImplDX11_CreateWindow(ImGuiViewport* viewport) viewport->RendererUserData = vd; // PlatformHandleRaw should always be a HWND, whereas PlatformHandle might be a higher-level handle (e.g. GLFWWindow*, SDL_Window*). - // Some backends will leave PlatformHandleRaw NULL, in which case we assume PlatformHandle will contain the HWND. + // Some backends will leave PlatformHandleRaw == 0, in which case we assume PlatformHandle will contain the HWND. HWND hwnd = viewport->PlatformHandleRaw ? (HWND)viewport->PlatformHandleRaw : (HWND)viewport->PlatformHandle; IM_ASSERT(hwnd != 0); diff --git a/backends/imgui_impl_dx12.cpp b/backends/imgui_impl_dx12.cpp index ba186623b..9a5875db5 100644 --- a/backends/imgui_impl_dx12.cpp +++ b/backends/imgui_impl_dx12.cpp @@ -847,7 +847,7 @@ static void ImGui_ImplDX12_CreateWindow(ImGuiViewport* viewport) viewport->RendererUserData = vd; // PlatformHandleRaw should always be a HWND, whereas PlatformHandle might be a higher-level handle (e.g. GLFWWindow*, SDL_Window*). - // Some backends will leave PlatformHandleRaw NULL, in which case we assume PlatformHandle will contain the HWND. + // Some backends will leave PlatformHandleRaw == 0, in which case we assume PlatformHandle will contain the HWND. HWND hwnd = viewport->PlatformHandleRaw ? (HWND)viewport->PlatformHandleRaw : (HWND)viewport->PlatformHandle; IM_ASSERT(hwnd != 0); @@ -962,7 +962,7 @@ static void ImGui_WaitForPendingOperations(ImGui_ImplDX12_ViewportData* vd) static void ImGui_ImplDX12_DestroyWindow(ImGuiViewport* viewport) { - // The main viewport (owned by the application) will always have RendererUserData == NULL since we didn't create the data for it. + // The main viewport (owned by the application) will always have RendererUserData == 0 since we didn't create the data for it. ImGui_ImplDX12_Data* bd = ImGui_ImplDX12_GetBackendData(); if (ImGui_ImplDX12_ViewportData* vd = (ImGui_ImplDX12_ViewportData*)viewport->RendererUserData) { diff --git a/backends/imgui_impl_dx9.cpp b/backends/imgui_impl_dx9.cpp index c846b3330..72f99497e 100644 --- a/backends/imgui_impl_dx9.cpp +++ b/backends/imgui_impl_dx9.cpp @@ -404,7 +404,7 @@ void ImGui_ImplDX9_NewFrame() // If you are new to dear imgui or creating a new binding for dear imgui, it is recommended that you completely ignore this section first.. //-------------------------------------------------------------------------------------------------------- -// Helper structure we store in the void* RenderUserData field of each ImGuiViewport to easily retrieve our backend data. +// Helper structure we store in the void* RendererUserData field of each ImGuiViewport to easily retrieve our backend data. struct ImGui_ImplDX9_ViewportData { IDirect3DSwapChain9* SwapChain; @@ -421,7 +421,7 @@ static void ImGui_ImplDX9_CreateWindow(ImGuiViewport* viewport) viewport->RendererUserData = vd; // PlatformHandleRaw should always be a HWND, whereas PlatformHandle might be a higher-level handle (e.g. GLFWWindow*, SDL_Window*). - // Some backends will leave PlatformHandleRaw NULL, in which case we assume PlatformHandle will contain the HWND. + // Some backends will leave PlatformHandleRaw == 0, in which case we assume PlatformHandle will contain the HWND. HWND hwnd = viewport->PlatformHandleRaw ? (HWND)viewport->PlatformHandleRaw : (HWND)viewport->PlatformHandle; IM_ASSERT(hwnd != 0); @@ -443,7 +443,7 @@ static void ImGui_ImplDX9_CreateWindow(ImGuiViewport* viewport) static void ImGui_ImplDX9_DestroyWindow(ImGuiViewport* viewport) { - // The main viewport (owned by the application) will always have RendererUserData == NULL since we didn't create the data for it. + // The main viewport (owned by the application) will always have RendererUserData == 0 since we didn't create the data for it. if (ImGui_ImplDX9_ViewportData* vd = (ImGui_ImplDX9_ViewportData*)viewport->RendererUserData) { if (vd->SwapChain) diff --git a/backends/imgui_impl_glfw.cpp b/backends/imgui_impl_glfw.cpp index 750acf257..54ba606dd 100644 --- a/backends/imgui_impl_glfw.cpp +++ b/backends/imgui_impl_glfw.cpp @@ -886,7 +886,7 @@ static void ImGui_ImplGlfw_UpdateMonitors() int x, y; glfwGetMonitorPos(glfw_monitors[n], &x, &y); const GLFWvidmode* vid_mode = glfwGetVideoMode(glfw_monitors[n]); - if (vid_mode == NULL) + if (vid_mode == nullptr) continue; // Failed to get Video mode (e.g. Emscripten does not support this function) monitor.MainPos = monitor.WorkPos = ImVec2((float)x, (float)y); monitor.MainSize = monitor.WorkSize = ImVec2((float)vid_mode->width, (float)vid_mode->height); @@ -944,7 +944,7 @@ void ImGui_ImplGlfw_NewFrame() // If you are new to dear imgui or creating a new binding for dear imgui, it is recommended that you completely ignore this section first.. //-------------------------------------------------------------------------------------------------------- -// Helper structure we store in the void* RenderUserData field of each ImGuiViewport to easily retrieve our backend data. +// Helper structure we store in the void* RendererUserData field of each ImGuiViewport to easily retrieve our backend data. struct ImGui_ImplGlfw_ViewportData { GLFWwindow* Window; diff --git a/backends/imgui_impl_metal.mm b/backends/imgui_impl_metal.mm index 358bc10c3..5af0d27d3 100644 --- a/backends/imgui_impl_metal.mm +++ b/backends/imgui_impl_metal.mm @@ -411,7 +411,7 @@ static void ImGui_ImplMetal_CreateWindow(ImGuiViewport* viewport) viewport->RendererUserData = data; // PlatformHandleRaw should always be a NSWindow*, whereas PlatformHandle might be a higher-level handle (e.g. GLFWWindow*, SDL_Window*). - // Some back-ends will leave PlatformHandleRaw NULL, in which case we assume PlatformHandle will contain the NSWindow*. + // Some back-ends will leave PlatformHandleRaw == 0, in which case we assume PlatformHandle will contain the NSWindow*. void* handle = viewport->PlatformHandleRaw ? viewport->PlatformHandleRaw : viewport->PlatformHandle; IM_ASSERT(handle != nullptr); @@ -434,7 +434,7 @@ static void ImGui_ImplMetal_CreateWindow(ImGuiViewport* viewport) static void ImGui_ImplMetal_DestroyWindow(ImGuiViewport* viewport) { - // The main viewport (owned by the application) will always have RendererUserData == NULL since we didn't create the data for it. + // The main viewport (owned by the application) will always have RendererUserData == 0 since we didn't create the data for it. if (ImGuiViewportDataMetal* data = (ImGuiViewportDataMetal*)viewport->RendererUserData) IM_DELETE(data); viewport->RendererUserData = nullptr; diff --git a/backends/imgui_impl_osx.mm b/backends/imgui_impl_osx.mm index bfdd84460..296916e4b 100644 --- a/backends/imgui_impl_osx.mm +++ b/backends/imgui_impl_osx.mm @@ -904,7 +904,7 @@ static void ImGui_ImplOSX_DestroyWindow(ImGuiViewport* viewport) data->Window = nil; IM_DELETE(data); } - viewport->PlatformUserData = viewport->PlatformHandle = viewport->PlatformHandleRaw = NULL; + viewport->PlatformUserData = viewport->PlatformHandle = viewport->PlatformHandleRaw = nullptr; } static void ImGui_ImplOSX_ShowWindow(ImGuiViewport* viewport) @@ -1080,17 +1080,17 @@ static void ImGui_ImplOSX_ShutdownPlatformInterface() [NSNotificationCenter.defaultCenter removeObserver:bd->Observer name:NSApplicationDidChangeScreenParametersNotification object:nil]; - bd->Observer = NULL; - bd->Window = NULL; - if (bd->Monitor != NULL) + bd->Observer = nullptr; + bd->Window = nullptr; + if (bd->Monitor != nullptr) { [NSEvent removeMonitor:bd->Monitor]; - bd->Monitor = NULL; + bd->Monitor = nullptr; } ImGuiViewport* main_viewport = ImGui::GetMainViewport(); ImGuiViewportDataOSX* data = (ImGuiViewportDataOSX*)main_viewport->PlatformUserData; IM_DELETE(data); - main_viewport->PlatformUserData = NULL; + main_viewport->PlatformUserData = nullptr; ImGui::DestroyPlatformWindows(); } diff --git a/backends/imgui_impl_sdl2.cpp b/backends/imgui_impl_sdl2.cpp index 8149ed031..9b214ef3f 100644 --- a/backends/imgui_impl_sdl2.cpp +++ b/backends/imgui_impl_sdl2.cpp @@ -777,7 +777,7 @@ void ImGui_ImplSDL2_NewFrame() // If you are new to dear imgui or creating a new binding for dear imgui, it is recommended that you completely ignore this section first.. //-------------------------------------------------------------------------------------------------------- -// Helper structure we store in the void* RenderUserData field of each ImGuiViewport to easily retrieve our backend data. +// Helper structure we store in the void* RendererUserData field of each ImGuiViewport to easily retrieve our backend data. struct ImGui_ImplSDL2_ViewportData { SDL_Window* Window; diff --git a/backends/imgui_impl_sdl3.cpp b/backends/imgui_impl_sdl3.cpp index 5f962ae75..89e64da3f 100644 --- a/backends/imgui_impl_sdl3.cpp +++ b/backends/imgui_impl_sdl3.cpp @@ -699,7 +699,7 @@ void ImGui_ImplSDL3_NewFrame() // If you are new to dear imgui or creating a new binding for dear imgui, it is recommended that you completely ignore this section first.. //-------------------------------------------------------------------------------------------------------- -// Helper structure we store in the void* RenderUserData field of each ImGuiViewport to easily retrieve our backend data. +// Helper structure we store in the void* RendererUserData field of each ImGuiViewport to easily retrieve our backend data. struct ImGui_ImplSDL3_ViewportData { SDL_Window* Window; diff --git a/backends/imgui_impl_vulkan.cpp b/backends/imgui_impl_vulkan.cpp index b026e9872..5b7bf7b88 100644 --- a/backends/imgui_impl_vulkan.cpp +++ b/backends/imgui_impl_vulkan.cpp @@ -97,7 +97,7 @@ struct ImGui_ImplVulkanH_WindowRenderBuffers }; // For multi-viewport support: -// Helper structure we store in the void* RenderUserData field of each ImGuiViewport to easily retrieve our backend data. +// Helper structure we store in the void* RendererUserData field of each ImGuiViewport to easily retrieve our backend data. struct ImGui_ImplVulkan_ViewportData { bool WindowOwned; @@ -1558,7 +1558,7 @@ static void ImGui_ImplVulkan_CreateWindow(ImGuiViewport* viewport) static void ImGui_ImplVulkan_DestroyWindow(ImGuiViewport* viewport) { - // The main viewport (owned by the application) will always have RendererUserData == NULL since we didn't create the data for it. + // The main viewport (owned by the application) will always have RendererUserData == 0 since we didn't create the data for it. ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData(); if (ImGui_ImplVulkan_ViewportData* vd = (ImGui_ImplVulkan_ViewportData*)viewport->RendererUserData) { diff --git a/backends/imgui_impl_win32.cpp b/backends/imgui_impl_win32.cpp index 8b72e6e82..ec2c2da65 100644 --- a/backends/imgui_impl_win32.cpp +++ b/backends/imgui_impl_win32.cpp @@ -892,7 +892,7 @@ float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd) // If you are new to dear imgui or creating a new binding for dear imgui, it is recommended that you completely ignore this section first.. //-------------------------------------------------------------------------------------------------------- -// Helper structure we store in the void* RenderUserData field of each ImGuiViewport to easily retrieve our backend data. +// Helper structure we store in the void* RendererUserData field of each ImGuiViewport to easily retrieve our backend data. struct ImGui_ImplWin32_ViewportData { HWND Hwnd; @@ -1019,7 +1019,7 @@ static void ImGui_ImplWin32_SetWindowPos(ImGuiViewport* viewport, ImVec2 pos) IM_ASSERT(vd->Hwnd != 0); RECT rect = { (LONG)pos.x, (LONG)pos.y, (LONG)pos.x, (LONG)pos.y }; ::AdjustWindowRectEx(&rect, vd->DwStyle, FALSE, vd->DwExStyle); - ::SetWindowPos(vd->Hwnd, NULL, rect.left, rect.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); + ::SetWindowPos(vd->Hwnd, nullptr, rect.left, rect.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); } static ImVec2 ImGui_ImplWin32_GetWindowSize(ImGuiViewport* viewport) diff --git a/examples/example_win32_directx11/main.cpp b/examples/example_win32_directx11/main.cpp index 24a4c007f..267e5ff93 100644 --- a/examples/example_win32_directx11/main.cpp +++ b/examples/example_win32_directx11/main.cpp @@ -279,7 +279,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) //const int dpi = HIWORD(wParam); //printf("WM_DPICHANGED to %d (%.0f%%)\n", dpi, (float)dpi / 96.0f * 100.0f); const RECT* suggested_rect = (RECT*)lParam; - ::SetWindowPos(hWnd, NULL, suggested_rect->left, suggested_rect->top, suggested_rect->right - suggested_rect->left, suggested_rect->bottom - suggested_rect->top, SWP_NOZORDER | SWP_NOACTIVATE); + ::SetWindowPos(hWnd, nullptr, suggested_rect->left, suggested_rect->top, suggested_rect->right - suggested_rect->left, suggested_rect->bottom - suggested_rect->top, SWP_NOZORDER | SWP_NOACTIVATE); } break; } diff --git a/examples/example_win32_directx12/main.cpp b/examples/example_win32_directx12/main.cpp index 109c45cb2..d434081fd 100644 --- a/examples/example_win32_directx12/main.cpp +++ b/examples/example_win32_directx12/main.cpp @@ -221,7 +221,7 @@ int main(int, char**) if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable) { ImGui::UpdatePlatformWindows(); - ImGui::RenderPlatformWindowsDefault(NULL, (void*)g_pd3dCommandList); + ImGui::RenderPlatformWindowsDefault(nullptr, (void*)g_pd3dCommandList); } g_pSwapChain->Present(1, 0); // Present with vsync diff --git a/examples/example_win32_directx9/main.cpp b/examples/example_win32_directx9/main.cpp index a627c6351..d3e6dddb1 100644 --- a/examples/example_win32_directx9/main.cpp +++ b/examples/example_win32_directx9/main.cpp @@ -262,7 +262,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) //const int dpi = HIWORD(wParam); //printf("WM_DPICHANGED to %d (%.0f%%)\n", dpi, (float)dpi / 96.0f * 100.0f); const RECT* suggested_rect = (RECT*)lParam; - ::SetWindowPos(hWnd, NULL, suggested_rect->left, suggested_rect->top, suggested_rect->right - suggested_rect->left, suggested_rect->bottom - suggested_rect->top, SWP_NOZORDER | SWP_NOACTIVATE); + ::SetWindowPos(hWnd, nullptr, suggested_rect->left, suggested_rect->top, suggested_rect->right - suggested_rect->left, suggested_rect->bottom - suggested_rect->top, SWP_NOZORDER | SWP_NOACTIVATE); } break; }