Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
24Ling committed Oct 7, 2024
1 parent 7864c1b commit 6e7c888
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 18 deletions.
8 changes: 4 additions & 4 deletions OpenGL/OpenGL.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)\$(Configuration)\Bin-int</IntDir>
<OutDir>$(SolutionDir)\$(Platform)\$(ProjectName)\</OutDir>
<IntDir>$(SolutionDir)\$(Platform)\$(ProjectName)\Bin-Int\</IntDir>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)\$(Configuration)\</OutDir>
<IntDir>$(ShortProjectName)\$(Configuration)\Bin-int</IntDir>
<OutDir>$(SolutionDir)\$(Platform)\$(ProjectName)\</OutDir>
<IntDir>$(SolutionDir)\$(Platform)\$(ProjectName)\Bin-Int\</IntDir>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand Down
8 changes: 8 additions & 0 deletions TestOpenGL/TestOpenGL.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)\$(Platform)\$(ProjectName)\</OutDir>
<IntDir>$(SolutionDir)\$(Platform)\$(ProjectName)\Bin-Int\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)\$(Platform)\$(ProjectName)\</OutDir>
<IntDir>$(SolutionDir)\$(Platform)\$(ProjectName)\Bin-Int\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
Expand Down
6 changes: 3 additions & 3 deletions TestOpenGL/imgui.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Size=400,400
Collapsed=0

[Window][Test]
Pos=585,315
Pos=566,151
Size=705,219
Collapsed=0

[Window][Scene]
Pos=1140,218
Size=574,213
Pos=1306,207
Size=574,215
Collapsed=0

[Docking][Data]
Expand Down
10 changes: 6 additions & 4 deletions WeaponEdit/WeaponEdit.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(ProjectDIR)</OutDir>
<IntDir>$(ProjectDIR)$(Configuration)Bin-Int</IntDir>
<OutDir>$(SolutionDir)$(Platform)\$(ProjectName)\</OutDir>
<IntDir>$(SolutionDir)$(Platform)\$(ProjectName)\Bin-Int\</IntDir>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(ProjectDIR)</OutDir>
<IntDir>$(ProjectDIR)$(Configuration)Bin-Int</IntDir>
<OutDir>$(SolutionDir)$(Platform)\$(ProjectName)\</OutDir>
<IntDir>$(SolutionDir)$(Platform)\$(ProjectName)\Bin-Int\</IntDir>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand Down Expand Up @@ -146,10 +146,12 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\Application.cpp" />
<ClCompile Include="src\Test.cpp" />
<ClCompile Include="src\WeaponEdit.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
<ClInclude Include="src\Test.h" />
<ClInclude Include="src\WeaponEdit.h" />
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions WeaponEdit/WeaponEdit.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<ClCompile Include="src\Application.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="src\Test.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\WeaponEdit.h">
Expand All @@ -29,6 +32,9 @@
<ClInclude Include="resource.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\Test.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="WeaponEdit.rc">
Expand Down
4 changes: 2 additions & 2 deletions WeaponEdit/WeaponEdit.vcxproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<ShowAllFiles>true</ShowAllFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerCommand>$(ProjectDIR)$(ProjectName).exe</LocalDebuggerCommand>
<LocalDebuggerCommand>$(SolutionDir)$(Platform)\$(ProjectName)\$(ProjectName)</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerCommand>$(ProjectDIR)$(ProjectName).exe</LocalDebuggerCommand>
<LocalDebuggerCommand>$(SolutionDir)$(Platform)\$(ProjectName)\$(ProjectName)</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
8 changes: 4 additions & 4 deletions WeaponEdit/imgui.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Window][WindowOverViewport_11111111]
Pos=0,30
Size=1920,1025
Size=1920,1050
Collapsed=0

[Window][Debug##Default]
Expand All @@ -10,7 +10,7 @@ Collapsed=0

[Window][Weapons]
Pos=0,30
Size=1920,1025
Size=1920,1050
Collapsed=0
DockId=0x00000002,0

Expand All @@ -22,7 +22,7 @@ Collapsed=1

[Window][WeaponEdit]
Pos=1565,30
Size=355,961
Size=355,1050
Collapsed=0
DockId=0x00000003,0

Expand All @@ -43,7 +43,7 @@ Size=737,248
Collapsed=0

[Docking][Data]
DockSpace ID=0x7C6B3D9B Window=0xA87D555D Pos=9,68 Size=1920,1025 Split=X Selected=0xFFCDC058
DockSpace ID=0x7C6B3D9B Window=0xA87D555D Pos=243,214 Size=1920,1050 Split=X Selected=0xFFCDC058
DockNode ID=0x00000002 Parent=0x7C6B3D9B SizeRef=1563,1080 CentralNode=1 HiddenTabBar=1 Selected=0xB374A275
DockNode ID=0x00000003 Parent=0x7C6B3D9B SizeRef=355,1080 Selected=0xEC96622E

23 changes: 23 additions & 0 deletions WeaponEdit/src/Test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "Test.h"
#include "imgui/imgui.h"

TestMenu::TestMenu(Test*& currentTestPointer)
: m_CurrentTest(currentTestPointer)
{

}

TestMenu::~TestMenu()
{

}

void TestMenu::OnImguiRender()
{
for (auto& tests : m_Tests)
{
if (ImGui::Button(tests.first.c_str()))
m_CurrentTest = tests.second();
}
}

40 changes: 40 additions & 0 deletions WeaponEdit/src/Test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#pragma once
#include <vector>
#include <functional>
#include <string>
#include <iostream>

class Test
{
public:
Test() {}
virtual ~Test() {};


virtual void OnUpdate() {}
virtual void OnImguiRender() {}
virtual void OnRender() {}

};

class TestMenu : public Test
{
public:

TestMenu(Test*& currentTestPointer);
~TestMenu();

void OnImguiRender() override;

template<typename T>
void RegisterTest(const std::string& name)
{
std::cout << "Register: " << name << std::endl;

m_Tests.push_back(std::make_pair(name, []() { return new T(); }));
}

private:
Test*& m_CurrentTest;
std::vector <std::pair<std::string, std::function<Test* ()>>> m_Tests;
};
2 changes: 1 addition & 1 deletion WeaponEdit/src/WeaponEdit.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#pragma once
#include "Test/Test.h"
#include "Test.h"
#include "imgui/imgui.h"
#include "OpenGL/Texture.h"

Expand Down

0 comments on commit 6e7c888

Please sign in to comment.