Skip to content

Commit

Permalink
Overlay: update imgui to 1.83
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Aug 11, 2021
1 parent 28faec0 commit 17b7481
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CMake/Templates/imconfig.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
#include <OgreOverlayPrerequisites.h>
#define IMGUI_API _OgreOverlayExport
#define IMGUI_API _OgreOverlayExport
#cmakedefine IMGUI_ENABLE_FREETYPE
8 changes: 5 additions & 3 deletions Components/Overlay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,23 @@ list(APPEND HEADER_FILES
file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")

if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI)
set(IMGUI_DIR "${PROJECT_BINARY_DIR}/imgui-1.79" CACHE PATH "")
set(IMGUI_DIR "${PROJECT_BINARY_DIR}/imgui-1.83" CACHE PATH "")
if(NOT EXISTS ${IMGUI_DIR})
message(STATUS "Downloading imgui")
file(DOWNLOAD
https://github.com/ocornut/imgui/archive/v1.79.tar.gz
https://github.com/ocornut/imgui/archive/v1.83.tar.gz
${PROJECT_BINARY_DIR}/imgui.tar.gz)
execute_process(COMMAND ${CMAKE_COMMAND}
-E tar xf imgui.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
endif()
list(APPEND SOURCE_FILES
${IMGUI_DIR}/imgui.cpp
${IMGUI_DIR}/imgui_draw.cpp
${IMGUI_DIR}/imgui_tables.cpp
${IMGUI_DIR}/imgui_widgets.cpp
${IMGUI_DIR}/imgui_demo.cpp)
if(FREETYPE_FOUND)
set(IMGUI_ENABLE_FREETYPE TRUE)
list(APPEND SOURCE_FILES ${IMGUI_DIR}/misc/freetype/imgui_freetype.cpp)
endif()
else()
Expand Down Expand Up @@ -74,7 +76,7 @@ if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI)
COMPILE_FLAGS "-Wno-cast-qual")
endif()

configure_file(${OGRE_TEMPLATES_DIR}/imconfig.h ${IMGUI_DIR}/imconfig.h COPYONLY)
configure_file(${OGRE_TEMPLATES_DIR}/imconfig.h ${IMGUI_DIR}/imconfig.h)

list(APPEND HEADER_FILES
${IMGUI_DIR}/imgui.h
Expand Down
1 change: 1 addition & 0 deletions Components/Overlay/include/ImGui.i
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
%ignore ImGui::TextDisabledV;
%ignore ImGui::TextWrappedV;
%ignore ImGui::LabelTextV;
%ignore ImGui::LogTextV;
%ignore ImGui::BulletTextV;
%ignore ImGui::TreeNodeV;
%ignore ImGui::TreeNodeExV;
Expand Down
3 changes: 0 additions & 3 deletions Components/Overlay/src/OgreImGuiOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ void ImGuiOverlay::ImGUIRenderable::createFontTexture()
ImGuiIO& io = ImGui::GetIO();
if (io.Fonts->Fonts.empty())
io.Fonts->AddFontDefault();
#ifdef HAVE_FREETYPE
ImGuiFreeType::BuildFontAtlas(io.Fonts, 0);
#endif
unsigned char* pixels;
int width, height;
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);
Expand Down

0 comments on commit 17b7481

Please sign in to comment.