Skip to content

Commit

Permalink
Bump imgui
Browse files Browse the repository at this point in the history
  • Loading branch information
Segfaultd committed Dec 15, 2024
1 parent 18d0914 commit efc51e7
Show file tree
Hide file tree
Showing 157 changed files with 34,667 additions and 14,495 deletions.
5 changes: 0 additions & 5 deletions code/framework/src/external/imgui/widgets/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ namespace Framework::External::ImGUI::Widgets {
}
else {
ImGui::SetNextWindowBgAlpha(_consoleUnfocusedAlpha);
ImGui::PushFontShadow(0xFF000000);
}

auto windowFlags = ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse;
Expand Down Expand Up @@ -299,10 +298,6 @@ namespace Framework::External::ImGUI::Widgets {
ImGui::Separator();
ImGui::TextColored(ImVec4(1, 0, 0, 1), "Press ALT to return controls to game or console");

if (!_consoleControl) {
ImGui::PopFontShadow();
}

ImGui::End();

return true;
Expand Down
6 changes: 1 addition & 5 deletions code/framework/src/external/imgui/widgets/corner_text.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Framework::External::ImGUI::Widgets {
CORNER_RIGHT_BOTTOM,
};
// Adapted from Mafia: Oakwood Multiplayer
static inline void DrawCornerText(Corner corner, const std::string &text, bool shadow = true) {
static inline void DrawCornerText(Corner corner, const std::string &text) {
constexpr float padding = 2.0f;
ImGuiIO &io = ImGui::GetIO();
ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;
Expand All @@ -40,11 +40,7 @@ namespace Framework::External::ImGUI::Widgets {
const auto windowName = fmt::format("Overlay #{}", corner);

if (ImGui::Begin(windowName.c_str(), nullptr, window_flags)) {
if (shadow)
ImGui::PushFontShadow(0xFF000000);
ImGui::Text("%s", text.c_str());
if (shadow)
ImGui::PopFontShadow();
}
ImGui::End();
}
Expand Down
21 changes: 0 additions & 21 deletions code/framework/src/external/imgui/wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <backends/imgui_impl_dx11.h>
#include <backends/imgui_impl_dx12.h>
#include <backends/imgui_impl_dx9.h>
#include <backends/imgui_impl_sdl.h>
#include <backends/imgui_impl_win32.h>

extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
Expand All @@ -34,10 +33,6 @@ namespace Framework::External::ImGUI {
return Error::IMGUI_WINDOW_NOT_SET;
}

if (!_config.sdlWindow && _config.windowBackend == Graphics::PlatformBackend::PLATFORM_SDL2) {
return Error::IMGUI_WINDOW_NOT_SET;
}

IMGUI_CHECKVERSION();
ImGui::CreateContext();
auto &io = ImGui::GetIO();
Expand Down Expand Up @@ -65,9 +60,6 @@ namespace Framework::External::ImGUI {
case Graphics::PlatformBackend::PLATFORM_WIN32: {
ImGui_ImplWin32_Init(_config.windowHandle);
} break;
case Graphics::PlatformBackend::PLATFORM_SDL2: {
ImGui_ImplSDL2_InitForD3D(_config.sdlWindow);
} break;
}

_initialized = isContextInitialized = true;
Expand Down Expand Up @@ -95,9 +87,6 @@ namespace Framework::External::ImGUI {
case Graphics::PlatformBackend::PLATFORM_WIN32: {
ImGui_ImplWin32_Shutdown();
} break;
case Graphics::PlatformBackend::PLATFORM_SDL2: {
ImGui_ImplSDL2_Shutdown();
} break;
}

ImGui::DestroyContext();
Expand Down Expand Up @@ -125,9 +114,6 @@ namespace Framework::External::ImGUI {
case Graphics::PlatformBackend::PLATFORM_WIN32: {
ImGui_ImplWin32_NewFrame();
} break;
case Graphics::PlatformBackend::PLATFORM_SDL2: {
ImGui_ImplSDL2_NewFrame();
} break;
}

ImGui::NewFrame();
Expand Down Expand Up @@ -173,13 +159,6 @@ namespace Framework::External::ImGUI {
}

InputState Wrapper::ProcessEvent(const SDL_Event *event) const {
if (_config.windowBackend != Graphics::PlatformBackend::PLATFORM_SDL2) {
return InputState::ERROR_MISMATCH;
}

if (ImGui_ImplSDL2_ProcessEvent(event)) {
return InputState::BLOCK;
}
return InputState::PASS;
}

Expand Down
1 change: 0 additions & 1 deletion code/framework/src/graphics/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ namespace Framework::Graphics {

enum class PlatformBackend {
PLATFORM_WIN32,
PLATFORM_SDL2
};

enum class RendererState {
Expand Down
24 changes: 0 additions & 24 deletions vendors/imgui/.editorconfig

This file was deleted.

30 changes: 0 additions & 30 deletions vendors/imgui/.gitattributes

This file was deleted.

53 changes: 0 additions & 53 deletions vendors/imgui/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion vendors/imgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ add_library(DearImGUI STATIC
backends/imgui_impl_dx9.cpp
backends/imgui_impl_dx11.cpp
backends/imgui_impl_dx12.cpp
backends/imgui_impl_sdl.cpp
backends/imgui_impl_win32.cpp
)

Expand Down
21 changes: 21 additions & 0 deletions vendors/imgui/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014-2024 Omar Cornut

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit efc51e7

Please sign in to comment.