Skip to content

Commit

Permalink
Drop imgui-cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
pongo1231 committed Aug 2, 2023
1 parent e48ecd8 commit 0232879
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
path = vendor/minhook
url = https://github.com/TsudaKageyu/minhook.git
ignore = dirty
[submodule "vendor/imgui"]
path = vendor/imgui
url = https://github.com/Pesc0/imgui-cmake.git
ignore = dirty
[submodule "vendor/shv"]
path = vendor/shv
url = https://github.com/pongo1231/shv_no_msvc
ignore = dirty
[submodule "vendor/imgui"]
path = vendor/imgui
url = https://github.com/ocornut/imgui
ignore = dirty
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,35 @@ cmake_minimum_required(VERSION 3.12)
project(ScriptViewer)

add_subdirectory(vendor/shv)
add_subdirectory(vendor/imgui)
#add_subdirectory(vendor/imgui)
add_subdirectory(vendor/minhook)

file(GLOB_RECURSE src ScriptViewer/*.cpp)
add_library(ScriptViewer MODULE ${src})

set_property(TARGET ScriptViewer PROPERTY CXX_STANDARD 20)

set(IMGUI_PATH "vendor/imgui")
file(GLOB IMGUI_SOURCES ${IMGUI_PATH}/*.cpp ${IMGUI_PATH}/backends/imgui_impl_dx11.cpp ${IMGUI_PATH}/backends/imgui_impl_win32.cpp)
add_library(ImGui STATIC ${IMGUI_SOURCES})
target_include_directories(ImGui PUBLIC ${IMGUI_PATH} ${IMGUI_PATH}/backends)

if (RELOADABLE)
target_compile_definitions(ScriptViewer PRIVATE RELOADABLE)
endif ()

target_compile_options(ScriptViewer PRIVATE -municode -fpermissive)
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_compile_options(ScriptViewer PRIVATE -DUNICODE -D_UNICODE -DNOMINMAX /Zi)
target_link_options(ScriptViewer PRIVATE /DEBUG /OPT:REF /OPT:ICF)
else()
target_compile_options(ScriptViewer PRIVATE -municode -fpermissive)
target_link_options(ScriptViewer PRIVATE -static)
endif()

target_precompile_headers(ScriptViewer PUBLIC ScriptViewer/stdafx.h)

target_include_directories(ScriptViewer PUBLIC ScriptViewer)

target_link_libraries(ScriptViewer PRIVATE shv IMGUI minhook d3dcompiler dwmapi)
target_link_options(ScriptViewer PRIVATE -static)
target_link_libraries(ScriptViewer PRIVATE shv minhook d3dcompiler dwmapi ImGui)

set_target_properties(ScriptViewer PROPERTIES SUFFIX ".asi")
4 changes: 2 additions & 2 deletions ScriptViewer/Components/GlobalView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void GlobalView::RunImGui()

if (ms_pGlobals && ms_pcwGlobals)
{
ImGui::ListBoxHeader("");
ImGui::BeginListBox("");

for (WORD wGlobalIdx = 0; wGlobalIdx < *ms_pcwGlobals; wGlobalIdx++)
{
Expand All @@ -26,7 +26,7 @@ void GlobalView::RunImGui()
}
}

ImGui::ListBoxFooter();
ImGui::EndListBox();
}

ImGui::End();
Expand Down
9 changes: 4 additions & 5 deletions ScriptViewer/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ typedef unsigned int DWORD_t;

#include "../vendor/minhook/include/MinHook.h"

#include "../vendor/imgui/libs/imgui/backends/imgui_impl_dx11.h"
#include "../vendor/imgui/libs/imgui/backends/imgui_impl_win32.h"
#include "../vendor/imgui/libs/imgui/imgui.h"
#include "../vendor/imgui/libs/imgui/imgui_internal.h"
#include <setjmp.h>
#include "../vendor/imgui/backends/imgui_impl_dx11.h"
#include "../vendor/imgui/backends/imgui_impl_win32.h"
#include "../vendor/imgui/imgui.h"
#include "../vendor/imgui/imgui_internal.h"

#define WIN32_LEAN_AND_MEAN
#include <excpt.h>
Expand Down
2 changes: 1 addition & 1 deletion vendor/imgui
Submodule imgui updated from a85510 to f7eea6

0 comments on commit 0232879

Please sign in to comment.