[Qt] Initial Imgui integration

This commit is contained in:
wheremyfoodat 2024-01-28 22:27:30 +02:00
parent 8ff2d7f9b2
commit 918645479a
211 changed files with 49460 additions and 21918 deletions

View file

@ -17,7 +17,7 @@ SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
UNAME_S := $(shell uname -s)
CXXFLAGS += -I$(IMGUI_DIR)
CXXFLAGS += -std=c++11 -I$(IMGUI_DIR)
CXXFLAGS += -g -Wall -Wformat
LIBS =
@ -40,7 +40,7 @@ endif
ifeq ($(UNAME_S), Linux) #LINUX
ECHO_MESSAGE = "Linux"
ifneq ($(WITH_EXTRA_WARNINGS), 0)
ifeq ($(WITH_EXTRA_WARNINGS), 1)
CXXFLAGS += -Wextra -Wpedantic
ifeq ($(shell $(CXX) -v 2>&1 | grep -c "clang version"), 1)
CXXFLAGS += -Wshadow -Wsign-conversion
@ -51,15 +51,15 @@ endif
ifeq ($(UNAME_S), Darwin) #APPLE
ECHO_MESSAGE = "Mac OS X"
ifneq ($(WITH_EXTRA_WARNINGS), 0)
CXXFLAGS += -Weverything -Wno-reserved-id-macro -Wno-c++98-compat-pedantic -Wno-padded -Wno-c++11-long-long
ifeq ($(WITH_EXTRA_WARNINGS), 1)
CXXFLAGS += -Weverything -Wno-reserved-id-macro -Wno-c++98-compat-pedantic -Wno-padded -Wno-poison-system-directories
endif
CFLAGS = $(CXXFLAGS)
endif
ifeq ($(OS), Windows_NT)
ECHO_MESSAGE = "MinGW"
ifneq ($(WITH_EXTRA_WARNINGS), 0)
ifeq ($(WITH_EXTRA_WARNINGS), 1)
CXXFLAGS += -Wextra -Wpedantic
endif
LIBS += -limm32

View file

@ -1,3 +1,3 @@
@REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler.
mkdir Debug
cl /nologo /Zi /MD /I ..\.. %* *.cpp ..\..\*.cpp /FeDebug/example_null.exe /FoDebug/ /link gdi32.lib shell32.lib imm32.lib
cl /nologo /Zi /MD /utf-8 /I ..\.. %* *.cpp ..\..\*.cpp /FeDebug/example_null.exe /FoDebug/ /link gdi32.lib shell32.lib imm32.lib

View file

@ -11,7 +11,7 @@ int main(int, char**)
ImGuiIO& io = ImGui::GetIO();
// Build atlas
unsigned char* tex_pixels = NULL;
unsigned char* tex_pixels = nullptr;
int tex_w, tex_h;
io.Fonts->GetTexDataAsRGBA32(&tex_pixels, &tex_w, &tex_h);
@ -26,7 +26,7 @@ int main(int, char**)
ImGui::Text("Hello, world!");
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
ImGui::ShowDemoWindow(NULL);
ImGui::ShowDemoWindow(nullptr);
ImGui::Render();
}