Initial commit.
This commit is contained in:
32
samples/Sample_Template/Main.cpp
Normal file
32
samples/Sample_Template/Main.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "Task.h"
|
||||
#include "TaskManager.h"
|
||||
#include "TimeSystem.h"
|
||||
|
||||
// User-defined GetGlobalTime() is required to link Task.h
|
||||
NAMESPACE_SQUID_BEGIN
|
||||
tTaskTime GetGlobalTime()
|
||||
{
|
||||
return (tTaskTime)TimeSystem::GetTime();
|
||||
}
|
||||
NAMESPACE_SQUID_END
|
||||
|
||||
// Simple main function
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
TimeSystem::Create();
|
||||
|
||||
// Initialize the game
|
||||
// ... <your code here> ...
|
||||
|
||||
// Run the game until it's ready to quit
|
||||
while(true)
|
||||
{
|
||||
// Update time before each frame (logically, all tasks should resume "at the same time")
|
||||
TimeSystem::UpdateTime();
|
||||
|
||||
// Update the game
|
||||
// ... <your code here> ...
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
172
samples/Sample_Template/Sample_Template.vcxproj
Normal file
172
samples/Sample_Template/Sample_Template.vcxproj
Normal file
@@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</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>
|
||||
<ClCompile Include="Main.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\FunctionGuard.h" />
|
||||
<ClInclude Include="..\..\include\Private\TasksCommonPrivate.h" />
|
||||
<ClInclude Include="..\..\include\Private\TaskFSMPrivate.h" />
|
||||
<ClInclude Include="..\..\include\Private\TaskPrivate.h" />
|
||||
<ClInclude Include="..\..\include\Task.h" />
|
||||
<ClInclude Include="..\..\include\TaskFSM.h" />
|
||||
<ClInclude Include="..\..\include\TaskManager.h" />
|
||||
<ClInclude Include="..\..\include\TasksConfig.h" />
|
||||
<ClInclude Include="..\..\include\TokenList.h" />
|
||||
<ClInclude Include="..\Common\TimeSystem.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{E48F8265-C836-4564-9525-AFB12295CF64}</ProjectGuid>
|
||||
<RootNamespace>Sample_Template</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>Sample_Template</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<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)'=='Release|Win32'">
|
||||
<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="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<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|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);SQUIDTASK_TIME_PRECISION_DOUBLE</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>Default</LanguageStandard>
|
||||
<AdditionalOptions>/await -Xclang -fcoroutines-ts %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>../../include;../Common</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);SQUIDTASK_TIME_PRECISION_DOUBLE</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>Default</LanguageStandard>
|
||||
<AdditionalOptions>/await -Xclang -fcoroutines-ts %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>../../include;../Common</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions);SQUIDTASK_TIME_PRECISION_DOUBLE</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>Default</LanguageStandard>
|
||||
<AdditionalOptions>/await -Xclang -fcoroutines-ts %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>../../include;../Common</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions);SQUIDTASK_TIME_PRECISION_DOUBLE</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>Default</LanguageStandard>
|
||||
<AdditionalOptions>/await -Xclang -fcoroutines-ts %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>../../include;../Common</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
63
samples/Sample_Template/Sample_Template.vcxproj.filters
Normal file
63
samples/Sample_Template/Sample_Template.vcxproj.filters
Normal file
@@ -0,0 +1,63 @@
|
||||
<?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>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\SquidTasks">
|
||||
<UniqueIdentifier>{63b632a7-ce3c-4dd9-a970-5e661d591932}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\SquidTasks\Private">
|
||||
<UniqueIdentifier>{89a92d2a-3fa9-4c0d-8dbf-466c03830dc3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Common">
|
||||
<UniqueIdentifier>{cf5b02a9-ec31-44ea-9840-80634ce22458}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\FunctionGuard.h">
|
||||
<Filter>Source Files\SquidTasks</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\Task.h">
|
||||
<Filter>Source Files\SquidTasks</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\TaskManager.h">
|
||||
<Filter>Source Files\SquidTasks</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\TasksConfig.h">
|
||||
<Filter>Source Files\SquidTasks</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\TokenList.h">
|
||||
<Filter>Source Files\SquidTasks</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\TaskFSM.h">
|
||||
<Filter>Source Files\SquidTasks</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\Private\TaskFSMPrivate.h">
|
||||
<Filter>Source Files\SquidTasks\Private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\Private\TaskPrivate.h">
|
||||
<Filter>Source Files\SquidTasks\Private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\Private\TasksCommonPrivate.h">
|
||||
<Filter>Source Files\SquidTasks\Private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Common\TimeSystem.h">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user