Commit f396417e authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: add ImGui (https://github.com/ocornut/imgui/tree/docking)

Everything is hooked up to the engine and functional, but nothing in this branch is utilizing this yet.
parent f3765743
......@@ -846,7 +846,7 @@ endif
##### External library paths
ifeq ($(PLATFORM),WINDOWS)
COMPILERFLAGS += -Iplatform/Windows/include
COMPILERFLAGS += -Iplatform/Windows/include -Iplatform/Windows/include/SDL2
LIBDIRS += -Lplatform/Windows/lib/$(BITS)
else ifeq ($(PLATFORM),DARWIN)
ifneq ($(shell port --version &>/dev/null; echo $$?),127)
......
......@@ -172,6 +172,26 @@ mimalloc_obj := $(obj)/$(mimalloc)
mimalloc_cflags := -D_WIN32_WINNT=0x0600 -DMI_USE_RTLGENRANDOM -DMI_SHOW_ERRORS -I$(mimalloc_inc) -fexceptions -Wno-cast-qual -Wno-class-memaccess -Wno-unknown-pragmas
#### imgui
imgui := imgui
imgui_objs := \
imgui.cpp \
imgui_demo.cpp \
imgui_draw.cpp \
imgui_impl_opengl3.cpp \
imgui_impl_sdl.cpp \
imgui_tables.cpp \
imgui_widgets.cpp \
imgui_root := $(source)/$(imgui)
imgui_src := $(imgui_root)/src
imgui_inc := $(imgui_root)/include
imgui_obj := $(obj)/$(imgui)
imgui_cflags := -I$(imgui_inc) -Wno-cast-qual -Wno-cast-function-type
#### Voidwrap
voidwrap := voidwrap
......@@ -226,9 +246,9 @@ engine_src := $(engine_root)/src
engine_inc := $(engine_root)/include
engine_obj := $(obj)/$(engine)
engine_cflags := -I$(engine_src) -I$(mimalloc_inc)
engine_cflags := -I$(engine_src) -I$(mimalloc_inc) -I$(imgui_inc)
engine_deps := mimalloc
engine_deps := mimalloc imgui
ifneq (0,$(USE_PHYSFS))
engine_deps += physfs
......@@ -796,6 +816,7 @@ COMPILERFLAGS += \
-I$(glad_inc) \
-I$(voidwrap_inc) \
-I$(mimalloc_inc) \
-I$(imgui_inc) \
-MP -MMD \
ifneq (0,$(USE_PHYSFS))
......@@ -817,6 +838,7 @@ libraries := \
audiolib \
engine \
glad \
imgui \
libxmplite \
mimalloc \
mact \
......
......@@ -20,6 +20,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "build", "build.vcxproj", "{
ProjectSection(ProjectDependencies) = postProject
{1150264B-19C6-4C32-A204-CB79E96D5492} = {1150264B-19C6-4C32-A204-CB79E96D5492}
{6AC1D997-8DAE-4343-8DD8-DA2A1CA63212} = {6AC1D997-8DAE-4343-8DD8-DA2A1CA63212}
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5} = {C782E1F1-AACE-4C00-AFAF-3448DAC597C5}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapster32", "mapster32.vcxproj", "{EC8A030F-08E9-45F6-896B-95BEC9E9FC61}"
......@@ -29,6 +30,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapster32", "mapster32.vcxp
{DBECB851-5624-4FA8-9A9D-7169D0F12FF1} = {DBECB851-5624-4FA8-9A9D-7169D0F12FF1}
{32D4CF70-A3D6-4CEA-81D7-64C743980276} = {32D4CF70-A3D6-4CEA-81D7-64C743980276}
{6AC1D997-8DAE-4343-8DD8-DA2A1CA63212} = {6AC1D997-8DAE-4343-8DD8-DA2A1CA63212}
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5} = {C782E1F1-AACE-4C00-AFAF-3448DAC597C5}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "audiolib", "audiolib.vcxproj", "{0029C61B-B63D-4E61-99F2-F4E49AABFC47}"
......@@ -60,6 +62,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "voidwrap", "voidwrap.vcxpro
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mimalloc", "mimalloc.vcxproj", "{1150264B-19C6-4C32-A204-CB79E96D5492}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imgui", "imgui.vcxproj", "{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}"
ProjectSection(ProjectDependencies) = postProject
{6AC1D997-8DAE-4343-8DD8-DA2A1CA63212} = {6AC1D997-8DAE-4343-8DD8-DA2A1CA63212}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
......@@ -184,6 +191,18 @@ Global
{1150264B-19C6-4C32-A204-CB79E96D5492}.Release|Win32.Build.0 = Release|Win32
{1150264B-19C6-4C32-A204-CB79E96D5492}.Release|x64.ActiveCfg = Release|x64
{1150264B-19C6-4C32-A204-CB79E96D5492}.Release|x64.Build.0 = Release|x64
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}.Debug|ARM64.ActiveCfg = Debug|ARM64
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}.Debug|ARM64.Build.0 = Debug|ARM64
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}.Debug|Win32.ActiveCfg = Debug|Win32
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}.Debug|Win32.Build.0 = Debug|Win32
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}.Debug|x64.ActiveCfg = Debug|x64
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}.Debug|x64.Build.0 = Debug|x64
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}.Release|ARM64.ActiveCfg = Release|ARM64
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}.Release|ARM64.Build.0 = Release|ARM64
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}.Release|Win32.ActiveCfg = Release|Win32
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}.Release|Win32.Build.0 = Release|Win32
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}.Release|x64.ActiveCfg = Release|x64
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -200,6 +219,7 @@ Global
{7FEE789D-693C-4912-B989-A91371FC9C49} = {18C3CB5F-1DE6-4CFE-B7F7-ABE824222E1C}
{01230AD2-3746-418F-84D8-189E7CBC16C9} = {8BD117A0-7FA2-44B0-88A5-29D6C220601E}
{1150264B-19C6-4C32-A204-CB79E96D5492} = {8BD117A0-7FA2-44B0-88A5-29D6C220601E}
{C782E1F1-AACE-4C00-AFAF-3448DAC597C5} = {8BD117A0-7FA2-44B0-88A5-29D6C220601E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0346D2C0-3EB9-4AFB-973F-2904758D6C02}
......
......@@ -397,6 +397,9 @@
<ProjectReference Include="mimalloc.vcxproj">
<Project>{1150264b-19c6-4c32-a204-cb79e96d5492}</Project>
</ProjectReference>
<ProjectReference Include="imgui.vcxproj">
<Project>{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\source\duke3d\rsrc\gameres.rc">
......@@ -414,4 +417,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\source\imgui\include\imconfig.h" />
<ClInclude Include="..\..\source\imgui\include\imgui.h" />
<ClInclude Include="..\..\source\imgui\include\imgui_impl_opengl3.h" />
<ClInclude Include="..\..\source\imgui\include\imgui_impl_opengl3_loader.h" />
<ClInclude Include="..\..\source\imgui\include\imgui_impl_sdl.h" />
<ClInclude Include="..\..\source\imgui\include\imgui_internal.h" />
<ClInclude Include="..\..\source\imgui\include\imstb_rectpack.h" />
<ClInclude Include="..\..\source\imgui\include\imstb_textedit.h" />
<ClInclude Include="..\..\source\imgui\include\imstb_truetype.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\source\imgui\src\imgui.cpp" />
<ClCompile Include="..\..\source\imgui\src\imgui_demo.cpp" />
<ClCompile Include="..\..\source\imgui\src\imgui_draw.cpp" />
<ClCompile Include="..\..\source\imgui\src\imgui_impl_opengl3.cpp" />
<ClCompile Include="..\..\source\imgui\src\imgui_impl_sdl.cpp" />
<ClCompile Include="..\..\source\imgui\src\imgui_tables.cpp" />
<ClCompile Include="..\..\source\imgui\src\imgui_widgets.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<RootNamespace>imgui</RootNamespace>
<ProjectName>imgui</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectGuid>{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<EnableASAN>true</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="props\build_x64.props" />
<Import Project="props\build_common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="props\build_x64.props" />
<Import Project="props\build_common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="props\build_x64.props" />
<Import Project="props\build_common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="props\build_x64.props" />
<Import Project="props\build_common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="props\build_x86.props" />
<Import Project="props\build_common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="props\build_x86.props" />
<Import Project="props\build_common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)Build\$(ProjectName)\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\Build\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)Build\$(ProjectName)\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\Build\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)Build\$(ProjectName)\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\Build\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)Build\$(ProjectName)\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\Build\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)Build\$(ProjectName)\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\Build\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)Build\$(ProjectName)\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\Build\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<LanguageStandard>stdcpp14</LanguageStandard>
<DebugInformationFormat>None</DebugInformationFormat>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<ExceptionHandling>SyncCThrow</ExceptionHandling>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<LanguageStandard>stdcpp14</LanguageStandard>
<ExceptionHandling>SyncCThrow</ExceptionHandling>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<SupportJustMyCode>true</SupportJustMyCode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<LanguageStandard>stdcpp14</LanguageStandard>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<ExceptionHandling>SyncCThrow</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<SupportJustMyCode>false</SupportJustMyCode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<OmitFramePointers>false</OmitFramePointers>
<LanguageStandard>stdcpp14</LanguageStandard>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<ExceptionHandling>SyncCThrow</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<SupportJustMyCode>false</SupportJustMyCode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<OmitFramePointers>false</OmitFramePointers>
<FunctionLevelLinking>true</FunctionLevelLinking>
<LanguageStandard>stdcpp14</LanguageStandard>
<ExceptionHandling>SyncCThrow</ExceptionHandling>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<BufferSecurityCheck>false</BufferSecurityCheck>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<LanguageStandard_C>Default</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<LanguageStandard>stdcpp14</LanguageStandard>
<DebugInformationFormat>None</DebugInformationFormat>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<ExceptionHandling>SyncCThrow</ExceptionHandling>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{3630b8d0-dfc2-478a-beaf-b9854ede95f6}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{f960f5f1-5823-4a0b-b6a2-e9047bdba5c8}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\source\imgui\include\imconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\source\imgui\include\imgui.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\source\imgui\include\imgui_internal.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\source\imgui\include\imstb_rectpack.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\source\imgui\include\imstb_textedit.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\source\imgui\include\imstb_truetype.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\source\imgui\include\imgui_impl_sdl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\source\imgui\include\imgui_impl_opengl3.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\source\imgui\include\imgui_impl_opengl3_loader.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\source\imgui\src\imgui.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\source\imgui\src\imgui_demo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\source\imgui\src\imgui_draw.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\source\imgui\src\imgui_tables.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\source\imgui\src\imgui_widgets.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\source\imgui\src\imgui_impl_sdl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\source\imgui\src\imgui_impl_opengl3.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -336,6 +336,9 @@
<ProjectReference Include="mimalloc.vcxproj">
<Project>{1150264b-19c6-4c32-a204-cb79e96d5492}</Project>
</ProjectReference>
<ProjectReference Include="imgui.vcxproj">
<Project>{C782E1F1-AACE-4C00-AFAF-3448DAC597C5}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\source\duke3d\rsrc\buildres.rc">
......@@ -359,4 +362,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
</Project>
......@@ -6,7 +6,7 @@
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;RENDERTYPESDL=1;MIXERTYPESDL=1;SDL_USEFOLDER;SDL_TARGET=2;USE_OPENGL=1;POLYMER=1;STARTUP_WINDOW;USE_LIBVPX;HAVE_VORBIS;HAVE_XMP;MI_USE_RTLGENRANDOM;MI_SHOW_ERRORS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(VC_CRT_SourcePath);./include;./include/vpx/;./include/sdl2/;../../source/build/include;../../source/mact/include;../../source/audiolib/include;../../source/glad/include;../../source/libxmp-lite/include;../../source/libxmp-lite/include/libxmp-lite;../../source/voidwrap/include;../../source/mimalloc/include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(VC_CRT_SourcePath);./include;./include/vpx/;./include/sdl2/;../../source/build/include;../../source/mact/include;../../source/audiolib/include;../../source/glad/include;../../source/libxmp-lite/include;../../source/libxmp-lite/include/libxmp-lite;../../source/voidwrap/include;../../source/mimalloc/include;../../source/imgui/include;</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4996;4244;4018;4267</DisableSpecificWarnings>
<AdditionalOptions>/J %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
......
......@@ -68,6 +68,13 @@ extern int32_t r_maxfps;
extern int32_t g_numdisplays;
extern int32_t g_displayindex;
extern bool g_ImGuiCaptureInput;
extern bool g_ImGuiFrameActive;
extern uint8_t g_ImGuiCapturedDevices;
extern void engineBeginImGuiFrame(void);
extern void engineEndImGuiInput(void);
extern void engineBeginImGuiInput(void);
void calc_ylookup(int32_t bpl, int32_t lastyidx);
int32_t videoCheckMode(int32_t *x, int32_t *y, int32_t c, int32_t fs, int32_t forced);
......
......@@ -15,10 +15,15 @@
#include "sdl_inc.h"
#include "softsurface.h"
# include "imgui.h"
# include "imgui_impl_sdl.h"
#ifdef USE_OPENGL
# include "glad/glad.h"
# include "glbuild.h"
# include "glsurface.h"
# include "imgui_impl_opengl3.h"
#endif
#if defined HAVE_GTK2
......@@ -117,6 +122,10 @@ static SDL_Surface *loadappicon(void);
static mutex_t m_initprintf;
static ImGuiIO *g_ImGui_IO;
bool g_ImGuiCaptureInput = true;
uint8_t g_ImGuiCapturedDevices;
#ifdef _WIN32
# if SDL_MAJOR_VERSION >= 2
//
......@@ -1280,13 +1289,24 @@ void mouseGrabInput(bool grab)
void mouseLockToWindow(char a)
{
if (!g_ImGui_IO || !g_ImGui_IO->WantCaptureMouse)
if (!(a & 2))
{
mouseGrabInput(a);
g_mouseLockedToWindow = g_mouseGrabbed;
}
SDL_ShowCursor((osd && osd->flags & OSD_CAPTURE) ? SDL_ENABLE : SDL_DISABLE);
int newstate = (osd && ((osd->flags & OSD_CAPTURE) || (g_ImGuiCapturedDevices & DEV_MOUSE))) ? SDL_ENABLE : SDL_DISABLE;
SDL_ShowCursor(newstate);
if (g_ImGui_IO)
{
if (newstate)
g_ImGui_IO->ConfigFlags &= ~ImGuiConfigFlags_NoMouseCursorChange;
else
g_ImGui_IO->ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange;
}
}
......@@ -1462,6 +1482,12 @@ static void destroy_window_resources()
#endif
#if SDL_MAJOR_VERSION >= 2
#ifdef USE_OPENGL
ImGui_ImplOpenGL3_Shutdown();
#endif
ImGui_ImplSDL2_Shutdown();
ImGui::DestroyContext();
if (sdl_context)
SDL_GL_DeleteContext(sdl_context);
sdl_context = NULL;
......@@ -1471,6 +1497,58 @@ static void destroy_window_resources()
#endif
}
bool g_ImGuiFrameActive;
void engineBeginImGuiFrame(void)
{
Bassert(g_ImGuiFrameActive == false);
#ifdef USE_OPENGL