Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e68105fe1 | |||
| af01f223c1 | |||
| 118e967412 | |||
| 452e84aa16 | |||
| 151ea9b191 | |||
| 0d5e26266b | |||
| 425224a96c | |||
| d8851cc679 | |||
| c355509870 | |||
| 51b29f77aa | |||
| d8552d3f91 | |||
| 261df5e257 | |||
| 172db0b96d | |||
| 296e04692a | |||
| fec593205b | |||
| 161166837f | |||
| a88ed06198 | |||
| cb3f10b7d5 | |||
| 4ae55e73b2 | |||
| 15217a5df8 | |||
| 06efdf6f6c | |||
| b029018552 | |||
| 39fa32603f | |||
| c707e49561 | |||
| 58cafd7682 | |||
| c5de18a9b3 | |||
| f337e58dcc | |||
|
|
af98e5edc7 | ||
| 01a9c940f0 | |||
| ab0355ed97 | |||
| 915c0cdd7f | |||
| bce659e55d | |||
| 79f266b479 | |||
| b4804c2df2 | |||
| 7d2b962420 | |||
| d7965fec64 | |||
| 7f84ab39a1 | |||
| 975edf0e62 | |||
| b3af9f4ce7 | |||
| 8f20397130 | |||
| 3aafec5bf8 | |||
| 79558eed4f |
1
.idea/.idea.KhaoticEngineReborn/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
KhaoticEngineReborn
|
||||
14
.idea/.idea.KhaoticEngineReborn/.idea/discord.xml
generated
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DiscordProjectSettings">
|
||||
<option name="show" value="PROJECT_FILES" />
|
||||
<option name="description" value="" />
|
||||
<option name="applicationTheme" value="default" />
|
||||
<option name="iconsTheme" value="default" />
|
||||
<option name="button1Title" value="" />
|
||||
<option name="button1Url" value="" />
|
||||
<option name="button2Title" value="" />
|
||||
<option name="button2Url" value="" />
|
||||
<option name="customApplicationId" value="" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/.idea.KhaoticEngineReborn/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" charset="windows-1252" />
|
||||
<file url="file://$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" charset="windows-1252" />
|
||||
<file url="PROJECT" charset="windows-1252" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/.idea.KhaoticEngineReborn/.idea/git_toolbox_blame.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxBlameSettings">
|
||||
<option name="version" value="2" />
|
||||
</component>
|
||||
</project>
|
||||
15
.idea/.idea.KhaoticEngineReborn/.idea/git_toolbox_prj.xml
generated
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxProjectSettings">
|
||||
<option name="commitMessageIssueKeyValidationOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
<option name="commitMessageValidationEnabledOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/.idea.KhaoticEngineReborn/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
12
.idea/.idea.KhaoticEngineReborn/.idea/material_theme_project_new.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MaterialThemeProjectNewConfig">
|
||||
<option name="metadata">
|
||||
<MTProjectMetadataState>
|
||||
<option name="migrated" value="true" />
|
||||
<option name="pristineConfig" value="false" />
|
||||
<option name="userId" value="4025287c:194ad69ad19:-7ff7" />
|
||||
</MTProjectMetadataState>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
7
.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RiderProjectSettingsUpdater">
|
||||
<option name="singleClickDiffPreview" value="1" />
|
||||
<option name="vcsConfiguration" value="3" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/.idea.KhaoticEngineReborn/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
206
.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/imgui.ini" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/imgui.ini" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/shader-error.txt" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/shader-error.txt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/hlsl/font.ps" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/hlsl/font.ps" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/hlsl/font.vs" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/hlsl/font.vs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/applicationclass.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/applicationclass.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/imguiManager.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/imguiManager.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/shader/fontshaderclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/shader/fontshaderclass.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/Systemclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/Systemclass.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="DpaMonitoringSettings">
|
||||
<option name="firstShow" value="false" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="HighlightingSettingsPerFile">
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="cidr-memory-view://5" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um/d3d11.h" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/src/src/shader/CelShadingShader.cpp" root0="FORCE_HIGHLIGHTING" />
|
||||
</component>
|
||||
<component name="MetaFilesCheckinStateConfiguration" checkMetaFiles="true" />
|
||||
<component name="ProblemsViewState">
|
||||
<option name="selectedTabId" value="CurrentFile" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 6
|
||||
}</component>
|
||||
<component name="ProjectId" id="2sGIWDeT5ixyzDQ0he4A3RFpG9W" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"C++ Project.enginecustom.executor": "Run",
|
||||
"C/C++ Project.enginecustom.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"ignore.virus.scanning.warn.message": "true",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "preferences.keymap",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="RunManager" selected="C/C++ Project.enginecustom">
|
||||
<configuration name="KhaoticDemo" type="CppProject" factoryName="C++ Project">
|
||||
<configuration_1 setup="1">
|
||||
<option name="CONFIGURATION" value="Debug" />
|
||||
<option name="PLATFORM" value="x64" />
|
||||
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
||||
<option name="EXE_PATH" value="$(LocalDebuggerCommand)" />
|
||||
<option name="PROGRAM_PARAMETERS" value="$(LocalDebuggerCommandArguments)" />
|
||||
<option name="WORKING_DIRECTORY" value="$(LocalDebuggerWorkingDirectory)" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
||||
</configuration_1>
|
||||
<option name="DEFAULT_PROJECT_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
||||
<option name="AUTO_SELECT_PRIORITY" value="0" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="enginecustom" type="CppProject" factoryName="C++ Project">
|
||||
<configuration_1 setup="1">
|
||||
<option name="CONFIGURATION" value="Debug" />
|
||||
<option name="PLATFORM" value="x64" />
|
||||
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
||||
<option name="EXE_PATH" value="$(LocalDebuggerCommand)" />
|
||||
<option name="PROGRAM_PARAMETERS" value="$(LocalDebuggerCommandArguments)" />
|
||||
<option name="WORKING_DIRECTORY" value="$(LocalDebuggerWorkingDirectory)" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||
</configuration_1>
|
||||
<option name="DEFAULT_PROJECT_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||
<option name="AUTO_SELECT_PRIORITY" value="0" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="" />
|
||||
<created>1738075515913</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1738075515913</updated>
|
||||
<workItem from="1738075517746" duration="553000" />
|
||||
<workItem from="1738076088229" duration="80000" />
|
||||
<workItem from="1738076192788" duration="19000" />
|
||||
<workItem from="1738076222547" duration="6131000" />
|
||||
<workItem from="1738171504772" duration="876000" />
|
||||
<workItem from="1738172392786" duration="67000" />
|
||||
<workItem from="1738173151768" duration="2361000" />
|
||||
<workItem from="1738175535254" duration="279000" />
|
||||
<workItem from="1738178991872" duration="2736000" />
|
||||
<workItem from="1738244577624" duration="3000" />
|
||||
<workItem from="1738321399968" duration="689000" />
|
||||
<workItem from="1738358054789" duration="9000" />
|
||||
<workItem from="1738358091089" duration="6675000" />
|
||||
<workItem from="1738364887298" duration="2275000" />
|
||||
<workItem from="1738515031789" duration="14018000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Minor update - viewport window tweak">
|
||||
<option name="closed" value="true" />
|
||||
<created>1738175474520</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1738175474520</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00002" summary="Patch update - add menu button">
|
||||
<option name="closed" value="true" />
|
||||
<created>1738181617050</created>
|
||||
<option name="number" value="00002" />
|
||||
<option name="presentableId" value="LOCAL-00002" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1738181617050</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="3" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="UnityCheckinConfiguration" checkUnsavedScenes="true" />
|
||||
<component name="UnityProjectConfiguration" hasMinimizedUI="false" />
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
|
||||
<MESSAGE value="Minor update - viewport window tweak" />
|
||||
<MESSAGE value="Patch update - add menu button" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Patch update - add menu button" />
|
||||
</component>
|
||||
</project>
|
||||
24
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "C/C++ Runner: Debug Session",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"externalConsole": true,
|
||||
"cwd": "c:/Users/arivas/Documents/GitHub/khaotic-engine-Reborn/enginecustom",
|
||||
"program": "c:/Users/arivas/Documents/GitHub/khaotic-engine-Reborn/enginecustom/build/Debug/outDebug",
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "gdb",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
59
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"C_Cpp_Runner.cCompilerPath": "gcc",
|
||||
"C_Cpp_Runner.cppCompilerPath": "g++",
|
||||
"C_Cpp_Runner.debuggerPath": "gdb",
|
||||
"C_Cpp_Runner.cStandard": "",
|
||||
"C_Cpp_Runner.cppStandard": "",
|
||||
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
|
||||
"C_Cpp_Runner.useMsvc": false,
|
||||
"C_Cpp_Runner.warnings": [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-Wpedantic",
|
||||
"-Wshadow",
|
||||
"-Wformat=2",
|
||||
"-Wcast-align",
|
||||
"-Wconversion",
|
||||
"-Wsign-conversion",
|
||||
"-Wnull-dereference"
|
||||
],
|
||||
"C_Cpp_Runner.msvcWarnings": [
|
||||
"/W4",
|
||||
"/permissive-",
|
||||
"/w14242",
|
||||
"/w14287",
|
||||
"/w14296",
|
||||
"/w14311",
|
||||
"/w14826",
|
||||
"/w44062",
|
||||
"/w44242",
|
||||
"/w14905",
|
||||
"/w14906",
|
||||
"/w14263",
|
||||
"/w44265",
|
||||
"/w14928"
|
||||
],
|
||||
"C_Cpp_Runner.enableWarnings": true,
|
||||
"C_Cpp_Runner.warningsAsError": false,
|
||||
"C_Cpp_Runner.compilerArgs": [],
|
||||
"C_Cpp_Runner.linkerArgs": [],
|
||||
"C_Cpp_Runner.includePaths": [],
|
||||
"C_Cpp_Runner.includeSearch": [
|
||||
"*",
|
||||
"**/*"
|
||||
],
|
||||
"C_Cpp_Runner.excludeSearch": [
|
||||
"**/build",
|
||||
"**/build/**",
|
||||
"**/.*",
|
||||
"**/.*/**",
|
||||
"**/.vscode",
|
||||
"**/.vscode/**"
|
||||
],
|
||||
"C_Cpp_Runner.useAddressSanitizer": false,
|
||||
"C_Cpp_Runner.useUndefinedSanitizer": false,
|
||||
"C_Cpp_Runner.useLeakSanitizer": false,
|
||||
"C_Cpp_Runner.showCompilationTime": false,
|
||||
"C_Cpp_Runner.useLinkTimeOptimization": false,
|
||||
"C_Cpp_Runner.msvcSecureNoWarnings": false
|
||||
}
|
||||
17
README.md
@@ -35,11 +35,24 @@ This **DirectX11** based engine uses **ImGui** with an abstraction layer to enab
|
||||
|
||||
**SHADER** :
|
||||
|
||||
- Cel Shading
|
||||
+ Sunlight shader
|
||||
+ Cel Shading (Work In Progress)
|
||||
|
||||
**Interface Graphique** :
|
||||
|
||||
- Shader Manager
|
||||
+ Console link to the Logger object
|
||||
+ Shader Manager
|
||||
+ Engine Settings
|
||||
|
||||
**Texture File** :
|
||||
|
||||
+ All the format supported by Windows Imaging Component (WIC)
|
||||
|
||||
**Optimization** :
|
||||
|
||||
- Shader rendering
|
||||
- Frustum culling
|
||||
- Object rendering
|
||||
|
||||
## Demo :
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
#ifndef _CELSHADINGSHADER_H_
|
||||
#define _CELSHADINGSHADER_H_
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: CelShadingShader
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class CelShadingShader
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct LightBufferType
|
||||
{
|
||||
XMFLOAT4 diffuseColor;
|
||||
XMFLOAT3 lightDirection;
|
||||
float padding; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
XMFLOAT3 lightPosition; // Add light position
|
||||
float padding2; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
float constantAttenuation;
|
||||
float linearAttenuation;
|
||||
float quadraticAttenuation;
|
||||
float padding3; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
CelShadingShader();
|
||||
CelShadingShader(const CelShadingShader&);
|
||||
~CelShadingShader();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4, XMFLOAT3);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4, XMFLOAT3);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_lightBuffer;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,84 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: light.ps
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////
|
||||
// DEFINES //
|
||||
/////////////
|
||||
#define NUM_LIGHTS 4
|
||||
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
Texture2D shaderTexture : register(t0);
|
||||
SamplerState SampleType : register(s0);
|
||||
cbuffer LightBuffer
|
||||
{
|
||||
float4 ambientColor;
|
||||
float3 lightDirection;
|
||||
float padding;
|
||||
float specularPower;
|
||||
float4 specularColor;
|
||||
};
|
||||
|
||||
cbuffer LightColorBuffer
|
||||
{
|
||||
float4 diffuseColor[NUM_LIGHTS];
|
||||
};
|
||||
|
||||
|
||||
//////////////
|
||||
// TYPEDEFS //
|
||||
//////////////
|
||||
struct PixelInputType
|
||||
{
|
||||
float4 position : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float3 normal : NORMAL;
|
||||
float3 lightPos[NUM_LIGHTS] : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Pixel Shader
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
float4 LightPixelShader(PixelInputType input) : SV_TARGET
|
||||
{
|
||||
float4 textureColor;
|
||||
float3 lightDir;
|
||||
float4 color;
|
||||
float3 reflection;
|
||||
float4 specular;
|
||||
float lightIntensity[NUM_LIGHTS];
|
||||
float4 colorArray[NUM_LIGHTS];
|
||||
float4 colorSum;
|
||||
int i;
|
||||
|
||||
// Sample the pixel color from the texture using the sampler at this texture coordinate location.
|
||||
textureColor = shaderTexture.Sample(SampleType, input.tex);
|
||||
|
||||
for(i=0; i<NUM_LIGHTS; i++)
|
||||
{
|
||||
// Calculate the different amounts of light on this pixel based on the positions of the lights.
|
||||
lightIntensity[i] = saturate(dot(input.normal, input.lightPos[i]));
|
||||
|
||||
// Determine the diffuse color amount of each of the four lights.
|
||||
colorArray[i] = diffuseColor[i] * lightIntensity[i];
|
||||
}
|
||||
|
||||
// Initialize the sum of colors.
|
||||
colorSum = float4(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
// Add all of the light colors up.
|
||||
for(i=0; i<NUM_LIGHTS; i++)
|
||||
{
|
||||
colorSum.r += colorArray[i].r;
|
||||
colorSum.g += colorArray[i].g;
|
||||
colorSum.b += colorArray[i].b;
|
||||
}
|
||||
|
||||
// Multiply the texture pixel by the combination of all four light colors to get the final result.
|
||||
color = saturate(colorSum) * textureColor;
|
||||
|
||||
return color;
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: lightclass.cpp
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include "lightclass.h"
|
||||
|
||||
|
||||
LightClass::LightClass()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LightClass::LightClass(const LightClass& other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LightClass::~LightClass()
|
||||
{
|
||||
}
|
||||
|
||||
void LightClass::SetAmbientColor(float red, float green, float blue, float alpha)
|
||||
{
|
||||
m_ambientColor = XMFLOAT4(red, green, blue, alpha);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LightClass::SetDiffuseColor(float red, float green, float blue, float alpha)
|
||||
{
|
||||
m_diffuseColor = XMFLOAT4(red, green, blue, alpha);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void LightClass::SetDirection(float x, float y, float z)
|
||||
{
|
||||
m_direction = XMFLOAT3(x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
void LightClass::SetSpecularColor(float red, float green, float blue, float alpha)
|
||||
{
|
||||
m_specularColor = XMFLOAT4(red, green, blue, alpha);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void LightClass::SetSpecularPower(float power)
|
||||
{
|
||||
m_specularPower = power;
|
||||
return;
|
||||
}
|
||||
|
||||
void LightClass::SetPosition(float x, float y, float z)
|
||||
{
|
||||
m_position = XMFLOAT4(x, y, z, 1.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
XMFLOAT4 LightClass::GetAmbientColor()
|
||||
{
|
||||
return m_ambientColor;
|
||||
}
|
||||
|
||||
|
||||
XMFLOAT4 LightClass::GetDiffuseColor()
|
||||
{
|
||||
return m_diffuseColor;
|
||||
}
|
||||
|
||||
XMFLOAT3 LightClass::GetDirection()
|
||||
{
|
||||
return m_direction;
|
||||
}
|
||||
|
||||
XMFLOAT4 LightClass::GetSpecularColor()
|
||||
{
|
||||
return m_specularColor;
|
||||
}
|
||||
|
||||
|
||||
float LightClass::GetSpecularPower()
|
||||
{
|
||||
return m_specularPower;
|
||||
}
|
||||
|
||||
XMFLOAT4 LightClass::GetPosition()
|
||||
{
|
||||
return m_position;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
#pragma once
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: lightclass.h
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _LIGHTCLASS_H_
|
||||
#define _LIGHTCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include <directxmath.h>
|
||||
using namespace DirectX;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: LightClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class LightClass
|
||||
{
|
||||
public:
|
||||
LightClass();
|
||||
LightClass(const LightClass&);
|
||||
~LightClass();
|
||||
|
||||
void SetAmbientColor(float, float, float, float);
|
||||
void SetDiffuseColor(float, float, float, float);
|
||||
void SetDirection(float, float, float);
|
||||
void SetSpecularColor(float, float, float, float);
|
||||
void SetSpecularPower(float);
|
||||
void SetPosition(float, float, float);
|
||||
|
||||
XMFLOAT4 GetAmbientColor();
|
||||
XMFLOAT4 GetDiffuseColor();
|
||||
XMFLOAT3 GetDirection();
|
||||
XMFLOAT4 GetSpecularColor();
|
||||
float GetSpecularPower();
|
||||
XMFLOAT4 GetPosition();
|
||||
|
||||
private:
|
||||
XMFLOAT4 m_ambientColor;
|
||||
XMFLOAT4 m_diffuseColor;
|
||||
XMFLOAT3 m_direction;
|
||||
XMFLOAT4 m_specularColor;
|
||||
float m_specularPower;
|
||||
XMFLOAT4 m_position;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,92 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: lightshaderclass.h
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _LIGHTSHADERCLASS_H_
|
||||
#define _LIGHTSHADERCLASS_H_
|
||||
|
||||
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
const int NUM_LIGHTS = 4;
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: LightShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class LightShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct CameraBufferType
|
||||
{
|
||||
XMFLOAT3 cameraPosition;
|
||||
float padding;
|
||||
};
|
||||
|
||||
struct LightBufferType
|
||||
{
|
||||
XMFLOAT4 ambientColor;
|
||||
XMFLOAT4 diffuseColor;
|
||||
XMFLOAT3 lightDirection;
|
||||
float padding; // Added extra padding so structure is a multiple of 16 for CreateBuffer function requirements.
|
||||
float specularPower;
|
||||
XMFLOAT4 specularColor;
|
||||
};
|
||||
|
||||
struct LightColorBufferType
|
||||
{
|
||||
XMFLOAT4 diffuseColor[NUM_LIGHTS];
|
||||
};
|
||||
|
||||
struct LightPositionBufferType
|
||||
{
|
||||
XMFLOAT4 lightPosition[NUM_LIGHTS];
|
||||
};
|
||||
|
||||
public:
|
||||
LightShaderClass();
|
||||
LightShaderClass(const LightShaderClass&);
|
||||
~LightShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[]);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[]);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11Buffer* m_cameraBuffer;
|
||||
ID3D11Buffer* m_lightBuffer;
|
||||
ID3D11Buffer* m_lightColorBuffer;
|
||||
ID3D11Buffer* m_lightPositionBuffer;
|
||||
};
|
||||
|
||||
#endif
|
||||
16
enginecustom/assets/Model/OBJ/plane.obj
Normal file
@@ -0,0 +1,16 @@
|
||||
# Simple 2D plane in OBJ format
|
||||
|
||||
v -0.5 0.0 -0.5
|
||||
v 0.5 0.0 -0.5
|
||||
v -0.5 0.0 0.5
|
||||
v 0.5 0.0 0.5
|
||||
|
||||
vt 0.0 0.0
|
||||
vt 1.0 0.0
|
||||
vt 0.0 1.0
|
||||
vt 1.0 1.0
|
||||
|
||||
vn 0.0 1.0 0.0
|
||||
|
||||
f 1/1/1 4/4/1 2/2/1
|
||||
f 1/1/1 3/3/1 4/4/1
|
||||
24
enginecustom/assets/Model/imgui.ini
Normal file
@@ -0,0 +1,24 @@
|
||||
[Window][Debug##Default]
|
||||
Pos=60,60
|
||||
Size=400,400
|
||||
|
||||
[Window][Khaotic Engine]
|
||||
Pos=1120,51
|
||||
Size=392,273
|
||||
|
||||
[Window][Objects]
|
||||
Pos=930,39
|
||||
Size=457,294
|
||||
|
||||
[Window][Terrain]
|
||||
Pos=60,60
|
||||
Size=342,82
|
||||
|
||||
[Window][Light]
|
||||
Pos=1551,17
|
||||
Size=358,535
|
||||
|
||||
[Window][Shader Manager]
|
||||
Pos=30,255
|
||||
Size=172,284
|
||||
|
||||
91
enginecustom/assets/Skybox/imgui.ini
Normal file
@@ -0,0 +1,91 @@
|
||||
[Window][Debug##Default]
|
||||
Pos=60,60
|
||||
Size=400,400
|
||||
Collapsed=0
|
||||
|
||||
[Window][Khaotic Engine]
|
||||
Pos=1180,27
|
||||
Size=396,826
|
||||
Collapsed=0
|
||||
DockId=0x00000005,0
|
||||
|
||||
[Window][Objects]
|
||||
Pos=8,442
|
||||
Size=290,411
|
||||
Collapsed=0
|
||||
DockId=0x0000000A,0
|
||||
|
||||
[Window][Terrain]
|
||||
Pos=8,27
|
||||
Size=290,413
|
||||
Collapsed=0
|
||||
DockId=0x00000009,0
|
||||
|
||||
[Window][Light]
|
||||
Pos=8,27
|
||||
Size=330,487
|
||||
Collapsed=0
|
||||
DockId=0x00000004,1
|
||||
|
||||
[Window][Shader Manager]
|
||||
Pos=8,27
|
||||
Size=330,487
|
||||
Collapsed=0
|
||||
DockId=0x00000004,2
|
||||
|
||||
[Window][Engine Settings]
|
||||
Pos=1180,27
|
||||
Size=396,826
|
||||
Collapsed=0
|
||||
DockId=0x00000005,1
|
||||
|
||||
[Window][DockSpace Demo]
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Render Window]
|
||||
Pos=300,27
|
||||
Size=878,826
|
||||
Collapsed=0
|
||||
DockId=0x00000002,0
|
||||
|
||||
[Window][DockSpace]
|
||||
Pos=0,0
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Add Object]
|
||||
Pos=1188,0
|
||||
Size=396,430
|
||||
Collapsed=0
|
||||
|
||||
[Window][Log]
|
||||
Pos=8,518
|
||||
Size=1568,335
|
||||
Collapsed=0
|
||||
DockId=0x0000000C,0
|
||||
|
||||
[Window][Log Window]
|
||||
Pos=8,627
|
||||
Size=1568,226
|
||||
Collapsed=0
|
||||
DockId=0x0000000E,0
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0xC0DFADC4 Pos=8,27 Size=1568,826 Split=X
|
||||
DockNode ID=0x00000001 Parent=0xC0DFADC4 SizeRef=330,1094 Split=Y Selected=0x393905AB
|
||||
DockNode ID=0x00000004 Parent=0x00000001 SizeRef=330,487 Selected=0x393905AB
|
||||
DockNode ID=0x00000006 Parent=0x00000001 SizeRef=330,485 Selected=0x031DC75C
|
||||
DockNode ID=0x00000003 Parent=0xC0DFADC4 SizeRef=1700,1094 CentralNode=1
|
||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=8,27 Size=1568,826 Split=Y
|
||||
DockNode ID=0x0000000D Parent=0xCCBD8CF7 SizeRef=1568,598 Split=Y
|
||||
DockNode ID=0x0000000B Parent=0x0000000D SizeRef=1568,637 Split=X
|
||||
DockNode ID=0x00000007 Parent=0x0000000B SizeRef=290,826 Split=Y Selected=0x393905AB
|
||||
DockNode ID=0x00000009 Parent=0x00000007 SizeRef=395,413 Selected=0x393905AB
|
||||
DockNode ID=0x0000000A Parent=0x00000007 SizeRef=395,411 Selected=0x031DC75C
|
||||
DockNode ID=0x00000008 Parent=0x0000000B SizeRef=1276,826 Split=X
|
||||
DockNode ID=0x00000002 Parent=0x00000008 SizeRef=878,826 CentralNode=1 Selected=0x9204953B
|
||||
DockNode ID=0x00000005 Parent=0x00000008 SizeRef=396,826 Selected=0x9F035453
|
||||
DockNode ID=0x0000000C Parent=0x0000000D SizeRef=1568,335 Selected=0x139FDA3F
|
||||
DockNode ID=0x0000000E Parent=0xCCBD8CF7 SizeRef=1568,226 Selected=0xAB74BEE9
|
||||
|
||||
BIN
enginecustom/assets/Skybox/skybox_back.png
Normal file
|
After Width: | Height: | Size: 331 KiB |
BIN
enginecustom/assets/Skybox/skybox_bottom.png
Normal file
|
After Width: | Height: | Size: 273 KiB |
BIN
enginecustom/assets/Skybox/skybox_front.png
Normal file
|
After Width: | Height: | Size: 493 KiB |
BIN
enginecustom/assets/Skybox/skybox_left.png
Normal file
|
After Width: | Height: | Size: 510 KiB |
BIN
enginecustom/assets/Skybox/skybox_right.png
Normal file
|
After Width: | Height: | Size: 498 KiB |
BIN
enginecustom/assets/Skybox/skybox_top.png
Normal file
|
After Width: | Height: | Size: 422 KiB |
BIN
enginecustom/assets/Texture/EmptyTexture.png
Normal file
|
After Width: | Height: | Size: 81 KiB |
89
enginecustom/assets/Texture/imgui.ini
Normal file
@@ -0,0 +1,89 @@
|
||||
[Window][Debug##Default]
|
||||
Pos=60,60
|
||||
Size=400,400
|
||||
Collapsed=0
|
||||
|
||||
[Window][Khaotic Engine]
|
||||
Pos=1180,27
|
||||
Size=396,826
|
||||
Collapsed=0
|
||||
DockId=0x00000005,0
|
||||
|
||||
[Window][Objects]
|
||||
Pos=8,27
|
||||
Size=290,826
|
||||
Collapsed=0
|
||||
DockId=0x0000000A,0
|
||||
|
||||
[Window][Terrain]
|
||||
Pos=8,27
|
||||
Size=290,487
|
||||
Collapsed=0
|
||||
DockId=0x00000009,0
|
||||
|
||||
[Window][Light]
|
||||
Pos=8,27
|
||||
Size=290,487
|
||||
Collapsed=0
|
||||
DockId=0x00000009,1
|
||||
|
||||
[Window][Shader Manager]
|
||||
Pos=8,27
|
||||
Size=330,487
|
||||
Collapsed=0
|
||||
DockId=0x00000001,2
|
||||
|
||||
[Window][Engine Settings]
|
||||
Pos=1516,27
|
||||
Size=396,974
|
||||
Collapsed=0
|
||||
DockId=0x00000005,1
|
||||
|
||||
[Window][DockSpace Demo]
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Render Window]
|
||||
Pos=300,27
|
||||
Size=878,826
|
||||
Collapsed=0
|
||||
DockId=0x00000002,0
|
||||
|
||||
[Window][DockSpace]
|
||||
Pos=0,0
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Add Object]
|
||||
Pos=1188,0
|
||||
Size=396,430
|
||||
Collapsed=0
|
||||
|
||||
[Window][Log]
|
||||
Pos=8,518
|
||||
Size=1568,335
|
||||
Collapsed=0
|
||||
DockId=0x0000000C,0
|
||||
|
||||
[Window][Log Window]
|
||||
Pos=8,775
|
||||
Size=1904,226
|
||||
Collapsed=0
|
||||
DockId=0x0000000E,0
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0xC0DFADC4 Pos=8,27 Size=1568,826 Split=X
|
||||
DockNode ID=0x00000001 Parent=0xC0DFADC4 SizeRef=330,1094 Selected=0x393905AB
|
||||
DockNode ID=0x00000003 Parent=0xC0DFADC4 SizeRef=1700,1094 CentralNode=1
|
||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=8,27 Size=1568,826 Split=Y
|
||||
DockNode ID=0x0000000D Parent=0xCCBD8CF7 SizeRef=1568,598 Split=Y
|
||||
DockNode ID=0x0000000B Parent=0x0000000D SizeRef=1568,637 Split=X
|
||||
DockNode ID=0x00000007 Parent=0x0000000B SizeRef=290,826 Split=Y Selected=0x393905AB
|
||||
DockNode ID=0x00000009 Parent=0x00000007 SizeRef=395,413 Selected=0x393905AB
|
||||
DockNode ID=0x0000000A Parent=0x00000007 SizeRef=395,411 Selected=0x031DC75C
|
||||
DockNode ID=0x00000008 Parent=0x0000000B SizeRef=1276,826 Split=X
|
||||
DockNode ID=0x00000002 Parent=0x00000008 SizeRef=878,826 CentralNode=1 Selected=0x9204953B
|
||||
DockNode ID=0x00000005 Parent=0x00000008 SizeRef=396,826 Selected=0x9F035453
|
||||
DockNode ID=0x0000000C Parent=0x0000000D SizeRef=1568,335 Selected=0x139FDA3F
|
||||
DockNode ID=0x0000000E Parent=0xCCBD8CF7 SizeRef=1568,226 Selected=0xAB74BEE9
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
cbuffer LightBuffer
|
||||
{
|
||||
float4 diffuseColor;
|
||||
float3 lightDirection;
|
||||
float padding; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
float3 lightPosition; // Add light position
|
||||
float padding2; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
float constantAttenuation;
|
||||
float linearAttenuation;
|
||||
float quadraticAttenuation;
|
||||
float padding3; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
};
|
||||
|
||||
Texture2D shaderTexture;
|
||||
SamplerState SampleType;
|
||||
|
||||
struct PixelInputType
|
||||
{
|
||||
float4 position : SV_POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float2 tex : TEXCOORD0;
|
||||
float3 worldPos : TEXCOORD1; // Add world position
|
||||
};
|
||||
|
||||
float4 CelShadingPixelShader(PixelInputType input) : SV_TARGET
|
||||
{
|
||||
float4 textureColor;
|
||||
float lightIntensity;
|
||||
float4 finalColor;
|
||||
|
||||
// Sample the pixel color from the texture.
|
||||
textureColor = shaderTexture.Sample(SampleType, input.tex);
|
||||
|
||||
float3 normal = normalize(input.normal);
|
||||
|
||||
// Calculate the light vector from the light position to the world position
|
||||
float3 lightVector = normalize(lightPosition - input.worldPos);
|
||||
|
||||
// Calculate the light intensity based on the light direction.
|
||||
float directionalLightIntensity = saturate(dot(normal, normalize(lightDirection)));
|
||||
|
||||
// Calculate the light intensity based on the light position.
|
||||
float positionalLightIntensity = saturate(dot(normal, lightVector));
|
||||
|
||||
// Combine the directional and positional light intensities.
|
||||
lightIntensity = max(directionalLightIntensity, positionalLightIntensity);
|
||||
|
||||
// Calculate the distance from the light to the fragment.
|
||||
float distance = length(lightPosition - input.worldPos);
|
||||
|
||||
// Apply an attenuation factor based on the distance.
|
||||
float attenuation = 1.0f / (constantAttenuation + linearAttenuation * distance + quadraticAttenuation * distance * distance);
|
||||
|
||||
// Combine the light intensity with the attenuation factor.
|
||||
lightIntensity *= attenuation;
|
||||
|
||||
// Apply a step function to create the cel shading effect.
|
||||
if (lightIntensity > 0.75f)
|
||||
{
|
||||
lightIntensity = 1.0f; // Brightest level
|
||||
}
|
||||
else if (lightIntensity > 0.5f)
|
||||
{
|
||||
lightIntensity = 0.7f; // Mid-bright level
|
||||
}
|
||||
else if (lightIntensity > 0.25f)
|
||||
{
|
||||
lightIntensity = 0.4f; // Mid-dark level
|
||||
}
|
||||
else
|
||||
{
|
||||
lightIntensity = 0.1f; // Darkest level
|
||||
}
|
||||
|
||||
// Simple shadow calculation: if the fragment is behind the light source, it is in shadow.
|
||||
float3 toLight = normalize(lightPosition - input.worldPos);
|
||||
float shadow = saturate(dot(normal, toLight));
|
||||
if (shadow < 0.1f)
|
||||
{
|
||||
lightIntensity *= 0.5f; // Darken the fragment if it is in shadow
|
||||
}
|
||||
|
||||
// Calculate the final color by combining the texture color with the light intensity and diffuse color.
|
||||
finalColor = textureColor * diffuseColor * lightIntensity;
|
||||
|
||||
return finalColor;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
cbuffer MatrixBuffer
|
||||
{
|
||||
matrix worldMatrix;
|
||||
matrix viewMatrix;
|
||||
matrix projectionMatrix;
|
||||
};
|
||||
|
||||
struct VertexInputType
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float2 tex : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct PixelInputType
|
||||
{
|
||||
float4 position : SV_POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float2 tex : TEXCOORD0;
|
||||
float3 worldPos : TEXCOORD1; // Add world position
|
||||
};
|
||||
|
||||
PixelInputType CelShadingVertexShader(VertexInputType input)
|
||||
{
|
||||
PixelInputType output;
|
||||
|
||||
// Change the position vector to be 4 units for proper matrix calculations.
|
||||
input.position.w = 1.0f;
|
||||
|
||||
// Calculate the position of the vertex against the world, view, and projection matrices.
|
||||
float4 worldPosition = mul(input.position, worldMatrix);
|
||||
output.position = mul(worldPosition, viewMatrix);
|
||||
output.position = mul(output.position, projectionMatrix);
|
||||
|
||||
// Pass the normal to the pixel shader
|
||||
output.normal = mul((float3x3)worldMatrix, input.normal);
|
||||
|
||||
// Pass the world position to the pixel shader
|
||||
output.worldPos = worldPosition.xyz;
|
||||
|
||||
// Store the texture coordinates for the pixel shader.
|
||||
output.tex = input.tex;
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -19,72 +19,60 @@
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="alphamapshaderclass.cpp" />
|
||||
<ClCompile Include="applicationclass.cpp" />
|
||||
<ClCompile Include="bitmapclass.cpp" />
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\DDSTextureLoader.cpp" />
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\DirectXHelpers.cpp" />
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\pch.cpp" />
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\SimpleMath.cpp" />
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\WICTextureLoader.cpp" />
|
||||
<ClCompile Include="Cameraclass.cpp" />
|
||||
<ClCompile Include="CelShadingShader.cpp" />
|
||||
<ClCompile Include="Colorshaderclass.cpp" />
|
||||
<ClCompile Include="d3dclass.cpp" />
|
||||
<ClCompile Include="imguiManager.cpp" />
|
||||
<ClCompile Include="include\backends\imgui_impl_dx11.cpp" />
|
||||
<ClCompile Include="include\backends\imgui_impl_win32.cpp" />
|
||||
<ClCompile Include="include\imgui.cpp" />
|
||||
<ClCompile Include="include\imgui_demo.cpp" />
|
||||
<ClCompile Include="include\imgui_draw.cpp" />
|
||||
<ClCompile Include="include\imgui_tables.cpp" />
|
||||
<ClCompile Include="include\imgui_widgets.cpp" />
|
||||
<ClCompile Include="displayplaneclass.cpp" />
|
||||
<ClCompile Include="fontclass.cpp" />
|
||||
<ClCompile Include="fontshaderclass.cpp" />
|
||||
<ClCompile Include="fpsclass.cpp" />
|
||||
<ClCompile Include="frustumclass.cpp" />
|
||||
<ClCompile Include="inputclass.cpp" />
|
||||
<ClCompile Include="Lightclass.cpp" />
|
||||
<ClCompile Include="lightmapshaderclass.cpp" />
|
||||
<ClCompile Include="Lightshaderclass.cpp" />
|
||||
<ClCompile Include="Main.cpp" />
|
||||
<ClCompile Include="modelclass.cpp" />
|
||||
<ClCompile Include="object.cpp" />
|
||||
<ClCompile Include="modellistclass.cpp" />
|
||||
<ClCompile Include="Multitextureshaderclass.cpp" />
|
||||
<ClCompile Include="normalmapshaderclass.cpp" />
|
||||
<ClCompile Include="refractionshaderclass.cpp" />
|
||||
<ClCompile Include="shadermanagerclass.cpp" />
|
||||
<ClCompile Include="physics.cpp" />
|
||||
<ClCompile Include="positionclass.cpp" />
|
||||
<ClCompile Include="reflectionshaderclass.cpp" />
|
||||
<ClCompile Include="rendertextureclass.cpp" />
|
||||
<ClCompile Include="specmapshaderclass.cpp" />
|
||||
<ClCompile Include="Spriteclass.cpp" />
|
||||
<ClCompile Include="Systemclass.cpp" />
|
||||
<ClCompile Include="textclass.cpp" />
|
||||
<ClCompile Include="textureclass.cpp" />
|
||||
<ClCompile Include="textureshaderclass.cpp" />
|
||||
<ClCompile Include="Timerclass.cpp" />
|
||||
<ClCompile Include="translateshaderclass.cpp" />
|
||||
<ClCompile Include="transparentshaderclass.cpp" />
|
||||
<ClCompile Include="watershaderclass.cpp" />
|
||||
<ClCompile Include="include\Src\DDSTextureLoader.cpp" />
|
||||
<ClCompile Include="include\Src\DirectXHelpers.cpp" />
|
||||
<ClCompile Include="include\Src\pch.cpp" />
|
||||
<ClCompile Include="include\Src\SimpleMath.cpp" />
|
||||
<ClCompile Include="include\Src\WICTextureLoader.cpp" />
|
||||
<ClCompile Include="src\src\shader\alphamapshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\CelShadingShader.cpp" />
|
||||
<ClCompile Include="src\src\shader\Colorshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\fontshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\lightmapshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\lightshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\Multitextureshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\normalmapshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\reflectionshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\refractionshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\shadermanagerclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\specmapshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\sunlightshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\textureshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\translateshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\transparentshaderclass.cpp" />
|
||||
<ClCompile Include="src\src\shader\watershaderclass.cpp" />
|
||||
<ClCompile Include="src\src\system\applicationclass.cpp" />
|
||||
<ClCompile Include="src\src\system\bitmapclass.cpp" />
|
||||
<ClCompile Include="src\src\system\Cameraclass.cpp" />
|
||||
<ClCompile Include="src\src\system\d3dclass.cpp" />
|
||||
<ClCompile Include="src\src\system\displayplaneclass.cpp" />
|
||||
<ClCompile Include="src\src\system\fontclass.cpp" />
|
||||
<ClCompile Include="src\src\system\fpsclass.cpp" />
|
||||
<ClCompile Include="src\src\system\frustum.cpp" />
|
||||
<ClCompile Include="src\src\system\frustumclass.cpp" />
|
||||
<ClCompile Include="src\src\system\imguiManager.cpp" />
|
||||
<ClCompile Include="src\src\system\inputclass.cpp" />
|
||||
<ClCompile Include="src\src\system\lightclass.cpp" />
|
||||
<ClCompile Include="src\src\system\Main.cpp" />
|
||||
<ClCompile Include="src\src\system\modelclass.cpp" />
|
||||
<ClCompile Include="src\src\system\Modellistclass.cpp" />
|
||||
<ClCompile Include="src\src\system\object.cpp" />
|
||||
<ClCompile Include="src\src\system\physics.cpp" />
|
||||
<ClCompile Include="src\src\system\Positionclass.cpp" />
|
||||
<ClCompile Include="src\src\system\rendertextureclass.cpp" />
|
||||
<ClCompile Include="src\src\system\Spriteclass.cpp" />
|
||||
<ClCompile Include="src\src\system\Systemclass.cpp" />
|
||||
<ClCompile Include="src\src\system\textclass.cpp" />
|
||||
<ClCompile Include="src\src\system\textureclass.cpp" />
|
||||
<ClCompile Include="src\src\system\Timerclass.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="alphamapshaderclass.h" />
|
||||
<ClInclude Include="applicationclass.h" />
|
||||
<ClInclude Include="bitmapclass.h" />
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\CMO.h" />
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\DDS.h" />
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\LoaderHelpers.h" />
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\pch.h" />
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\PlatformHelpers.h" />
|
||||
<ClInclude Include="Cameraclass.h" />
|
||||
<ClInclude Include="CelShadingShader.h" />
|
||||
<ClInclude Include="Colorshaderclass.h" />
|
||||
<ClInclude Include="d3dclass.h" />
|
||||
<ClInclude Include="imguiManager.h" />
|
||||
<ClInclude Include="include\backends\imgui_impl_dx11.h" />
|
||||
<ClInclude Include="include\backends\imgui_impl_win32.h" />
|
||||
<ClInclude Include="include\imconfig.h" />
|
||||
@@ -93,158 +81,292 @@
|
||||
<ClInclude Include="include\imstb_rectpack.h" />
|
||||
<ClInclude Include="include\imstb_textedit.h" />
|
||||
<ClInclude Include="include\imstb_truetype.h" />
|
||||
<ClInclude Include="displayplaneclass.h" />
|
||||
<ClInclude Include="fontclass.h" />
|
||||
<ClInclude Include="fontshaderclass.h" />
|
||||
<ClInclude Include="fpsclass.h" />
|
||||
<ClInclude Include="frustumclass.h" />
|
||||
<ClInclude Include="inputclass.h" />
|
||||
<ClInclude Include="lightclass.h" />
|
||||
<ClInclude Include="lightmapshaderclass.h" />
|
||||
<ClInclude Include="lightshaderclass.h" />
|
||||
<ClInclude Include="Logger.h" />
|
||||
<ClInclude Include="modelclass.h" />
|
||||
<ClInclude Include="object.h" />
|
||||
<ClInclude Include="modellistclass.h" />
|
||||
<ClInclude Include="Multitextureshaderclass.h" />
|
||||
<ClInclude Include="normalmapshaderclass.h" />
|
||||
<ClInclude Include="refractionshaderclass.h" />
|
||||
<ClInclude Include="shadermanagerclass.h" />
|
||||
<ClInclude Include="physics.h" />
|
||||
<ClInclude Include="positionclass.h" />
|
||||
<ClInclude Include="reflectionshaderclass.h" />
|
||||
<ClInclude Include="rendertextureclass.h" />
|
||||
<ClInclude Include="resources.h" />
|
||||
<ClInclude Include="specmapshaderclass.h" />
|
||||
<ClInclude Include="Spriteclass.h" />
|
||||
<ClInclude Include="systemclass.h" />
|
||||
<ClInclude Include="textclass.h" />
|
||||
<ClInclude Include="textureclass.h" />
|
||||
<ClInclude Include="textureshaderclass.h" />
|
||||
<ClInclude Include="Timerclass.h" />
|
||||
<ClInclude Include="translateshaderclass.h" />
|
||||
<ClInclude Include="transparentshaderclass.h" />
|
||||
<ClInclude Include="watershaderclass.h" />
|
||||
<ClInclude Include="include\Src\CMO.h" />
|
||||
<ClInclude Include="include\Src\DDS.h" />
|
||||
<ClInclude Include="include\Src\LoaderHelpers.h" />
|
||||
<ClInclude Include="include\Src\pch.h" />
|
||||
<ClInclude Include="include\Src\PlatformHelpers.h" />
|
||||
<ClInclude Include="src\inc\shader\alphamapshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\CelShadingShader.h" />
|
||||
<ClInclude Include="src\inc\shader\Colorshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\fontshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\lightmapshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\lightshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\lightshaderwaterclass.h" />
|
||||
<ClInclude Include="src\inc\shader\Multitextureshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\normalmapshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\reflectionshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\refractionshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\shadermanagerclass.h" />
|
||||
<ClInclude Include="src\inc\shader\specmapshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\sunlightshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\textureshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\translateshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\transparentshaderclass.h" />
|
||||
<ClInclude Include="src\inc\shader\watershaderclass.h" />
|
||||
<ClInclude Include="src\inc\system\applicationclass.h" />
|
||||
<ClInclude Include="src\inc\system\bitmapclass.h" />
|
||||
<ClInclude Include="src\inc\system\Cameraclass.h" />
|
||||
<ClInclude Include="src\inc\system\d3dclass.h" />
|
||||
<ClInclude Include="src\inc\system\displayplaneclass.h" />
|
||||
<ClInclude Include="src\inc\system\fontclass.h" />
|
||||
<ClInclude Include="src\inc\system\fpsclass.h" />
|
||||
<ClInclude Include="src\inc\system\frustum.h" />
|
||||
<ClInclude Include="src\inc\system\frustumclass.h" />
|
||||
<ClInclude Include="src\inc\system\imguiManager.h" />
|
||||
<ClInclude Include="src\inc\system\inputclass.h" />
|
||||
<ClInclude Include="src\inc\system\lightclass.h" />
|
||||
<ClInclude Include="src\inc\system\Logger.h" />
|
||||
<ClInclude Include="src\inc\system\modelclass.h" />
|
||||
<ClInclude Include="src\inc\system\Modellistclass.h" />
|
||||
<ClInclude Include="src\inc\system\object.h" />
|
||||
<ClInclude Include="src\inc\system\physics.h" />
|
||||
<ClInclude Include="src\inc\system\Positionclass.h" />
|
||||
<ClInclude Include="src\inc\system\rendertextureclass.h" />
|
||||
<ClInclude Include="src\inc\system\Spriteclass.h" />
|
||||
<ClInclude Include="src\inc\system\systemclass.h" />
|
||||
<ClInclude Include="src\inc\system\textclass.h" />
|
||||
<ClInclude Include="src\inc\system\textureclass.h" />
|
||||
<ClInclude Include="src\inc\system\Timerclass.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="alphamap.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\alphamap.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="alphamap.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\alphamap.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="font.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\celshading.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="font.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\celshading.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="light.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\Color.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="light.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\Color.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="lightmap.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\font.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="lightmap.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\font.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="Multitexture.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\light.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="Multitexture.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\light.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="normalmap.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\lightmap.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="normalmap.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\lightmap.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="..\KhaoticDemo\water.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\Multitexture.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="celshading.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\Multitexture.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="celshading.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\normalmap.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<None Include="packages.config" />
|
||||
<CopyFileToFolders Include="reflection.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\normalmap.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="reflection.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\reflection.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="specmap.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\reflection.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="specmap.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\refraction.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="texture.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\refraction.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="texture.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\specmap.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="transparent.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\specmap.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="transparent.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\sunlight.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="refraction.ps">
|
||||
<CopyFileToFolders Include="src\hlsl\sunlight.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="refraction.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\texture.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="water.vs">
|
||||
<CopyFileToFolders Include="src\hlsl\texture.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="Color.ps">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
|
||||
<CopyFileToFolders Include="src\hlsl\translate.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="Color.vs">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
|
||||
<CopyFileToFolders Include="src\hlsl\translate.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="src\hlsl\transparent.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="src\hlsl\transparent.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="src\hlsl\water.ps">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="src\hlsl\water.vs">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\src\hlsl</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="font01.tga" />
|
||||
<Image Include="assets\Texture\alpha01.png" />
|
||||
<Image Include="assets\Texture\Bricks2K.png" />
|
||||
<Image Include="assets\Texture\BricksGLOSS2K.png" />
|
||||
<Image Include="assets\Texture\BricksNRM2K.png" />
|
||||
<Image Include="assets\Texture\dirt01.png" />
|
||||
<Image Include="assets\Texture\font01.png" />
|
||||
<Image Include="assets\Texture\ground01.png" />
|
||||
<Image Include="assets\Texture\light01.png" />
|
||||
<Image Include="assets\Texture\marble01.png" />
|
||||
<Image Include="assets\Texture\moss01.png" />
|
||||
<Image Include="assets\Texture\normal01.png" />
|
||||
<Image Include="assets\Texture\spec02.png" />
|
||||
<Image Include="assets\Texture\sprite01.png" />
|
||||
<Image Include="assets\Texture\sprite02.png" />
|
||||
<Image Include="assets\Texture\sprite03.png" />
|
||||
<Image Include="assets\Texture\sprite04.png" />
|
||||
<Image Include="assets\Texture\stone01.png" />
|
||||
<Image Include="assets\Texture\wall.png" />
|
||||
<Image Include="assets\Texture\wall01.png" />
|
||||
<Image Include="assets\Texture\water01.png" />
|
||||
<CopyFileToFolders Include="assets\Texture\alpha01.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\Bricks2K.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\BricksGLOSS2K.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\BricksNRM2K.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\dirt01.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\font01.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\ground01.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\light01.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\marble01.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\moss01.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\normal01.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\spec02.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\sprite01.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\sprite02.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\sprite03.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\sprite04.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\stone01.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\stone01.tga">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\wall.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\wall01.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\water01.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\EmptyTexture.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Texture\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Skybox\skybox_back.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Skybox\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Skybox\skybox_bottom.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Skybox\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Skybox\skybox_front.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Skybox\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Skybox\skybox_left.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Skybox\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Skybox\skybox_right.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Skybox\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Skybox\skybox_top.png">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Skybox\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<Image Include="KhaoticIcon.ico" />
|
||||
<CopyFileToFolders Include="sprite01.tga" />
|
||||
<CopyFileToFolders Include="sprite02.tga" />
|
||||
@@ -254,48 +376,84 @@
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="font01.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="translate.ps">
|
||||
<SubType>Designer</SubType>
|
||||
<FileType>Document</FileType>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="translate.vs">
|
||||
<SubType>Designer</SubType>
|
||||
<FileType>Document</FileType>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="resources.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="assets\Model\OBJ\86.obj">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\OBJ\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\OBJ\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\OBJ\cone.obj">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\OBJ\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\OBJ\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\OBJ\isosphere.obj">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\OBJ\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\OBJ\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\OBJ\monke.obj">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\OBJ\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\OBJ\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\OBJ\vaisseau.obj">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\OBJ\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\OBJ\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="assets\Model\TXT\bath.txt" />
|
||||
<CopyFileToFolders Include="assets\Model\TXT\bath.txt">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\TXT\chunk.txt">
|
||||
<FileType>Text</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\TXT\cube.txt">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\TXT\ground.txt">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\TXT\plane.txt">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\TXT\sphere.txt">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\TXT\square.txt">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\TXT\wall.txt">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\TXT\water.txt">
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\TXT\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="sprite_data_01.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="assets\Model\OBJ\plane.obj">
|
||||
<FileType>Document</FileType>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)\assets\Model\OBJ\</DestinationFolders>
|
||||
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)\assets\Model\OBJ\</DestinationFolders>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\TXT\cube.txt" />
|
||||
<CopyFileToFolders Include="assets\Model\TXT\ground.txt" />
|
||||
<CopyFileToFolders Include="assets\Model\TXT\plane.txt" />
|
||||
<CopyFileToFolders Include="assets\Model\TXT\sphere.txt" />
|
||||
<CopyFileToFolders Include="assets\Model\TXT\square.txt" />
|
||||
<CopyFileToFolders Include="assets\Model\TXT\wall.txt" />
|
||||
<CopyFileToFolders Include="assets\Model\TXT\water.txt" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
@@ -383,7 +541,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)enginecustom\include\backends;$(SolutionDir)enginecustom\include\Inc;$(SolutionDir)enginecustom\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)enginecustom\include\backends;$(SolutionDir)enginecustom\include\Inc;$(SolutionDir)enginecustom\include;$(SolutionDir)enginecustom\src\inc\shader;$(SolutionDir)enginecustom\src\inc\system;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -400,7 +558,7 @@
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)enginecustom\include\backends;$(SolutionDir)enginecustom\include\Inc;$(SolutionDir)enginecustom\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)enginecustom\include\backends;$(SolutionDir)enginecustom\include\Inc;$(SolutionDir)enginecustom\include;$(SolutionDir)enginecustom\src\inc\shader;$(SolutionDir)enginecustom\src\inc\system;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
|
||||
@@ -49,35 +49,23 @@
|
||||
<Filter Include="Assets\Model\TXT">
|
||||
<UniqueIdentifier>{f67d85e0-106e-47a1-bb9c-a5ea9111509a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Fichiers d%27en-tête\Shader">
|
||||
<UniqueIdentifier>{e087647e-a306-4246-9320-bab0830bb634}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Fichiers sources\Shader">
|
||||
<UniqueIdentifier>{3c669b93-a9fd-4b74-813f-f9780413f76b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Fichiers sources\System">
|
||||
<UniqueIdentifier>{b2659b1e-695d-488e-9a1c-341691d312bc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Assets\Skybox">
|
||||
<UniqueIdentifier>{4bfa47c6-e23c-4cae-a7af-3fc870a448e4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Fichiers d%27en-tête\System">
|
||||
<UniqueIdentifier>{567548ae-97a4-413e-8d44-86d6e8252487}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Main.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Systemclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="inputclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="applicationclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="d3dclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Colorshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="modelclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Cameraclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="include\imgui_demo.cpp">
|
||||
<Filter>Fichiers sources\ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="include\backends\imgui_impl_dx11.cpp">
|
||||
<Filter>Fichiers sources\ImGui</Filter>
|
||||
</ClCompile>
|
||||
@@ -96,140 +84,146 @@
|
||||
<ClCompile Include="include\imgui_widgets.cpp">
|
||||
<Filter>Fichiers sources\ImGui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="imguiManager.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lightclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lightshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="object.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="textureclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="bitmapclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="fontclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="fontshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="fpsclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Spriteclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Multitextureshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="textclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="textureshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Timerclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="fpsclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="alphamapshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="specmapshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="frustumclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="modellistclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="positionclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="displayplaneclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="rendertextureclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="translateshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="reflectionshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="shadermanagerclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="transparentshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lightmapshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="watershaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="refractionshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="physics.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="normalmapshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CelShadingShader.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\DDSTextureLoader.cpp">
|
||||
<ClCompile Include="include\Src\DDSTextureLoader.cpp">
|
||||
<Filter>Fichiers sources\DirectX Tool Kit</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\DirectXHelpers.cpp">
|
||||
<ClCompile Include="include\Src\DirectXHelpers.cpp">
|
||||
<Filter>Fichiers sources\DirectX Tool Kit</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\pch.cpp">
|
||||
<ClCompile Include="include\Src\pch.cpp">
|
||||
<Filter>Fichiers sources\DirectX Tool Kit</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\SimpleMath.cpp">
|
||||
<ClCompile Include="include\Src\SimpleMath.cpp">
|
||||
<Filter>Fichiers sources\DirectX Tool Kit</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\WICTextureLoader.cpp">
|
||||
<ClCompile Include="include\Src\WICTextureLoader.cpp">
|
||||
<Filter>Fichiers sources\DirectX Tool Kit</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\alphamapshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\CelShadingShader.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\Colorshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\lightmapshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\lightshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\Multitextureshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\normalmapshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\reflectionshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\refractionshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\shadermanagerclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\specmapshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\sunlightshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\textureshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\translateshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\transparentshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\watershaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\applicationclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\bitmapclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\Cameraclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\d3dclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\displayplaneclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\fontclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\fpsclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\frustum.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\frustumclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\imguiManager.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\inputclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\lightclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\Main.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\modelclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\Modellistclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\object.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\physics.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\Positionclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\rendertextureclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\Spriteclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\Systemclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\textclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\textureclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\system\Timerclass.cpp">
|
||||
<Filter>Fichiers sources\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\src\shader\fontshaderclass.cpp">
|
||||
<Filter>Fichiers sources\Shader</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="systemclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="inputclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="applicationclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d3dclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Colorshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="modelclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Cameraclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\imconfig.h">
|
||||
<Filter>Fichiers d%27en-tête\ImGui</Filter>
|
||||
</ClInclude>
|
||||
@@ -254,191 +248,152 @@
|
||||
<ClInclude Include="include\backends\imgui_impl_win32.h">
|
||||
<Filter>Fichiers d%27en-tête\ImGui</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="imguiManager.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="lightshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="object.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="textureclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="bitmapclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="fontclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="fontshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="fpsclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="lightclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Multitextureshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Spriteclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="textclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="textureshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Timerclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="fpsclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="lightmapshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="alphamapshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="normalmapshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="specmapshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="frustumclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="modellistclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="positionclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="displayplaneclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="rendertextureclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="translateshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="reflectionshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resources.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="shadermanagerclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="transparentshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Logger.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="watershaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="refractionshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="physics.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CelShadingShader.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\PlatformHelpers.h">
|
||||
<ClInclude Include="include\Src\CMO.h">
|
||||
<Filter>Fichiers d%27en-tête\DirectX Tool Kit</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\pch.h">
|
||||
<ClInclude Include="include\Src\DDS.h">
|
||||
<Filter>Fichiers d%27en-tête\DirectX Tool Kit</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\LoaderHelpers.h">
|
||||
<ClInclude Include="include\Src\LoaderHelpers.h">
|
||||
<Filter>Fichiers d%27en-tête\DirectX Tool Kit</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\DDS.h">
|
||||
<ClInclude Include="include\Src\pch.h">
|
||||
<Filter>Fichiers d%27en-tête\DirectX Tool Kit</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\CMO.h">
|
||||
<ClInclude Include="include\Src\PlatformHelpers.h">
|
||||
<Filter>Fichiers d%27en-tête\DirectX Tool Kit</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\alphamapshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\CelShadingShader.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\Colorshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\fontshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\lightmapshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\lightshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\lightshaderwaterclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\Multitextureshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\normalmapshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\reflectionshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\refractionshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\shadermanagerclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\specmapshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\sunlightshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\textureshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\translateshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\transparentshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\shader\watershaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête\Shader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\applicationclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\bitmapclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\Cameraclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\d3dclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\displayplaneclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\fontclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\fpsclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\frustum.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\frustumclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\imguiManager.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\inputclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\lightclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\Logger.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\modelclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\Modellistclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\object.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\physics.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\Positionclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\rendertextureclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\Spriteclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\systemclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\textclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\textureclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\inc\system\Timerclass.h">
|
||||
<Filter>Fichiers d%27en-tête\System</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="KhaoticIcon.ico">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\BricksGLOSS2K.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\BricksNRM2K.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\alpha01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\Bricks2K.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\dirt01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\font01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\ground01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\light01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\marble01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\moss01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\normal01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\spec02.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\sprite01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\sprite02.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\sprite03.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\sprite04.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\stone01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\wall.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\wall01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
<Image Include="assets\Texture\water01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="resources.rc">
|
||||
@@ -446,114 +401,12 @@
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="font.vs">
|
||||
<Filter>Fonts</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="font.ps">
|
||||
<Filter>Fonts</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="Color.vs">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="light.ps">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="font01.txt">
|
||||
<Filter>Fonts</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="font01.tga">
|
||||
<Filter>fonts</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="sprite01.tga">
|
||||
<Filter>Assets</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="sprite02.tga">
|
||||
<Filter>Assets</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="sprite03.tga">
|
||||
<Filter>Assets</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="sprite04.tga">
|
||||
<Filter>Assets</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="Color.ps">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="light.vs">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="lightmap.ps">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="lightmap.vs">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="reflection.ps">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="reflection.vs">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="translate.ps">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="translate.vs">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="transparent.ps">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="transparent.vs">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="Multitexture.ps">
|
||||
<Filter>Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="Multitexture.vs">
|
||||
<Filter>Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="normalmap.ps">
|
||||
<Filter>Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="normalmap.vs">
|
||||
<Filter>Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="specmap.ps">
|
||||
<Filter>Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="specmap.vs">
|
||||
<Filter>Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="texture.ps">
|
||||
<Filter>Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="texture.vs">
|
||||
<Filter>Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="alphamap.vs">
|
||||
<Filter>Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="alphamap.ps">
|
||||
<Filter>Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="refraction.ps">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="refraction.vs">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="..\KhaoticDemo\water.ps">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="water.vs">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="celshading.vs">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="celshading.ps">
|
||||
<Filter>shader</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\TXT\bath.txt">
|
||||
<Filter>Assets\Model\TXT</Filter>
|
||||
</CopyFileToFolders>
|
||||
@@ -596,5 +449,139 @@
|
||||
<CopyFileToFolders Include="assets\Model\OBJ\86.obj">
|
||||
<Filter>Assets\Model\OBJ</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="sprite_data_01.txt">
|
||||
<Filter>Assets</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\stone01.tga">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\alpha01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\Bricks2K.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\BricksGLOSS2K.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\BricksNRM2K.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\dirt01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\font01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\ground01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\light01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\marble01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\moss01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\normal01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\spec02.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\sprite01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\sprite02.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\sprite03.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Model\OBJ\plane.obj">
|
||||
<Filter>Assets\Model\OBJ</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\EmptyTexture.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\stone01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="sprite01.tga">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="sprite02.tga">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="sprite03.tga">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\sprite04.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="sprite04.tga">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\wall.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\wall01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Texture\water01.png">
|
||||
<Filter>Assets\Texture</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Skybox\skybox_back.png">
|
||||
<Filter>Assets\Skybox</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Skybox\skybox_bottom.png">
|
||||
<Filter>Assets\Skybox</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Skybox\skybox_front.png">
|
||||
<Filter>Assets\Skybox</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Skybox\skybox_left.png">
|
||||
<Filter>Assets\Skybox</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Skybox\skybox_right.png">
|
||||
<Filter>Assets\Skybox</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="assets\Skybox\skybox_top.png">
|
||||
<Filter>Assets\Skybox</Filter>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="src\hlsl\alphamap.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\alphamap.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\celshading.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\celshading.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\Color.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\Color.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\font.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\font.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\light.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\light.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\lightmap.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\lightmap.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\Multitexture.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\Multitexture.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\normalmap.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\normalmap.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\reflection.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\reflection.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\refraction.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\refraction.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\specmap.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\specmap.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\sunlight.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\sunlight.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\texture.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\texture.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\translate.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\translate.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\transparent.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\transparent.vs" />
|
||||
<CopyFileToFolders Include="src\hlsl\water.ps" />
|
||||
<CopyFileToFolders Include="src\hlsl\water.vs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,24 +1,89 @@
|
||||
[Window][Debug##Default]
|
||||
Pos=60,60
|
||||
Size=400,400
|
||||
Collapsed=0
|
||||
|
||||
[Window][Khaotic Engine]
|
||||
Pos=1128,39
|
||||
Size=392,273
|
||||
Pos=1233,27
|
||||
Size=343,826
|
||||
Collapsed=0
|
||||
DockId=0x00000005,0
|
||||
|
||||
[Window][Objects]
|
||||
Pos=934,36
|
||||
Size=457,294
|
||||
Pos=8,27
|
||||
Size=290,826
|
||||
Collapsed=0
|
||||
DockId=0x0000000A,0
|
||||
|
||||
[Window][Terrain]
|
||||
Pos=60,60
|
||||
Size=342,82
|
||||
Pos=8,27
|
||||
Size=290,866
|
||||
Collapsed=0
|
||||
DockId=0x00000009,0
|
||||
|
||||
[Window][Light]
|
||||
Pos=1551,17
|
||||
Size=358,535
|
||||
Pos=8,27
|
||||
Size=290,866
|
||||
Collapsed=0
|
||||
DockId=0x00000009,1
|
||||
|
||||
[Window][Shader Manager]
|
||||
Pos=34,253
|
||||
Size=172,284
|
||||
Pos=8,27
|
||||
Size=330,487
|
||||
Collapsed=0
|
||||
DockId=0x00000001,2
|
||||
|
||||
[Window][Engine Settings]
|
||||
Pos=1187,27
|
||||
Size=389,826
|
||||
Collapsed=0
|
||||
DockId=0x00000008,1
|
||||
|
||||
[Window][DockSpace Demo]
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Render Window]
|
||||
Pos=8,27
|
||||
Size=1223,826
|
||||
Collapsed=0
|
||||
DockId=0x00000008,0
|
||||
|
||||
[Window][DockSpace]
|
||||
Pos=0,0
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Add Object]
|
||||
Pos=1188,0
|
||||
Size=396,430
|
||||
Collapsed=0
|
||||
|
||||
[Window][Log]
|
||||
Pos=8,518
|
||||
Size=1568,335
|
||||
Collapsed=0
|
||||
DockId=0x0000000C,0
|
||||
|
||||
[Window][Log Window]
|
||||
Pos=8,627
|
||||
Size=1568,226
|
||||
Collapsed=0
|
||||
DockId=0x00000006,0
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0xC0DFADC4 Pos=8,27 Size=1568,826 Split=X
|
||||
DockNode ID=0x00000001 Parent=0xC0DFADC4 SizeRef=330,1094 Selected=0x393905AB
|
||||
DockNode ID=0x00000003 Parent=0xC0DFADC4 SizeRef=1700,1094 CentralNode=1
|
||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=8,27 Size=1568,826 Split=X
|
||||
DockNode ID=0x00000002 Parent=0xCCBD8CF7 SizeRef=1223,826 Split=Y
|
||||
DockNode ID=0x00000004 Parent=0x00000002 SizeRef=2032,866 Split=Y
|
||||
DockNode ID=0x0000000B Parent=0x00000004 SizeRef=1568,637 Split=X
|
||||
DockNode ID=0x00000007 Parent=0x0000000B SizeRef=290,826 Split=Y Selected=0x393905AB
|
||||
DockNode ID=0x00000009 Parent=0x00000007 SizeRef=395,413 Selected=0x321620B2
|
||||
DockNode ID=0x0000000A Parent=0x00000007 SizeRef=395,411 Selected=0x031DC75C
|
||||
DockNode ID=0x00000008 Parent=0x0000000B SizeRef=1276,826 CentralNode=1 Selected=0x9204953B
|
||||
DockNode ID=0x0000000C Parent=0x00000004 SizeRef=1568,335 Selected=0x139FDA3F
|
||||
DockNode ID=0x00000006 Parent=0x00000002 SizeRef=2032,226 Selected=0xAB74BEE9
|
||||
DockNode ID=0x00000005 Parent=0xCCBD8CF7 SizeRef=343,826 Selected=0x9F035453
|
||||
|
||||
|
||||
@@ -1,381 +0,0 @@
|
||||
#include "imguiManager.h"
|
||||
#include "applicationclass.h"
|
||||
#include <string>
|
||||
|
||||
imguiManager::imguiManager()
|
||||
{
|
||||
io = nullptr;
|
||||
}
|
||||
|
||||
imguiManager::~imguiManager()
|
||||
{
|
||||
}
|
||||
|
||||
bool imguiManager::Initialize(HWND hwnd, ID3D11Device* device, ID3D11DeviceContext* deviceContext)
|
||||
{
|
||||
Logger::Get().Log("Initializing imgui", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
||||
|
||||
m_device = device;
|
||||
m_deviceContext = deviceContext;
|
||||
|
||||
IMGUI_CHECKVERSION();
|
||||
ImGui::CreateContext();
|
||||
io = &ImGui::GetIO();
|
||||
|
||||
ImGui_ImplWin32_Init(hwnd);
|
||||
ImGui_ImplDX11_Init(m_device, m_deviceContext);
|
||||
ImGui::StyleColorsDark();
|
||||
|
||||
Logger::Get().Log("imgui initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void imguiManager::Shutdown()
|
||||
{
|
||||
Logger::Get().Log("Shutting down imgui", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
|
||||
ImGui_ImplDX11_Shutdown();
|
||||
ImGui_ImplWin32_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
Logger::Get().Log("imgui shutdown", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
|
||||
}
|
||||
|
||||
void imguiManager::Render()
|
||||
{
|
||||
ImGui::Render();
|
||||
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
|
||||
}
|
||||
|
||||
void imguiManager::NewFrame()
|
||||
{
|
||||
ImGui_ImplDX11_NewFrame();
|
||||
ImGui_ImplWin32_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
}
|
||||
|
||||
void imguiManager::WidgetSpeedSlider(float* speed)
|
||||
{
|
||||
ImGui::SliderFloat("Speed", speed, 0.0f, 100.0f);
|
||||
}
|
||||
|
||||
void imguiManager::WidgetButton()
|
||||
{
|
||||
static int counter = 0;
|
||||
|
||||
if (ImGui::Button("Button")) // Buttons return true when clicked (most widgets return true when edited/activated)
|
||||
counter++;
|
||||
ImGui::SameLine();
|
||||
ImGui::Text("counter = %d", counter);
|
||||
}
|
||||
|
||||
void imguiManager::WidgetFPS()
|
||||
{
|
||||
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io->Framerate, io->Framerate);
|
||||
}
|
||||
|
||||
void imguiManager::WidgetAddObject(ApplicationClass* app)
|
||||
{
|
||||
if (ImGui::CollapsingHeader("Objects"))
|
||||
{
|
||||
if (ImGui::Button("Add Cube"))
|
||||
{
|
||||
app->AddCube();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Import Object"))
|
||||
{
|
||||
// Open file dialog
|
||||
OPENFILENAME ofn;
|
||||
WCHAR szFile[260];
|
||||
ZeroMemory(&ofn, sizeof(ofn));
|
||||
ofn.lStructSize = sizeof(ofn);
|
||||
ofn.hwndOwner = NULL;
|
||||
ofn.lpstrFile = szFile;
|
||||
ofn.lpstrFile[0] = '\0';
|
||||
ofn.nMaxFile = sizeof(szFile);
|
||||
ofn.lpstrFilter = L"TXT\0*.txt\0KOBJ\0*.kobj\0*OBJ\0*.obj";
|
||||
ofn.nFilterIndex = 1;
|
||||
ofn.lpstrFileTitle = NULL;
|
||||
ofn.nMaxFileTitle = 0;
|
||||
ofn.lpstrInitialDir = NULL;
|
||||
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
|
||||
|
||||
if (GetOpenFileName(&ofn))
|
||||
{
|
||||
app->AddKobject(ofn.lpstrFile);
|
||||
}
|
||||
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Text("Number of cubes: %d", app->GetCubeCount());
|
||||
}
|
||||
}
|
||||
|
||||
void imguiManager::WidgetShaderWindow(ApplicationClass* app)
|
||||
{
|
||||
ImGui::Begin("Shader Manager");
|
||||
|
||||
// Checkbox for toggling cel shading globally in the application class by calling the SetCelShading function in the application class when the checkbox state changes
|
||||
ImGui::Checkbox("Enable Cel Shading", &m_EnableCelShading);
|
||||
app->SetCelShading(m_EnableCelShading);
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
void imguiManager::WidgetObjectWindow(ApplicationClass* app)
|
||||
{
|
||||
ImGui::Begin("Objects", &showObjectWindow);
|
||||
int index = 0;
|
||||
for (auto& object : app->GetKobjects())
|
||||
{
|
||||
std::string headerName = object->GetName() + " " + std::to_string(index);
|
||||
if (ImGui::CollapsingHeader(headerName.c_str()))
|
||||
{
|
||||
|
||||
XMVECTOR position = object->GetPosition();
|
||||
XMVECTOR rotation = object->GetRotation();
|
||||
XMVECTOR scale = object->GetScale();
|
||||
|
||||
float pos[3] = { XMVectorGetX(position), XMVectorGetY(position), XMVectorGetZ(position) };
|
||||
std::string posLabel = "Position##" + std::to_string(index);
|
||||
if (ImGui::DragFloat3(posLabel.c_str(), pos))
|
||||
{
|
||||
object->SetPosition(XMVectorSet(pos[0], pos[1], pos[2], 0.0f));
|
||||
}
|
||||
|
||||
float rot[3] = { XMVectorGetX(rotation), XMVectorGetY(rotation), XMVectorGetZ(rotation) };
|
||||
std::string rotLabel = "Rotation##" + std::to_string(index);
|
||||
if (ImGui::DragFloat3(rotLabel.c_str(), rot))
|
||||
{
|
||||
object->SetRotation(XMVectorSet(rot[0], rot[1], rot[2], 0.0f));
|
||||
}
|
||||
|
||||
float scl[3] = { XMVectorGetX(scale), XMVectorGetY(scale), XMVectorGetZ(scale) };
|
||||
std::string sclLabel = "Scale##" + std::to_string(index);
|
||||
if (ImGui::DragFloat3(sclLabel.c_str(), scl))
|
||||
{
|
||||
object->SetScale(XMVectorSet(scl[0], scl[1], scl[2], 0.0f));
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
// Texture
|
||||
// add all texture category names to a vector
|
||||
std::vector<std::string> textureCategories = { "Diffuse", "Normal", "Specular", "Alpha", "Light", "Change Me" };
|
||||
|
||||
|
||||
for (int count = 0; count < 6; count++)
|
||||
{
|
||||
std::string textureLabel = "Texture##" + std::to_string(index);
|
||||
ID3D11ShaderResourceView* texture = object->GetTexture(count);
|
||||
if (texture != nullptr)
|
||||
{
|
||||
// Set the cursor position
|
||||
ImGui::SetCursorPosX(count * (64 + 20) + 10); // 64 is the width of the image, 10 is the spacing
|
||||
|
||||
// Display the texture name
|
||||
std::string textureName = textureCategories[count];
|
||||
ImGui::Text(textureName.c_str());
|
||||
|
||||
if(count < 5)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Display all images
|
||||
for (int count = 0; count < 6; count++)
|
||||
{
|
||||
std::string textureLabel = "Texture##" + std::to_string(index);
|
||||
ID3D11ShaderResourceView* texture = object->GetTexture(count);
|
||||
if (texture != nullptr)
|
||||
{
|
||||
// Set the cursor position
|
||||
ImGui::SetCursorPosX(count * (64 + 20) + 10); // 64 is the width of the image, 10 is the spacing
|
||||
|
||||
if (ImGui::ImageButton((ImTextureID)texture, ImVec2(64, 64)))
|
||||
{
|
||||
// Open file dialog
|
||||
OPENFILENAME ofn;
|
||||
WCHAR szFile[260];
|
||||
ZeroMemory(&ofn, sizeof(ofn));
|
||||
ofn.lStructSize = sizeof(ofn);
|
||||
ofn.hwndOwner = NULL;
|
||||
ofn.lpstrFile = szFile;
|
||||
ofn.lpstrFile[0] = '\0';
|
||||
ofn.nMaxFile = sizeof(szFile);
|
||||
ofn.lpstrFilter = L"Texture\0*.png\0";
|
||||
ofn.nFilterIndex = 1;
|
||||
ofn.lpstrFileTitle = NULL;
|
||||
ofn.nMaxFileTitle = 0;
|
||||
ofn.lpstrInitialDir = NULL;
|
||||
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
|
||||
|
||||
if (GetOpenFileName(&ofn))
|
||||
{
|
||||
// Load the selected texture
|
||||
object->ChangeTexture(m_device, m_deviceContext, ofn.lpstrFile, index);
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Image((ImTextureID)texture, ImVec2(256, 256));
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
|
||||
// If this is not the last texture, put the next button on the same line
|
||||
if (count < 5)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
// Delete button
|
||||
std::string deleteLabel = "Delete##" + std::to_string(index);
|
||||
if (ImGui::Button(deleteLabel.c_str()))
|
||||
{
|
||||
app->DeleteKobject(index);
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
// Demo spinning
|
||||
std::string demoLabel = "Demo spinning##" + std::to_string(index);
|
||||
ImGui::Checkbox(demoLabel.c_str(), &object->m_demoSpinning);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
void imguiManager::WidgetTerrainWindow(ApplicationClass* app)
|
||||
{
|
||||
ImGui::Begin("Terrain", &showTerrainWindow);
|
||||
|
||||
ImGui::Text("Number of terrain cubes: %d", app->GetTerrainCubeCount());
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
if (ImGui::Button("Generate Terrain"))
|
||||
{
|
||||
app->GenerateTerrain();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button("Delete All Terrain Cubes"))
|
||||
{
|
||||
app->DeleteTerrain();
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
bool imguiManager::ImGuiWidgetRenderer(ApplicationClass* app)
|
||||
{
|
||||
// Start the Dear ImGui frame
|
||||
NewFrame();
|
||||
|
||||
//ImGui Widget
|
||||
ImGui::Begin("Khaotic Engine", NULL);
|
||||
|
||||
float speed = app->GetSpeed();
|
||||
WidgetSpeedSlider(&speed);
|
||||
app->SetSpeed(speed);
|
||||
WidgetButton();
|
||||
WidgetFPS();
|
||||
WidgetAddObject(app);
|
||||
ImGui::Separator();
|
||||
|
||||
// Add buttons for opening windows
|
||||
if (ImGui::Button("Open Object Window"))
|
||||
{
|
||||
showObjectWindow = true;
|
||||
}
|
||||
|
||||
if (ImGui::Button("Open Terrain Window"))
|
||||
{
|
||||
showTerrainWindow = true;
|
||||
}
|
||||
|
||||
if (ImGui::Button("Open Light Window"))
|
||||
{
|
||||
showLightWindow = true;
|
||||
}
|
||||
|
||||
if (ImGui::Button("Open Shader Window"))
|
||||
{
|
||||
showShaderWindow = true;
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
|
||||
// Show windows if their corresponding variables are true
|
||||
if (showObjectWindow)
|
||||
{
|
||||
WidgetObjectWindow(app);
|
||||
}
|
||||
|
||||
if (showTerrainWindow)
|
||||
{
|
||||
WidgetTerrainWindow(app);
|
||||
}
|
||||
|
||||
if (showLightWindow)
|
||||
{
|
||||
WidgetLightWindow(app);
|
||||
}
|
||||
|
||||
if (showShaderWindow)
|
||||
{
|
||||
WidgetShaderWindow(app);
|
||||
}
|
||||
|
||||
//render imgui
|
||||
Render();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void imguiManager::WidgetLightWindow(ApplicationClass* app)
|
||||
{
|
||||
ImGui::Begin("Light", &showLightWindow);
|
||||
int index = 0;
|
||||
|
||||
for(auto& light : app->GetLights())
|
||||
{
|
||||
std::string headerName = "Light " + std::to_string(index);
|
||||
if (ImGui::CollapsingHeader(headerName.c_str()))
|
||||
{
|
||||
XMVECTOR position = app->GetLightPosition(index);
|
||||
XMVECTOR color = app->GetLightColor(index);
|
||||
float pos[3] = { XMVectorGetX(position), XMVectorGetY(position), XMVectorGetZ(position) };
|
||||
float col[3] = { XMVectorGetX(color), XMVectorGetY(color), XMVectorGetZ(color) };
|
||||
|
||||
std::string posLabel = "Position##" + std::to_string(index);
|
||||
std::string colLabel = "Color##" + std::to_string(index);
|
||||
|
||||
if (ImGui::DragFloat3(posLabel.c_str(), pos))
|
||||
{
|
||||
app->SetLightPosition(index, XMVectorSet(pos[0], pos[1], pos[2], 0.0f));
|
||||
}
|
||||
|
||||
if (ImGui::ColorEdit3(colLabel.c_str(), col))
|
||||
{
|
||||
app->SetLightColor(index, XMVectorSet(col[0], col[1], col[2], 0.0f));
|
||||
}
|
||||
|
||||
}
|
||||
index++;
|
||||
};
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
#pragma once
|
||||
#ifndef _IMGUI_MANAGER_H_
|
||||
#define _IMGUI_MANAGER_H_
|
||||
|
||||
#include "Logger.h"
|
||||
|
||||
#include <imgui.h>
|
||||
#include <imgui_impl_dx11.h>
|
||||
#include <imgui_impl_win32.h>
|
||||
#include <windows.h>
|
||||
|
||||
class ApplicationClass;
|
||||
|
||||
class imguiManager
|
||||
{
|
||||
public:
|
||||
imguiManager();
|
||||
~imguiManager();
|
||||
|
||||
bool Initialize(HWND hwnd, ID3D11Device* device, ID3D11DeviceContext* deviceContext);
|
||||
void Shutdown();
|
||||
void Render();
|
||||
void NewFrame();
|
||||
|
||||
// Widgets
|
||||
void WidgetSpeedSlider(float* speed);
|
||||
void WidgetButton();
|
||||
void WidgetFPS();
|
||||
void WidgetAddObject(ApplicationClass* app);
|
||||
|
||||
void WidgetObjectWindow(ApplicationClass* app);
|
||||
void WidgetTerrainWindow(ApplicationClass* app);
|
||||
void WidgetLightWindow(ApplicationClass* app);
|
||||
void WidgetShaderWindow(ApplicationClass* app);
|
||||
|
||||
bool ImGuiWidgetRenderer(ApplicationClass* app);
|
||||
|
||||
// Shader toggles
|
||||
|
||||
bool m_EnableCelShading;
|
||||
|
||||
private :
|
||||
bool showObjectWindow = false;
|
||||
bool showTerrainWindow = false;
|
||||
bool showLightWindow = false;
|
||||
bool showShaderWindow = false;
|
||||
|
||||
private:
|
||||
ImGuiIO* io;
|
||||
|
||||
ID3D11Device* m_device;
|
||||
ID3D11DeviceContext* m_deviceContext;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
181
enginecustom/include/Src/CMO.h
Normal file
@@ -0,0 +1,181 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: CMO.h
|
||||
//
|
||||
// .CMO files are built by Visual Studio's MeshContentTask and an example renderer was
|
||||
// provided in the VS Direct3D Starter Kit
|
||||
// https://devblogs.microsoft.com/cppblog/developing-an-app-with-the-visual-studio-3d-starter-kit-part-1-of-3/
|
||||
// https://devblogs.microsoft.com/cppblog/developing-an-app-with-the-visual-studio-3d-starter-kit-part-2-of-3/
|
||||
// https://devblogs.microsoft.com/cppblog/developing-an-app-with-the-visual-studio-3d-starter-kit-part-3-of-3/
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <DirectXMath.h>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
namespace VSD3DStarter
|
||||
{
|
||||
// .CMO files
|
||||
|
||||
// UINT - Mesh count
|
||||
// { [Mesh count]
|
||||
// UINT - Length of name
|
||||
// wchar_t[] - Name of mesh (if length > 0)
|
||||
// UINT - Material count
|
||||
// { [Material count]
|
||||
// UINT - Length of material name
|
||||
// wchar_t[] - Name of material (if length > 0)
|
||||
// Material structure
|
||||
// UINT - Length of pixel shader name
|
||||
// wchar_t[] - Name of pixel shader (if length > 0)
|
||||
// { [8]
|
||||
// UINT - Length of texture name
|
||||
// wchar_t[] - Name of texture (if length > 0)
|
||||
// }
|
||||
// }
|
||||
// BYTE - 1 if there is skeletal animation data present
|
||||
// UINT - SubMesh count
|
||||
// { [SubMesh count]
|
||||
// SubMesh structure
|
||||
// }
|
||||
// UINT - IB Count
|
||||
// { [IB Count]
|
||||
// UINT - Number of USHORTs in IB
|
||||
// USHORT[] - Array of indices
|
||||
// }
|
||||
// UINT - VB Count
|
||||
// { [VB Count]
|
||||
// UINT - Number of verts in VB
|
||||
// Vertex[] - Array of vertices
|
||||
// }
|
||||
// UINT - Skinning VB Count
|
||||
// { [Skinning VB Count]
|
||||
// UINT - Number of verts in Skinning VB
|
||||
// SkinningVertex[] - Array of skinning verts
|
||||
// }
|
||||
// MeshExtents structure
|
||||
// [If skeleton animation data is not present, file ends here]
|
||||
// UINT - Bone count
|
||||
// { [Bone count]
|
||||
// UINT - Length of bone name
|
||||
// wchar_t[] - Bone name (if length > 0)
|
||||
// Bone structure
|
||||
// }
|
||||
// UINT - Animation clip count
|
||||
// { [Animation clip count]
|
||||
// UINT - Length of clip name
|
||||
// wchar_t[] - Clip name (if length > 0)
|
||||
// float - Start time
|
||||
// float - End time
|
||||
// UINT - Keyframe count
|
||||
// { [Keyframe count]
|
||||
// Keyframe structure
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
#pragma pack(push,1)
|
||||
|
||||
struct Material
|
||||
{
|
||||
DirectX::XMFLOAT4 Ambient;
|
||||
DirectX::XMFLOAT4 Diffuse;
|
||||
DirectX::XMFLOAT4 Specular;
|
||||
float SpecularPower;
|
||||
DirectX::XMFLOAT4 Emissive;
|
||||
DirectX::XMFLOAT4X4 UVTransform;
|
||||
};
|
||||
|
||||
constexpr uint32_t MAX_TEXTURE = 8;
|
||||
|
||||
struct SubMesh
|
||||
{
|
||||
uint32_t MaterialIndex;
|
||||
uint32_t IndexBufferIndex;
|
||||
uint32_t VertexBufferIndex;
|
||||
uint32_t StartIndex;
|
||||
uint32_t PrimCount;
|
||||
};
|
||||
|
||||
constexpr uint32_t NUM_BONE_INFLUENCES = 4;
|
||||
|
||||
// Vertex struct for Visual Studio Shader Designer (DGSL) holding position, normal,
|
||||
// tangent, color (RGBA), and texture mapping information
|
||||
struct VertexPositionNormalTangentColorTexture
|
||||
{
|
||||
DirectX::XMFLOAT3 position;
|
||||
DirectX::XMFLOAT3 normal;
|
||||
DirectX::XMFLOAT4 tangent;
|
||||
uint32_t color;
|
||||
DirectX::XMFLOAT2 textureCoordinate;
|
||||
};
|
||||
|
||||
struct SkinningVertex
|
||||
{
|
||||
uint32_t boneIndex[NUM_BONE_INFLUENCES];
|
||||
float boneWeight[NUM_BONE_INFLUENCES];
|
||||
};
|
||||
|
||||
struct MeshExtents
|
||||
{
|
||||
float CenterX, CenterY, CenterZ;
|
||||
float Radius;
|
||||
|
||||
float MinX, MinY, MinZ;
|
||||
float MaxX, MaxY, MaxZ;
|
||||
};
|
||||
|
||||
struct Bone
|
||||
{
|
||||
int32_t ParentIndex;
|
||||
DirectX::XMFLOAT4X4 InvBindPos;
|
||||
DirectX::XMFLOAT4X4 BindPos;
|
||||
DirectX::XMFLOAT4X4 LocalTransform;
|
||||
};
|
||||
|
||||
struct Clip
|
||||
{
|
||||
float StartTime;
|
||||
float EndTime;
|
||||
uint32_t keys;
|
||||
};
|
||||
|
||||
struct Keyframe
|
||||
{
|
||||
uint32_t BoneIndex;
|
||||
float Time;
|
||||
DirectX::XMFLOAT4X4 Transform;
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
const Material s_defMaterial =
|
||||
{
|
||||
{ 0.2f, 0.2f, 0.2f, 1.f },
|
||||
{ 0.8f, 0.8f, 0.8f, 1.f },
|
||||
{ 0.0f, 0.0f, 0.0f, 1.f },
|
||||
1.f,
|
||||
{ 0.0f, 0.0f, 0.0f, 1.0f },
|
||||
{ 1.f, 0.f, 0.f, 0.f,
|
||||
0.f, 1.f, 0.f, 0.f,
|
||||
0.f, 0.f, 1.f, 0.f,
|
||||
0.f, 0.f, 0.f, 1.f },
|
||||
};
|
||||
} // namespace
|
||||
|
||||
static_assert(sizeof(VSD3DStarter::Material) == 132, "CMO Mesh structure size incorrect");
|
||||
static_assert(sizeof(VSD3DStarter::SubMesh) == 20, "CMO Mesh structure size incorrect");
|
||||
static_assert(sizeof(VSD3DStarter::VertexPositionNormalTangentColorTexture) == 52, "CMO Mesh structure size incorrect");
|
||||
static_assert(sizeof(VSD3DStarter::SkinningVertex) == 32, "CMO Mesh structure size incorrect");
|
||||
static_assert(sizeof(VSD3DStarter::MeshExtents) == 40, "CMO Mesh structure size incorrect");
|
||||
static_assert(sizeof(VSD3DStarter::Bone) == 196, "CMO Mesh structure size incorrect");
|
||||
static_assert(sizeof(VSD3DStarter::Clip) == 12, "CMO Mesh structure size incorrect");
|
||||
static_assert(sizeof(VSD3DStarter::Keyframe) == 72, "CMO Mesh structure size incorrect");
|
||||
330
enginecustom/include/Src/DDS.h
Normal file
@@ -0,0 +1,330 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
// DDS.h
|
||||
//
|
||||
// This header defines constants and structures that are useful when parsing
|
||||
// DDS files. DDS files were originally designed to use several structures
|
||||
// and constants that are native to DirectDraw and are defined in ddraw.h,
|
||||
// such as DDSURFACEDESC2 and DDSCAPS2. This file defines similar
|
||||
// (compatible) constants and structures so that one can use DDS files
|
||||
// without needing to include ddraw.h.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248926
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
|
||||
#pragma pack(push,1)
|
||||
|
||||
constexpr uint32_t DDS_MAGIC = 0x20534444; // "DDS "
|
||||
|
||||
struct DDS_PIXELFORMAT
|
||||
{
|
||||
uint32_t size;
|
||||
uint32_t flags;
|
||||
uint32_t fourCC;
|
||||
uint32_t RGBBitCount;
|
||||
uint32_t RBitMask;
|
||||
uint32_t GBitMask;
|
||||
uint32_t BBitMask;
|
||||
uint32_t ABitMask;
|
||||
};
|
||||
|
||||
#define DDS_FOURCC 0x00000004 // DDPF_FOURCC
|
||||
#define DDS_RGB 0x00000040 // DDPF_RGB
|
||||
#define DDS_RGBA 0x00000041 // DDPF_RGB | DDPF_ALPHAPIXELS
|
||||
#define DDS_LUMINANCE 0x00020000 // DDPF_LUMINANCE
|
||||
#define DDS_LUMINANCEA 0x00020001 // DDPF_LUMINANCE | DDPF_ALPHAPIXELS
|
||||
#define DDS_ALPHAPIXELS 0x00000001 // DDPF_ALPHAPIXELS
|
||||
#define DDS_ALPHA 0x00000002 // DDPF_ALPHA
|
||||
#define DDS_PAL8 0x00000020 // DDPF_PALETTEINDEXED8
|
||||
#define DDS_PAL8A 0x00000021 // DDPF_PALETTEINDEXED8 | DDPF_ALPHAPIXELS
|
||||
#define DDS_BUMPLUMINANCE 0x00040000 // DDPF_BUMPLUMINANCE
|
||||
#define DDS_BUMPDUDV 0x00080000 // DDPF_BUMPDUDV
|
||||
#define DDS_BUMPDUDVA 0x00080001 // DDPF_BUMPDUDV | DDPF_ALPHAPIXELS
|
||||
|
||||
#ifndef MAKEFOURCC
|
||||
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
|
||||
(static_cast<uint32_t>(static_cast<uint8_t>(ch0)) \
|
||||
| (static_cast<uint32_t>(static_cast<uint8_t>(ch1)) << 8) \
|
||||
| (static_cast<uint32_t>(static_cast<uint8_t>(ch2)) << 16) \
|
||||
| (static_cast<uint32_t>(static_cast<uint8_t>(ch3)) << 24))
|
||||
#endif /* MAKEFOURCC */
|
||||
|
||||
#ifndef DDSGLOBALCONST
|
||||
#if defined(__GNUC__) && !defined(__MINGW32__)
|
||||
#define DDSGLOBALCONST extern const __attribute__((weak))
|
||||
#else
|
||||
#define DDSGLOBALCONST extern const __declspec(selectany)
|
||||
#endif
|
||||
#endif /* DDSGLOBALCONST */
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_DXT1 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_DXT2 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','2'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_DXT3 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','3'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_DXT4 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','4'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_DXT5 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','T','5'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_BC4_UNORM =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('B','C','4','U'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_BC4_SNORM =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('B','C','4','S'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_BC5_UNORM =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('B','C','5','U'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_BC5_SNORM =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('B','C','5','S'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_R8G8_B8G8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('R','G','B','G'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_G8R8_G8B8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('G','R','G','B'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_YUY2 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('Y','U','Y','2'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_UYVY =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('U','Y','V','Y'), 0, 0, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A8R8G8B8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_X8R8G8B8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A8B8G8R8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_X8B8G8R8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_G16R16 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 32, 0x0000ffff, 0xffff0000, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_R5G6B5 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 16, 0xf800, 0x07e0, 0x001f, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A1R5G5B5 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 16, 0x7c00, 0x03e0, 0x001f, 0x8000 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_X1R5G5B5 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 16, 0x7c00, 0x03e0, 0x001f, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A4R4G4B4 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 16, 0x0f00, 0x00f0, 0x000f, 0xf000 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_X4R4G4B4 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 16, 0x0f00, 0x00f0, 0x000f, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_R8G8B8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A8R3G3B2 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 16, 0x00e0, 0x001c, 0x0003, 0xff00 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_R3G3B2 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 8, 0xe0, 0x1c, 0x03, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A4L4 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_LUMINANCEA, 0, 8, 0x0f, 0, 0, 0xf0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_L8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_LUMINANCE, 0, 8, 0xff, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_L16 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_LUMINANCE, 0, 16, 0xffff, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A8L8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_LUMINANCEA, 0, 16, 0x00ff, 0, 0, 0xff00 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A8L8_ALT =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_LUMINANCEA, 0, 8, 0x00ff, 0, 0, 0xff00 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_L8_NVTT1 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 8, 0xff, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_L16_NVTT1 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGB, 0, 16, 0xffff, 0, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A8L8_NVTT1 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 16, 0x00ff, 0, 0, 0xff00 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_ALPHA, 0, 8, 0, 0, 0, 0xff };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_V8U8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_BUMPDUDV, 0, 16, 0x00ff, 0xff00, 0, 0 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_Q8W8V8U8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_BUMPDUDV, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 };
|
||||
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_V16U16 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_BUMPDUDV, 0, 32, 0x0000ffff, 0xffff0000, 0, 0 };
|
||||
|
||||
// D3DFMT_A2R10G10B10/D3DFMT_A2B10G10R10 should be written using DX10 extension to avoid D3DX 10:10:10:2 reversal issue
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A2R10G10B10 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 32, 0x000003ff, 0x000ffc00, 0x3ff00000, 0xc0000000 };
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A2B10G10R10 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_RGBA, 0, 32, 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000 };
|
||||
|
||||
// The following legacy Direct3D 9 formats use 'mixed' signed & unsigned channels so requires special handling
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_A2W10V10U10 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_BUMPDUDVA, 0, 32, 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000 };
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_L6V5U5 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_BUMPLUMINANCE, 0, 16, 0x001f, 0x03e0, 0xfc00, 0 };
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_X8L8V8U8 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_BUMPLUMINANCE, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0 };
|
||||
|
||||
// This indicates the DDS_HEADER_DXT10 extension is present (the format is in dxgiFormat)
|
||||
DDSGLOBALCONST DDS_PIXELFORMAT DDSPF_DX10 =
|
||||
{ sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('D','X','1','0'), 0, 0, 0, 0, 0 };
|
||||
|
||||
#define DDS_HEADER_FLAGS_TEXTURE 0x00001007 // DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT
|
||||
#define DDS_HEADER_FLAGS_MIPMAP 0x00020000 // DDSD_MIPMAPCOUNT
|
||||
#define DDS_HEADER_FLAGS_VOLUME 0x00800000 // DDSD_DEPTH
|
||||
#define DDS_HEADER_FLAGS_PITCH 0x00000008 // DDSD_PITCH
|
||||
#define DDS_HEADER_FLAGS_LINEARSIZE 0x00080000 // DDSD_LINEARSIZE
|
||||
|
||||
#define DDS_HEIGHT 0x00000002 // DDSD_HEIGHT
|
||||
#define DDS_WIDTH 0x00000004 // DDSD_WIDTH
|
||||
|
||||
#define DDS_SURFACE_FLAGS_TEXTURE 0x00001000 // DDSCAPS_TEXTURE
|
||||
#define DDS_SURFACE_FLAGS_MIPMAP 0x00400008 // DDSCAPS_COMPLEX | DDSCAPS_MIPMAP
|
||||
#define DDS_SURFACE_FLAGS_CUBEMAP 0x00000008 // DDSCAPS_COMPLEX
|
||||
|
||||
#define DDS_CUBEMAP_POSITIVEX 0x00000600 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEX
|
||||
#define DDS_CUBEMAP_NEGATIVEX 0x00000a00 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEX
|
||||
#define DDS_CUBEMAP_POSITIVEY 0x00001200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEY
|
||||
#define DDS_CUBEMAP_NEGATIVEY 0x00002200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEY
|
||||
#define DDS_CUBEMAP_POSITIVEZ 0x00004200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_POSITIVEZ
|
||||
#define DDS_CUBEMAP_NEGATIVEZ 0x00008200 // DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_NEGATIVEZ
|
||||
|
||||
#define DDS_CUBEMAP_ALLFACES ( DDS_CUBEMAP_POSITIVEX | DDS_CUBEMAP_NEGATIVEX |\
|
||||
DDS_CUBEMAP_POSITIVEY | DDS_CUBEMAP_NEGATIVEY |\
|
||||
DDS_CUBEMAP_POSITIVEZ | DDS_CUBEMAP_NEGATIVEZ )
|
||||
|
||||
#define DDS_CUBEMAP 0x00000200 // DDSCAPS2_CUBEMAP
|
||||
|
||||
#define DDS_FLAGS_VOLUME 0x00200000 // DDSCAPS2_VOLUME
|
||||
|
||||
// Subset here matches D3D10_RESOURCE_DIMENSION and D3D11_RESOURCE_DIMENSION
|
||||
enum DDS_RESOURCE_DIMENSION : uint32_t
|
||||
{
|
||||
DDS_DIMENSION_TEXTURE1D = 2,
|
||||
DDS_DIMENSION_TEXTURE2D = 3,
|
||||
DDS_DIMENSION_TEXTURE3D = 4,
|
||||
};
|
||||
|
||||
// Subset here matches D3D10_RESOURCE_MISC_FLAG and D3D11_RESOURCE_MISC_FLAG
|
||||
enum DDS_RESOURCE_MISC_FLAG : uint32_t
|
||||
{
|
||||
DDS_RESOURCE_MISC_TEXTURECUBE = 0x4L,
|
||||
};
|
||||
|
||||
enum DDS_MISC_FLAGS2 : uint32_t
|
||||
{
|
||||
DDS_MISC_FLAGS2_ALPHA_MODE_MASK = 0x7L,
|
||||
};
|
||||
|
||||
#ifndef DDS_ALPHA_MODE_DEFINED
|
||||
#define DDS_ALPHA_MODE_DEFINED
|
||||
enum DDS_ALPHA_MODE : uint32_t
|
||||
{
|
||||
DDS_ALPHA_MODE_UNKNOWN = 0,
|
||||
DDS_ALPHA_MODE_STRAIGHT = 1,
|
||||
DDS_ALPHA_MODE_PREMULTIPLIED = 2,
|
||||
DDS_ALPHA_MODE_OPAQUE = 3,
|
||||
DDS_ALPHA_MODE_CUSTOM = 4,
|
||||
};
|
||||
#endif
|
||||
|
||||
struct DDS_HEADER
|
||||
{
|
||||
uint32_t size;
|
||||
uint32_t flags;
|
||||
uint32_t height;
|
||||
uint32_t width;
|
||||
uint32_t pitchOrLinearSize;
|
||||
uint32_t depth; // only if DDS_HEADER_FLAGS_VOLUME is set in flags
|
||||
uint32_t mipMapCount;
|
||||
uint32_t reserved1[11];
|
||||
DDS_PIXELFORMAT ddspf;
|
||||
uint32_t caps;
|
||||
uint32_t caps2;
|
||||
uint32_t caps3;
|
||||
uint32_t caps4;
|
||||
uint32_t reserved2;
|
||||
};
|
||||
|
||||
struct DDS_HEADER_DXT10
|
||||
{
|
||||
DXGI_FORMAT dxgiFormat;
|
||||
uint32_t resourceDimension;
|
||||
uint32_t miscFlag; // see D3D11_RESOURCE_MISC_FLAG
|
||||
uint32_t arraySize;
|
||||
uint32_t miscFlags2; // see DDS_MISC_FLAGS2
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
static_assert(sizeof(DDS_PIXELFORMAT) == 32, "DDS pixel format size mismatch");
|
||||
static_assert(sizeof(DDS_HEADER) == 124, "DDS Header size mismatch");
|
||||
static_assert(sizeof(DDS_HEADER_DXT10) == 20, "DDS DX10 Extended Header size mismatch");
|
||||
|
||||
constexpr size_t DDS_MIN_HEADER_SIZE = sizeof(uint32_t) + sizeof(DDS_HEADER);
|
||||
constexpr size_t DDS_DX10_HEADER_SIZE = sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10);
|
||||
static_assert(DDS_DX10_HEADER_SIZE > DDS_MIN_HEADER_SIZE, "DDS DX10 Header should be larger than standard header");
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace Xbox
|
||||
{
|
||||
DDSGLOBALCONST DirectX::DDS_PIXELFORMAT DDSPF_XBOX =
|
||||
{ sizeof(DirectX::DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('X','B','O','X'), 0, 0, 0, 0, 0 };
|
||||
|
||||
#pragma pack(push,1)
|
||||
|
||||
struct DDS_HEADER_XBOX
|
||||
// Must match structure in XboxDDSTextureLoader module
|
||||
{
|
||||
DXGI_FORMAT dxgiFormat;
|
||||
uint32_t resourceDimension;
|
||||
uint32_t miscFlag; // see DDS_RESOURCE_MISC_FLAG
|
||||
uint32_t arraySize;
|
||||
uint32_t miscFlags2; // see DDS_MISC_FLAGS2
|
||||
uint32_t tileMode; // see XG_TILE_MODE / XG_SWIZZLE_MODE
|
||||
uint32_t baseAlignment;
|
||||
uint32_t dataSize;
|
||||
uint32_t xdkVer; // matching _XDK_VER / _GXDK_VER
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
static_assert(sizeof(DDS_HEADER_XBOX) == 36, "DDS XBOX Header size mismatch");
|
||||
static_assert(sizeof(DDS_HEADER_XBOX) > sizeof(DirectX::DDS_HEADER_DXT10), "DDS XBOX Header should be larger than DX10 header");
|
||||
|
||||
constexpr size_t DDS_XBOX_HEADER_SIZE = sizeof(uint32_t) + sizeof(DirectX::DDS_HEADER) + sizeof(DDS_HEADER_XBOX);
|
||||
|
||||
constexpr uint32_t XBOX_TILEMODE_SCARLETT = 0x1000000;
|
||||
} // namespace
|
||||
1439
enginecustom/include/Src/DDSTextureLoader.cpp
Normal file
54
enginecustom/include/Src/DirectXHelpers.cpp
Normal file
@@ -0,0 +1,54 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: DirectXHelpers.cpp
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#include "pch.h"
|
||||
#include "DirectXHelpers.h"
|
||||
#include "Effects.h"
|
||||
#include "PlatformHelpers.h"
|
||||
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
_Use_decl_annotations_
|
||||
HRESULT DirectX::CreateInputLayoutFromEffect(
|
||||
ID3D11Device* device,
|
||||
IEffect* effect,
|
||||
const D3D11_INPUT_ELEMENT_DESC* desc,
|
||||
size_t count,
|
||||
ID3D11InputLayout** pInputLayout) noexcept
|
||||
{
|
||||
if (!pInputLayout)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*pInputLayout = nullptr;
|
||||
|
||||
if (!device || !effect || !desc || !count)
|
||||
return E_INVALIDARG;
|
||||
|
||||
void const* shaderByteCode;
|
||||
size_t byteCodeLength;
|
||||
|
||||
try
|
||||
{
|
||||
effect->GetVertexShaderBytecode(&shaderByteCode, &byteCodeLength);
|
||||
}
|
||||
catch (com_exception e)
|
||||
{
|
||||
return e.get_result();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return device->CreateInputLayout(
|
||||
desc, static_cast<UINT>(count),
|
||||
shaderByteCode, byteCodeLength,
|
||||
pInputLayout);
|
||||
}
|
||||
1107
enginecustom/include/Src/LoaderHelpers.h
Normal file
94
enginecustom/include/Src/PlatformHelpers.h
Normal file
@@ -0,0 +1,94 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: PlatformHelpers.h
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4324)
|
||||
#endif
|
||||
|
||||
#include <exception>
|
||||
#include <memory>
|
||||
|
||||
#ifndef MAKEFOURCC
|
||||
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
|
||||
(static_cast<uint32_t>(static_cast<uint8_t>(ch0)) \
|
||||
| (static_cast<uint32_t>(static_cast<uint8_t>(ch1)) << 8) \
|
||||
| (static_cast<uint32_t>(static_cast<uint8_t>(ch2)) << 16) \
|
||||
| (static_cast<uint32_t>(static_cast<uint8_t>(ch3)) << 24))
|
||||
#endif /* defined(MAKEFOURCC) */
|
||||
|
||||
// See https://walbourn.github.io/modern-c++-bitmask-types/
|
||||
#ifndef ENUM_FLAGS_CONSTEXPR
|
||||
#if defined(NTDDI_WIN10_RS1) && !defined(__MINGW32__)
|
||||
#define ENUM_FLAGS_CONSTEXPR constexpr
|
||||
#else
|
||||
#define ENUM_FLAGS_CONSTEXPR const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
class com_exception : public std::exception
|
||||
{
|
||||
public:
|
||||
com_exception(HRESULT hr) noexcept : result(hr) {}
|
||||
|
||||
const char* what() const noexcept override
|
||||
{
|
||||
static char s_str[64] = {};
|
||||
sprintf_s(s_str, "Failure with HRESULT of %08X", static_cast<unsigned int>(result));
|
||||
return s_str;
|
||||
}
|
||||
|
||||
HRESULT get_result() const noexcept { return result; }
|
||||
|
||||
private:
|
||||
HRESULT result;
|
||||
};
|
||||
|
||||
// Helper utility converts D3D API failures into exceptions.
|
||||
inline void ThrowIfFailed(HRESULT hr) noexcept(false)
|
||||
{
|
||||
if (FAILED(hr))
|
||||
{
|
||||
throw com_exception(hr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Helper for output debug tracing
|
||||
inline void DebugTrace(_In_z_ _Printf_format_string_ const char* format, ...) noexcept
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
char buff[1024] = {};
|
||||
vsprintf_s(buff, format, args);
|
||||
OutputDebugStringA(buff);
|
||||
va_end(args);
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(format);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Helper smart-pointers
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10) || (defined(_XBOX_ONE) && defined(_TITLE)) || !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
||||
struct virtual_deleter { void operator()(void* p) noexcept { if (p) VirtualFree(p, 0, MEM_RELEASE); } };
|
||||
#endif
|
||||
|
||||
struct handle_closer { void operator()(HANDLE h) noexcept { if (h) CloseHandle(h); } };
|
||||
|
||||
using ScopedHandle = std::unique_ptr<void, handle_closer>;
|
||||
|
||||
inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
||||
}
|
||||
247
enginecustom/include/Src/SimpleMath.cpp
Normal file
@@ -0,0 +1,247 @@
|
||||
//-------------------------------------------------------------------------------------
|
||||
// SimpleMath.cpp -- Simplified C++ Math wrapper for DirectXMath
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
#include "pch.h"
|
||||
#include "SimpleMath.h"
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Constants
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
namespace SimpleMath
|
||||
{
|
||||
const Vector2 Vector2::Zero = { 0.f, 0.f };
|
||||
const Vector2 Vector2::One = { 1.f, 1.f };
|
||||
const Vector2 Vector2::UnitX = { 1.f, 0.f };
|
||||
const Vector2 Vector2::UnitY = { 0.f, 1.f };
|
||||
|
||||
const Vector3 Vector3::Zero = { 0.f, 0.f, 0.f };
|
||||
const Vector3 Vector3::One = { 1.f, 1.f, 1.f };
|
||||
const Vector3 Vector3::UnitX = { 1.f, 0.f, 0.f };
|
||||
const Vector3 Vector3::UnitY = { 0.f, 1.f, 0.f };
|
||||
const Vector3 Vector3::UnitZ = { 0.f, 0.f, 1.f };
|
||||
const Vector3 Vector3::Up = { 0.f, 1.f, 0.f };
|
||||
const Vector3 Vector3::Down = { 0.f, -1.f, 0.f };
|
||||
const Vector3 Vector3::Right = { 1.f, 0.f, 0.f };
|
||||
const Vector3 Vector3::Left = { -1.f, 0.f, 0.f };
|
||||
const Vector3 Vector3::Forward = { 0.f, 0.f, -1.f };
|
||||
const Vector3 Vector3::Backward = { 0.f, 0.f, 1.f };
|
||||
|
||||
const Vector4 Vector4::Zero = { 0.f, 0.f, 0.f, 0.f };
|
||||
const Vector4 Vector4::One = { 1.f, 1.f, 1.f, 1.f };
|
||||
const Vector4 Vector4::UnitX = { 1.f, 0.f, 0.f, 0.f };
|
||||
const Vector4 Vector4::UnitY = { 0.f, 1.f, 0.f, 0.f };
|
||||
const Vector4 Vector4::UnitZ = { 0.f, 0.f, 1.f, 0.f };
|
||||
const Vector4 Vector4::UnitW = { 0.f, 0.f, 0.f, 1.f };
|
||||
|
||||
const Matrix Matrix::Identity = { 1.f, 0.f, 0.f, 0.f,
|
||||
0.f, 1.f, 0.f, 0.f,
|
||||
0.f, 0.f, 1.f, 0.f,
|
||||
0.f, 0.f, 0.f, 1.f };
|
||||
|
||||
const Quaternion Quaternion::Identity = { 0.f, 0.f, 0.f, 1.f };
|
||||
}
|
||||
}
|
||||
|
||||
using namespace DirectX;
|
||||
using namespace DirectX::SimpleMath;
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Quaternion
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void Quaternion::RotateTowards(const Quaternion& target, float maxAngle, Quaternion& result) const noexcept
|
||||
{
|
||||
const XMVECTOR T = XMLoadFloat4(this);
|
||||
|
||||
// We can use the conjugate here instead of inverse assuming q1 & q2 are normalized.
|
||||
const XMVECTOR R = XMQuaternionMultiply(XMQuaternionConjugate(T), target);
|
||||
|
||||
const float rs = XMVectorGetW(R);
|
||||
const XMVECTOR L = XMVector3Length(R);
|
||||
const float angle = 2.f * atan2f(XMVectorGetX(L), rs);
|
||||
if (angle > maxAngle)
|
||||
{
|
||||
const XMVECTOR delta = XMQuaternionRotationAxis(R, maxAngle);
|
||||
const XMVECTOR Q = XMQuaternionMultiply(delta, T);
|
||||
XMStoreFloat4(&result, Q);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't overshoot.
|
||||
result = target;
|
||||
}
|
||||
}
|
||||
|
||||
void Quaternion::FromToRotation(const Vector3& fromDir, const Vector3& toDir, Quaternion& result) noexcept
|
||||
{
|
||||
// Melax, "The Shortest Arc Quaternion", Game Programming Gems, Charles River Media (2000).
|
||||
|
||||
const XMVECTOR F = XMVector3Normalize(fromDir);
|
||||
const XMVECTOR T = XMVector3Normalize(toDir);
|
||||
|
||||
const float dot = XMVectorGetX(XMVector3Dot(F, T));
|
||||
if (dot >= 1.f)
|
||||
{
|
||||
result = Identity;
|
||||
}
|
||||
else if (dot <= -1.f)
|
||||
{
|
||||
XMVECTOR axis = XMVector3Cross(F, Vector3::Right);
|
||||
if (XMVector3NearEqual(XMVector3LengthSq(axis), g_XMZero, g_XMEpsilon))
|
||||
{
|
||||
axis = XMVector3Cross(F, Vector3::Up);
|
||||
}
|
||||
|
||||
const XMVECTOR Q = XMQuaternionRotationAxis(axis, XM_PI);
|
||||
XMStoreFloat4(&result, Q);
|
||||
}
|
||||
else
|
||||
{
|
||||
const XMVECTOR C = XMVector3Cross(F, T);
|
||||
XMStoreFloat4(&result, C);
|
||||
|
||||
const float s = sqrtf((1.f + dot) * 2.f);
|
||||
result.x /= s;
|
||||
result.y /= s;
|
||||
result.z /= s;
|
||||
result.w = s * 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
void Quaternion::LookRotation(const Vector3& forward, const Vector3& up, Quaternion& result) noexcept
|
||||
{
|
||||
Quaternion q1;
|
||||
FromToRotation(Vector3::Forward, forward, q1);
|
||||
|
||||
const XMVECTOR C = XMVector3Cross(forward, up);
|
||||
if (XMVector3NearEqual(XMVector3LengthSq(C), g_XMZero, g_XMEpsilon))
|
||||
{
|
||||
// forward and up are co-linear
|
||||
result = q1;
|
||||
return;
|
||||
}
|
||||
|
||||
const XMVECTOR U = XMQuaternionMultiply(q1, Vector3::Up);
|
||||
|
||||
Quaternion q2;
|
||||
FromToRotation(U, up, q2);
|
||||
|
||||
XMStoreFloat4(&result, XMQuaternionMultiply(q2, q1));
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Viewport
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(__d3d11_h__) || defined(__d3d11_x_h__)
|
||||
static_assert(sizeof(DirectX::SimpleMath::Viewport) == sizeof(D3D11_VIEWPORT), "Size mismatch");
|
||||
static_assert(offsetof(DirectX::SimpleMath::Viewport, x) == offsetof(D3D11_VIEWPORT, TopLeftX), "Layout mismatch");
|
||||
static_assert(offsetof(DirectX::SimpleMath::Viewport, y) == offsetof(D3D11_VIEWPORT, TopLeftY), "Layout mismatch");
|
||||
static_assert(offsetof(DirectX::SimpleMath::Viewport, width) == offsetof(D3D11_VIEWPORT, Width), "Layout mismatch");
|
||||
static_assert(offsetof(DirectX::SimpleMath::Viewport, height) == offsetof(D3D11_VIEWPORT, Height), "Layout mismatch");
|
||||
static_assert(offsetof(DirectX::SimpleMath::Viewport, minDepth) == offsetof(D3D11_VIEWPORT, MinDepth), "Layout mismatch");
|
||||
static_assert(offsetof(DirectX::SimpleMath::Viewport, maxDepth) == offsetof(D3D11_VIEWPORT, MaxDepth), "Layout mismatch");
|
||||
#endif
|
||||
|
||||
#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
|
||||
static_assert(sizeof(DirectX::SimpleMath::Viewport) == sizeof(D3D12_VIEWPORT), "Size mismatch");
|
||||
static_assert(offsetof(DirectX::SimpleMath::Viewport, x) == offsetof(D3D12_VIEWPORT, TopLeftX), "Layout mismatch");
|
||||
static_assert(offsetof(DirectX::SimpleMath::Viewport, y) == offsetof(D3D12_VIEWPORT, TopLeftY), "Layout mismatch");
|
||||
static_assert(offsetof(DirectX::SimpleMath::Viewport, width) == offsetof(D3D12_VIEWPORT, Width), "Layout mismatch");
|
||||
static_assert(offsetof(DirectX::SimpleMath::Viewport, height) == offsetof(D3D12_VIEWPORT, Height), "Layout mismatch");
|
||||
static_assert(offsetof(DirectX::SimpleMath::Viewport, minDepth) == offsetof(D3D12_VIEWPORT, MinDepth), "Layout mismatch");
|
||||
static_assert(offsetof(DirectX::SimpleMath::Viewport, maxDepth) == offsetof(D3D12_VIEWPORT, MaxDepth), "Layout mismatch");
|
||||
#endif
|
||||
|
||||
#if defined(__dxgi1_2_h__) || defined(__d3d11_x_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
|
||||
RECT Viewport::ComputeDisplayArea(DXGI_SCALING scaling, UINT backBufferWidth, UINT backBufferHeight, int outputWidth, int outputHeight) noexcept
|
||||
{
|
||||
RECT rct = {};
|
||||
|
||||
switch (int(scaling))
|
||||
{
|
||||
case DXGI_SCALING_STRETCH:
|
||||
// Output fills the entire window area
|
||||
rct.top = 0;
|
||||
rct.left = 0;
|
||||
rct.right = outputWidth;
|
||||
rct.bottom = outputHeight;
|
||||
break;
|
||||
|
||||
case 2 /*DXGI_SCALING_ASPECT_RATIO_STRETCH*/:
|
||||
// Output fills the window area but respects the original aspect ratio, using pillar boxing or letter boxing as required
|
||||
// Note: This scaling option is not supported for legacy Win32 windows swap chains
|
||||
{
|
||||
assert(backBufferHeight > 0);
|
||||
const float aspectRatio = float(backBufferWidth) / float(backBufferHeight);
|
||||
|
||||
// Horizontal fill
|
||||
float scaledWidth = float(outputWidth);
|
||||
float scaledHeight = float(outputWidth) / aspectRatio;
|
||||
if (scaledHeight >= float(outputHeight))
|
||||
{
|
||||
// Do vertical fill
|
||||
scaledWidth = float(outputHeight) * aspectRatio;
|
||||
scaledHeight = float(outputHeight);
|
||||
}
|
||||
|
||||
const float offsetX = (float(outputWidth) - scaledWidth) * 0.5f;
|
||||
const float offsetY = (float(outputHeight) - scaledHeight) * 0.5f;
|
||||
|
||||
rct.left = static_cast<LONG>(offsetX);
|
||||
rct.top = static_cast<LONG>(offsetY);
|
||||
rct.right = static_cast<LONG>(offsetX + scaledWidth);
|
||||
rct.bottom = static_cast<LONG>(offsetY + scaledHeight);
|
||||
|
||||
// Clip to display window
|
||||
rct.left = std::max<LONG>(0, rct.left);
|
||||
rct.top = std::max<LONG>(0, rct.top);
|
||||
rct.right = std::min<LONG>(outputWidth, rct.right);
|
||||
rct.bottom = std::min<LONG>(outputHeight, rct.bottom);
|
||||
}
|
||||
break;
|
||||
|
||||
case DXGI_SCALING_NONE:
|
||||
default:
|
||||
// Output is displayed in the upper left corner of the window area
|
||||
rct.top = 0;
|
||||
rct.left = 0;
|
||||
rct.right = std::min<LONG>(static_cast<LONG>(backBufferWidth), outputWidth);
|
||||
rct.bottom = std::min<LONG>(static_cast<LONG>(backBufferHeight), outputHeight);
|
||||
break;
|
||||
}
|
||||
|
||||
return rct;
|
||||
}
|
||||
#endif
|
||||
|
||||
RECT Viewport::ComputeTitleSafeArea(UINT backBufferWidth, UINT backBufferHeight) noexcept
|
||||
{
|
||||
const float safew = (float(backBufferWidth) + 19.f) / 20.f;
|
||||
const float safeh = (float(backBufferHeight) + 19.f) / 20.f;
|
||||
|
||||
RECT rct;
|
||||
rct.left = static_cast<LONG>(safew);
|
||||
rct.top = static_cast<LONG>(safeh);
|
||||
rct.right = static_cast<LONG>(float(backBufferWidth) - safew + 0.5f);
|
||||
rct.bottom = static_cast<LONG>(float(backBufferHeight) - safeh + 0.5f);
|
||||
|
||||
return rct;
|
||||
}
|
||||
1294
enginecustom/include/Src/WICTextureLoader.cpp
Normal file
10
enginecustom/include/Src/pch.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: pch.cpp
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#include "pch.h"
|
||||
193
enginecustom/include/Src/pch.h
Normal file
@@ -0,0 +1,193 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: pch.h
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Off by default warnings
|
||||
#pragma warning(disable : 4619 4616 4061 4265 4365 4571 4623 4625 4626 4628 4668 4710 4711 4746 4774 4820 4987 5026 5027 5031 5032 5039 5045 5219 5264 26812)
|
||||
// C4619/4616 #pragma warning warnings
|
||||
// C4061 enumerator 'X' in switch of enum 'X' is not explicitly handled by a case label
|
||||
// C4265 class has virtual functions, but destructor is not virtual
|
||||
// C4365 signed/unsigned mismatch
|
||||
// C4571 behavior change
|
||||
// C4623 default constructor was implicitly defined as deleted
|
||||
// C4625 copy constructor was implicitly defined as deleted
|
||||
// C4626 assignment operator was implicitly defined as deleted
|
||||
// C4628 digraphs not supported
|
||||
// C4668 not defined as a preprocessor macro
|
||||
// C4710 function not inlined
|
||||
// C4711 selected for automatic inline expansion
|
||||
// C4746 volatile access of '<expression>' is subject to /volatile:<iso|ms> setting
|
||||
// C4774 format string expected in argument 3 is not a string literal
|
||||
// C4820 padding added after data member
|
||||
// C4987 nonstandard extension used
|
||||
// C5026 move constructor was implicitly defined as deleted
|
||||
// C5027 move assignment operator was implicitly defined as deleted
|
||||
// C5031/5032 push/pop mismatches in windows headers
|
||||
// C5039 pointer or reference to potentially throwing function passed to extern C function under - EHc
|
||||
// C5045 Spectre mitigation warning
|
||||
// C5219 implicit conversion from 'int' to 'float', possible loss of data
|
||||
// C5264 'const' variable is not used
|
||||
// 26812: The enum type 'x' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
// Xbox One XDK related Off by default warnings
|
||||
#pragma warning(disable : 4471 4643 4917 4986 5029 5038 5040 5043 5204 5246 5256 5262 5267)
|
||||
// C4471 forward declaration of an unscoped enumeration must have an underlying type
|
||||
// C4643 Forward declaring in namespace std is not permitted by the C++ Standard
|
||||
// C4917 a GUID can only be associated with a class, interface or namespace
|
||||
// C4986 exception specification does not match previous declaration
|
||||
// C5029 nonstandard extension used
|
||||
// C5038 data member 'X' will be initialized after data member 'Y'
|
||||
// C5040 dynamic exception specifications are valid only in C++14 and earlier; treating as noexcept(false)
|
||||
// C5043 exception specification does not match previous declaration
|
||||
// C5204 class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly
|
||||
// C5246 'anonymous struct or union': the initialization of a subobject should be wrapped in braces
|
||||
// C5256 a non-defining declaration of an enumeration with a fixed underlying type is only permitted as a standalone declaration
|
||||
// C5262 implicit fall-through occurs here; are you missing a break statement?
|
||||
// C5267 definition of implicit copy constructor for 'X' is deprecated because it has a user-provided assignment operator
|
||||
#endif // _XBOX_ONE && _TITLE
|
||||
#endif // _MSC_VER
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
#pragma warning(disable : 161 2960 3280)
|
||||
// warning #161: unrecognized #pragma
|
||||
// message #2960: allocation may not satisfy the type's alignment; consider using <aligned_new> header
|
||||
// message #3280: declaration hides member
|
||||
#endif
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic ignored "-Wc++98-compat"
|
||||
#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
|
||||
#pragma clang diagnostic ignored "-Wc++98-compat-local-type-template-args"
|
||||
#pragma clang diagnostic ignored "-Wcovered-switch-default"
|
||||
#pragma clang diagnostic ignored "-Wexit-time-destructors"
|
||||
#pragma clang diagnostic ignored "-Wfloat-equal"
|
||||
#pragma clang diagnostic ignored "-Wglobal-constructors"
|
||||
#pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||
#pragma clang diagnostic ignored "-Wlanguage-extension-token"
|
||||
#pragma clang diagnostic ignored "-Wmissing-variable-declarations"
|
||||
#pragma clang diagnostic ignored "-Wmicrosoft-include"
|
||||
#pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||
#pragma clang diagnostic ignored "-Wreserved-id-macro"
|
||||
#pragma clang diagnostic ignored "-Wswitch-enum"
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wunused-const-variable"
|
||||
#pragma clang diagnostic ignored "-Wunused-member-function"
|
||||
#pragma clang diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
|
||||
#endif
|
||||
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4005)
|
||||
#define NOMINMAX 1
|
||||
#define NODRAWTEXT
|
||||
#define NOGDI
|
||||
#define NOBITMAP
|
||||
#define NOMCX
|
||||
#define NOSERVICE
|
||||
#define NOHELP
|
||||
#pragma warning(pop)
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
#ifndef _WIN32_WINNT_WIN10
|
||||
#define _WIN32_WINNT_WIN10 0x0A00
|
||||
#endif
|
||||
|
||||
#ifndef WINAPI_FAMILY_GAMES
|
||||
#define WINAPI_FAMILY_GAMES 6
|
||||
#endif
|
||||
|
||||
#ifdef _GAMING_XBOX
|
||||
#error This version of DirectX Tool Kit not supported for GDKX
|
||||
#elif defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <xdk.h>
|
||||
|
||||
#if _XDK_VER < 0x42EE13B6 /* XDK Edition 180704 */
|
||||
#error DirectX Tool Kit for Direct3D 11 requires the July 2018 QFE4 XDK or later
|
||||
#endif
|
||||
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <cwchar>
|
||||
#include <exception>
|
||||
#include <iterator>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <new>
|
||||
#include <set>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <system_error>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4702)
|
||||
#include <functional>
|
||||
#pragma warning(pop)
|
||||
|
||||
#include <malloc.h>
|
||||
|
||||
#define _XM_NO_XMVECTOR_OVERLOADS_
|
||||
|
||||
#include <DirectXMath.h>
|
||||
#include <DirectXPackedVector.h>
|
||||
#include <DirectXCollision.h>
|
||||
|
||||
#if (DIRECTX_MATH_VERSION < 315)
|
||||
#define XM_ALIGNED_STRUCT(x) __declspec(align(x)) struct
|
||||
#endif
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4467 4986 5038 5204 5220 6101)
|
||||
#ifdef __MINGW32__
|
||||
#include <wrl/client.h>
|
||||
#else
|
||||
#include <wrl.h>
|
||||
#endif
|
||||
#pragma warning(pop)
|
||||
|
||||
#include <wincodec.h>
|
||||
|
||||
#if defined(NTDDI_WIN10_FE) || defined(__MINGW32__)
|
||||
#include <ocidl.h>
|
||||
#else
|
||||
#include <OCIdl.h>
|
||||
#endif
|
||||
|
||||
#if (defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)) || (defined(_XBOX_ONE) && defined(_TITLE))
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4471 5204 5256)
|
||||
#include <Windows.UI.Core.h>
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#include <mutex>
|
||||
@@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.90.4
|
||||
// dear imgui, v1.91.8 WIP
|
||||
// (tables and columns code)
|
||||
|
||||
/*
|
||||
@@ -24,8 +24,9 @@ Index of this file:
|
||||
*/
|
||||
|
||||
// Navigating this file:
|
||||
// - In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
|
||||
// - With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments.
|
||||
// - In Visual Studio: CTRL+comma ("Edit.GoToAll") can follow symbols inside comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
|
||||
// - In Visual Studio w/ Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols inside comments.
|
||||
// - In VS Code, CLion, etc.: CTRL+click can follow symbols inside comments.
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// [SECTION] Commentary
|
||||
@@ -227,9 +228,15 @@ Index of this file:
|
||||
#pragma clang diagnostic ignored "-Wenum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_')
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion"// warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
|
||||
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
|
||||
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access
|
||||
#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
|
||||
#pragma GCC diagnostic ignored "-Wfloat-equal" // warning: comparing floating-point with '==' or '!=' is unsafe
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked
|
||||
#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
|
||||
#pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argument of type 'int'/'void*', but argument X has type 'unsigned int'/'ImGuiWindow*'
|
||||
#pragma GCC diagnostic ignored "-Wstrict-overflow"
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
||||
#endif
|
||||
|
||||
@@ -318,14 +325,21 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
IM_ASSERT(inner_width >= 0.0f);
|
||||
|
||||
// If an outer size is specified ahead we will be able to early out when not visible. Exact clipping criteria may evolve.
|
||||
// FIXME: coarse clipping because access to table data causes two issues:
|
||||
// - instance numbers varying/unstable. may not be a direct problem for users, but could make outside access broken or confusing, e.g. TestEngine.
|
||||
// - can't implement support for ImGuiChildFlags_ResizeY as we need to somehow pull the height data from somewhere. this also needs stable instance numbers.
|
||||
// The side-effects of accessing table data on coarse clip would be:
|
||||
// - always reserving the pooled ImGuiTable data ahead for a fully clipped table (minor IMHO). Also the 'outer_window_is_measuring_size' criteria may already be defeating this in some situations.
|
||||
// - always performing the GetOrAddByKey() O(log N) query in g.Tables.Map[].
|
||||
const bool use_child_window = (flags & (ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY)) != 0;
|
||||
const ImVec2 avail_size = GetContentRegionAvail();
|
||||
const ImVec2 actual_outer_size = CalcItemSize(outer_size, ImMax(avail_size.x, 1.0f), use_child_window ? ImMax(avail_size.y, 1.0f) : 0.0f);
|
||||
const ImVec2 actual_outer_size = ImTrunc(CalcItemSize(outer_size, ImMax(avail_size.x, 1.0f), use_child_window ? ImMax(avail_size.y, 1.0f) : 0.0f));
|
||||
const ImRect outer_rect(outer_window->DC.CursorPos, outer_window->DC.CursorPos + actual_outer_size);
|
||||
const bool outer_window_is_measuring_size = (outer_window->AutoFitFramesX > 0) || (outer_window->AutoFitFramesY > 0); // Doesn't apply to AlwaysAutoResize windows!
|
||||
if (use_child_window && IsClippedEx(outer_rect, 0) && !outer_window_is_measuring_size)
|
||||
{
|
||||
ItemSize(outer_rect);
|
||||
ItemAdd(outer_rect, id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -335,7 +349,6 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
|
||||
// Acquire storage for the table
|
||||
ImGuiTable* table = g.Tables.GetOrAddByKey(id);
|
||||
const ImGuiTableFlags table_last_flags = table->Flags;
|
||||
|
||||
// Acquire temporary buffers
|
||||
const int table_idx = g.Tables.GetIndex(table);
|
||||
@@ -353,6 +366,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
// Initialize
|
||||
const int previous_frame_active = table->LastFrameActive;
|
||||
const int instance_no = (previous_frame_active != g.FrameCount) ? 0 : table->InstanceCurrent + 1;
|
||||
const ImGuiTableFlags previous_flags = table->Flags;
|
||||
table->ID = id;
|
||||
table->Flags = flags;
|
||||
table->LastFrameActive = g.FrameCount;
|
||||
@@ -399,12 +413,13 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
SetNextWindowContentSize(ImVec2(override_content_size.x != FLT_MAX ? override_content_size.x : 0.0f, override_content_size.y != FLT_MAX ? override_content_size.y : 0.0f));
|
||||
|
||||
// Reset scroll if we are reactivating it
|
||||
if ((table_last_flags & (ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY)) == 0)
|
||||
SetNextWindowScroll(ImVec2(0.0f, 0.0f));
|
||||
if ((previous_flags & (ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY)) == 0)
|
||||
if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasScroll) == 0)
|
||||
SetNextWindowScroll(ImVec2(0.0f, 0.0f));
|
||||
|
||||
// Create scrolling region (without border and zero window padding)
|
||||
ImGuiWindowFlags child_flags = (flags & ImGuiTableFlags_ScrollX) ? ImGuiWindowFlags_HorizontalScrollbar : ImGuiWindowFlags_None;
|
||||
BeginChildEx(name, instance_id, outer_rect.GetSize(), false, child_flags);
|
||||
ImGuiWindowFlags child_window_flags = (flags & ImGuiTableFlags_ScrollX) ? ImGuiWindowFlags_HorizontalScrollbar : ImGuiWindowFlags_None;
|
||||
BeginChildEx(name, instance_id, outer_rect.GetSize(), ImGuiChildFlags_None, child_window_flags);
|
||||
table->InnerWindow = g.CurrentWindow;
|
||||
table->WorkRect = table->InnerWindow->WorkRect;
|
||||
table->OuterRect = table->InnerWindow->Rect();
|
||||
@@ -428,6 +443,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
// For non-scrolling tables, WorkRect == OuterRect == InnerRect.
|
||||
// But at this point we do NOT have a correct value for .Max.y (unless a height has been explicitly passed in). It will only be updated in EndTable().
|
||||
table->WorkRect = table->OuterRect = table->InnerRect = outer_rect;
|
||||
table->HasScrollbarYPrev = table->HasScrollbarYCurr = false;
|
||||
}
|
||||
|
||||
// Push a standardized ID for both child-using and not-child-using tables
|
||||
@@ -450,16 +466,27 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
temp_data->HostBackupItemWidthStackSize = outer_window->DC.ItemWidthStack.Size;
|
||||
inner_window->DC.PrevLineSize = inner_window->DC.CurrLineSize = ImVec2(0.0f, 0.0f);
|
||||
|
||||
// Make left and top borders not overlap our contents by offsetting HostClipRect (#6765)
|
||||
// Make borders not overlap our contents by offsetting HostClipRect (#6765, #7428, #3752)
|
||||
// (we normally shouldn't alter HostClipRect as we rely on TableMergeDrawChannels() expanding non-clipped column toward the
|
||||
// limits of that rectangle, in order for ImDrawListSplitter::Merge() to merge the draw commands. However since the overlap
|
||||
// problem only affect scrolling tables in this case we can get away with doing it without extra cost).
|
||||
if (inner_window != outer_window)
|
||||
{
|
||||
// FIXME: Because inner_window's Scrollbar doesn't know about border size, since it's not encoded in window->WindowBorderSize,
|
||||
// it already overlaps it and doesn't need an extra offset. Ideally we should be able to pass custom border size with
|
||||
// different x/y values to BeginChild().
|
||||
if (flags & ImGuiTableFlags_BordersOuterV)
|
||||
{
|
||||
table->HostClipRect.Min.x = ImMin(table->HostClipRect.Min.x + TABLE_BORDER_SIZE, table->HostClipRect.Max.x);
|
||||
if (inner_window->DecoOuterSizeX2 == 0.0f)
|
||||
table->HostClipRect.Max.x = ImMax(table->HostClipRect.Max.x - TABLE_BORDER_SIZE, table->HostClipRect.Min.x);
|
||||
}
|
||||
if (flags & ImGuiTableFlags_BordersOuterH)
|
||||
{
|
||||
table->HostClipRect.Min.y = ImMin(table->HostClipRect.Min.y + TABLE_BORDER_SIZE, table->HostClipRect.Max.y);
|
||||
if (inner_window->DecoOuterSizeY2 == 0.0f)
|
||||
table->HostClipRect.Max.y = ImMax(table->HostClipRect.Max.y - TABLE_BORDER_SIZE, table->HostClipRect.Min.y);
|
||||
}
|
||||
}
|
||||
|
||||
// Padding and Spacing
|
||||
@@ -487,7 +514,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
table->InnerClipRect = (inner_window == outer_window) ? table->WorkRect : inner_window->ClipRect;
|
||||
table->InnerClipRect.ClipWith(table->WorkRect); // We need this to honor inner_width
|
||||
table->InnerClipRect.ClipWithFull(table->HostClipRect);
|
||||
table->InnerClipRect.Max.y = (flags & ImGuiTableFlags_NoHostExtendY) ? ImMin(table->InnerClipRect.Max.y, inner_window->WorkRect.Max.y) : inner_window->ClipRect.Max.y;
|
||||
table->InnerClipRect.Max.y = (flags & ImGuiTableFlags_NoHostExtendY) ? ImMin(table->InnerClipRect.Max.y, inner_window->WorkRect.Max.y) : table->HostClipRect.Max.y;
|
||||
|
||||
table->RowPosY1 = table->RowPosY2 = table->WorkRect.Min.y; // This is needed somehow
|
||||
table->RowTextBaseline = 0.0f; // This will be cleared again by TableBeginRow()
|
||||
@@ -498,6 +525,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
table->DeclColumnsCount = table->AngledHeadersCount = 0;
|
||||
if (previous_frame_active + 1 < g.FrameCount)
|
||||
table->IsActiveIdInTable = false;
|
||||
table->AngledHeadersHeight = 0.0f;
|
||||
temp_data->AngledHeadersExtraWidth = 0.0f;
|
||||
|
||||
// Using opaque colors facilitate overlapping lines of the grid, otherwise we'd need to improve TableDrawBorders()
|
||||
@@ -511,7 +539,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
if (inner_window != outer_window) // So EndChild() within the inner window can restore the table properly.
|
||||
inner_window->DC.CurrentTableIdx = table_idx;
|
||||
|
||||
if ((table_last_flags & ImGuiTableFlags_Reorderable) && (flags & ImGuiTableFlags_Reorderable) == 0)
|
||||
if ((previous_flags & ImGuiTableFlags_Reorderable) && (flags & ImGuiTableFlags_Reorderable) == 0)
|
||||
table->IsResetDisplayOrderRequest = true;
|
||||
|
||||
// Mark as used to avoid GC
|
||||
@@ -844,7 +872,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
|
||||
// Calculate ideal/auto column width (that's the width required for all contents to be visible without clipping)
|
||||
// Combine width from regular rows + width from headers unless requested not to.
|
||||
if (!column->IsPreserveWidthAuto)
|
||||
if (!column->IsPreserveWidthAuto && table->InstanceCurrent == 0)
|
||||
column->WidthAuto = TableGetColumnWidthAuto(table, column);
|
||||
|
||||
// Non-resizable columns keep their requested width (apply user value regardless of IsPreserveWidthAuto)
|
||||
@@ -1048,16 +1076,12 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
continue;
|
||||
}
|
||||
|
||||
// Detect hovered column
|
||||
if (is_hovering_table && mouse_skewed_x >= column->ClipRect.Min.x && mouse_skewed_x < column->ClipRect.Max.x)
|
||||
table->HoveredColumnBody = (ImGuiTableColumnIdx)column_n;
|
||||
|
||||
// Lock start position
|
||||
column->MinX = offset_x;
|
||||
|
||||
// Lock width based on start position and minimum/maximum width for this position
|
||||
float max_width = TableGetMaxColumnWidth(table, column_n);
|
||||
column->WidthGiven = ImMin(column->WidthGiven, max_width);
|
||||
column->WidthMax = TableCalcMaxColumnWidth(table, column_n);
|
||||
column->WidthGiven = ImMin(column->WidthGiven, column->WidthMax);
|
||||
column->WidthGiven = ImMax(column->WidthGiven, ImMin(column->WidthRequest, table->MinColumnWidth));
|
||||
column->MaxX = offset_x + column->WidthGiven + table->CellSpacingX1 + table->CellSpacingX2 + table->CellPaddingX * 2.0f;
|
||||
|
||||
@@ -1066,6 +1090,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
// - ClipRect.Max.x: using WorkMaxX instead of MaxX (aka including padding) makes things more consistent when resizing down, tho slightly detrimental to visibility in very-small column.
|
||||
// - ClipRect.Max.x: using MaxX makes it easier for header to receive hover highlight with no discontinuity and display sorting arrow.
|
||||
// - FIXME-TABLE: We want equal width columns to have equal (ClipRect.Max.x - WorkMinX) width, which means ClipRect.max.x cannot stray off host_clip_rect.Max.x else right-most column may appear shorter.
|
||||
const float previous_instance_work_min_x = column->WorkMinX;
|
||||
column->WorkMinX = column->MinX + table->CellPaddingX + table->CellSpacingX1;
|
||||
column->WorkMaxX = column->MaxX - table->CellPaddingX - table->CellSpacingX2; // Expected max
|
||||
column->ItemWidth = ImTrunc(column->WidthGiven * 0.65f);
|
||||
@@ -1105,8 +1130,13 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
column->Flags |= ImGuiTableColumnFlags_IsVisible;
|
||||
if (column->SortOrder != -1)
|
||||
column->Flags |= ImGuiTableColumnFlags_IsSorted;
|
||||
if (table->HoveredColumnBody == column_n)
|
||||
|
||||
// Detect hovered column
|
||||
if (is_hovering_table && mouse_skewed_x >= column->ClipRect.Min.x && mouse_skewed_x < column->ClipRect.Max.x)
|
||||
{
|
||||
column->Flags |= ImGuiTableColumnFlags_IsHovered;
|
||||
table->HoveredColumnBody = (ImGuiTableColumnIdx)column_n;
|
||||
}
|
||||
|
||||
// Alignment
|
||||
// FIXME-TABLE: This align based on the whole column width, not per-cell, and therefore isn't useful in
|
||||
@@ -1118,11 +1148,25 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
// column->WorkMinX = ImLerp(column->WorkMinX, ImMax(column->StartX, column->MaxX - column->ContentWidthRowsUnfrozen), 0.5f);
|
||||
|
||||
// Reset content width variables
|
||||
column->ContentMaxXFrozen = column->ContentMaxXUnfrozen = column->WorkMinX;
|
||||
column->ContentMaxXHeadersUsed = column->ContentMaxXHeadersIdeal = column->WorkMinX;
|
||||
if (table->InstanceCurrent == 0)
|
||||
{
|
||||
column->ContentMaxXFrozen = column->WorkMinX;
|
||||
column->ContentMaxXUnfrozen = column->WorkMinX;
|
||||
column->ContentMaxXHeadersUsed = column->WorkMinX;
|
||||
column->ContentMaxXHeadersIdeal = column->WorkMinX;
|
||||
}
|
||||
else
|
||||
{
|
||||
// As we store an absolute value to make per-cell updates faster, we need to offset values used for width computation.
|
||||
const float offset_from_previous_instance = column->WorkMinX - previous_instance_work_min_x;
|
||||
column->ContentMaxXFrozen += offset_from_previous_instance;
|
||||
column->ContentMaxXUnfrozen += offset_from_previous_instance;
|
||||
column->ContentMaxXHeadersUsed += offset_from_previous_instance;
|
||||
column->ContentMaxXHeadersIdeal += offset_from_previous_instance;
|
||||
}
|
||||
|
||||
// Don't decrement auto-fit counters until container window got a chance to submit its items
|
||||
if (table->HostSkipItems == false)
|
||||
if (table->HostSkipItems == false && table->InstanceCurrent == 0)
|
||||
{
|
||||
column->AutoFitQueue >>= 1;
|
||||
column->CannotSkipItemsQueue >>= 1;
|
||||
@@ -1223,7 +1267,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
if (table->Flags & ImGuiTableFlags_NoClip)
|
||||
table->DrawSplitter->SetCurrentChannel(inner_window->DrawList, TABLE_DRAW_CHANNEL_NOCLIP);
|
||||
else
|
||||
inner_window->DrawList->PushClipRect(inner_window->ClipRect.Min, inner_window->ClipRect.Max, false);
|
||||
inner_window->DrawList->PushClipRect(inner_window->InnerClipRect.Min, inner_window->InnerClipRect.Max, false); // FIXME: use table->InnerClipRect?
|
||||
}
|
||||
|
||||
// Process hit-testing on resizing borders. Actual size change will be applied in EndTable()
|
||||
@@ -1238,9 +1282,9 @@ void ImGui::TableUpdateBorders(ImGuiTable* table)
|
||||
// really problematic (whereas the actual visual will be displayed in EndTable() and using the current frame height).
|
||||
// Actual columns highlight/render will be performed in EndTable() and not be affected.
|
||||
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
|
||||
const float hit_half_width = TABLE_RESIZE_SEPARATOR_HALF_THICKNESS;
|
||||
const float hit_half_width = ImTrunc(TABLE_RESIZE_SEPARATOR_HALF_THICKNESS * g.CurrentDpiScale);
|
||||
const float hit_y1 = (table->FreezeRowsCount >= 1 ? table->OuterRect.Min.y : table->WorkRect.Min.y) + table->AngledHeadersHeight;
|
||||
const float hit_y2_body = ImMax(table->OuterRect.Max.y, hit_y1 + table_instance->LastOuterHeight);
|
||||
const float hit_y2_body = ImMax(table->OuterRect.Max.y, hit_y1 + table_instance->LastOuterHeight - table->AngledHeadersHeight);
|
||||
const float hit_y2_head = hit_y1 + table_instance->LastTopHeadersRowHeight;
|
||||
|
||||
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
||||
@@ -1293,7 +1337,11 @@ void ImGui::EndTable()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiTable* table = g.CurrentTable;
|
||||
IM_ASSERT(table != NULL && "Only call EndTable() if BeginTable() returns true!");
|
||||
if (table == NULL)
|
||||
{
|
||||
IM_ASSERT_USER_ERROR(table != NULL, "EndTable() call should only be done while in BeginTable() scope!");
|
||||
return;
|
||||
}
|
||||
|
||||
// This assert would be very useful to catch a common error... unfortunately it would probably trigger in some
|
||||
// cases, and for consistency user may sometimes output empty tables (and still benefit from e.g. outer border)
|
||||
@@ -1415,7 +1463,7 @@ void ImGui::EndTable()
|
||||
if (table->ResizedColumn != -1 && table->InstanceCurrent == table->InstanceInteracted)
|
||||
{
|
||||
ImGuiTableColumn* column = &table->Columns[table->ResizedColumn];
|
||||
const float new_x2 = (g.IO.MousePos.x - g.ActiveIdClickOffset.x + TABLE_RESIZE_SEPARATOR_HALF_THICKNESS);
|
||||
const float new_x2 = (g.IO.MousePos.x - g.ActiveIdClickOffset.x + ImTrunc(TABLE_RESIZE_SEPARATOR_HALF_THICKNESS * g.CurrentDpiScale));
|
||||
const float new_width = ImTrunc(new_x2 - column->MinX - table->CellSpacingX1 - table->CellPaddingX * 2.0f);
|
||||
table->ResizedColumnNextWidth = new_width;
|
||||
}
|
||||
@@ -1444,7 +1492,12 @@ void ImGui::EndTable()
|
||||
// CursorPosPrevLine and CursorMaxPos manually. That should be a more general layout feature, see same problem e.g. #3414)
|
||||
if (inner_window != outer_window)
|
||||
{
|
||||
short backup_nav_layers_active_mask = inner_window->DC.NavLayersActiveMask;
|
||||
inner_window->DC.NavLayersActiveMask |= 1 << ImGuiNavLayer_Main; // So empty table don't appear to navigate differently.
|
||||
g.CurrentTable = NULL; // To avoid error recovery recursing
|
||||
EndChild();
|
||||
g.CurrentTable = table;
|
||||
inner_window->DC.NavLayersActiveMask = backup_nav_layers_active_mask;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1462,9 +1515,13 @@ void ImGui::EndTable()
|
||||
}
|
||||
else if (temp_data->UserOuterSize.x <= 0.0f)
|
||||
{
|
||||
const float decoration_size = table->TempData->AngledHeadersExtraWidth + ((table->Flags & ImGuiTableFlags_ScrollX) ? inner_window->ScrollbarSizes.x : 0.0f);
|
||||
outer_window->DC.IdealMaxPos.x = ImMax(outer_window->DC.IdealMaxPos.x, table->OuterRect.Min.x + table->ColumnsAutoFitWidth + decoration_size - temp_data->UserOuterSize.x);
|
||||
outer_window->DC.CursorMaxPos.x = ImMax(backup_outer_max_pos.x, ImMin(table->OuterRect.Max.x, table->OuterRect.Min.x + table->ColumnsAutoFitWidth));
|
||||
// Some references for this: #7651 + tests "table_reported_size", "table_reported_size_outer" equivalent Y block
|
||||
// - Checking for ImGuiTableFlags_ScrollX/ScrollY flag makes us a frame ahead when disabling those flags.
|
||||
// - FIXME-TABLE: Would make sense to pre-compute expected scrollbar visibility/sizes to generally save a frame of feedback.
|
||||
const float inner_content_max_x = table->OuterRect.Min.x + table->ColumnsAutoFitWidth; // Slightly misleading name but used for code symmetry with inner_content_max_y
|
||||
const float decoration_size = table->TempData->AngledHeadersExtraWidth + ((table->Flags & ImGuiTableFlags_ScrollY) ? inner_window->ScrollbarSizes.x : 0.0f);
|
||||
outer_window->DC.IdealMaxPos.x = ImMax(outer_window->DC.IdealMaxPos.x, inner_content_max_x + decoration_size - temp_data->UserOuterSize.x);
|
||||
outer_window->DC.CursorMaxPos.x = ImMax(backup_outer_max_pos.x, ImMin(table->OuterRect.Max.x, inner_content_max_x + decoration_size));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1472,9 +1529,9 @@ void ImGui::EndTable()
|
||||
}
|
||||
if (temp_data->UserOuterSize.y <= 0.0f)
|
||||
{
|
||||
const float decoration_size = (table->Flags & ImGuiTableFlags_ScrollY) ? inner_window->ScrollbarSizes.y : 0.0f;
|
||||
const float decoration_size = (table->Flags & ImGuiTableFlags_ScrollX) ? inner_window->ScrollbarSizes.y : 0.0f;
|
||||
outer_window->DC.IdealMaxPos.y = ImMax(outer_window->DC.IdealMaxPos.y, inner_content_max_y + decoration_size - temp_data->UserOuterSize.y);
|
||||
outer_window->DC.CursorMaxPos.y = ImMax(backup_outer_max_pos.y, ImMin(table->OuterRect.Max.y, inner_content_max_y));
|
||||
outer_window->DC.CursorMaxPos.y = ImMax(backup_outer_max_pos.y, ImMin(table->OuterRect.Max.y, inner_content_max_y + decoration_size));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1507,8 +1564,12 @@ void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, flo
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiTable* table = g.CurrentTable;
|
||||
IM_ASSERT(table != NULL && "Need to call TableSetupColumn() after BeginTable()!");
|
||||
IM_ASSERT(table->IsLayoutLocked == false && "Need to call call TableSetupColumn() before first row!");
|
||||
if (table == NULL)
|
||||
{
|
||||
IM_ASSERT_USER_ERROR(table != NULL, "Call should only be done while in BeginTable() scope!");
|
||||
return;
|
||||
}
|
||||
IM_ASSERT(table->IsLayoutLocked == false && "Need to call TableSetupColumn() before first row!");
|
||||
IM_ASSERT((flags & ImGuiTableColumnFlags_StatusMask_) == 0 && "Illegal to pass StatusMask values to TableSetupColumn()");
|
||||
if (table->DeclColumnsCount >= table->ColumnsCount)
|
||||
{
|
||||
@@ -1581,7 +1642,11 @@ void ImGui::TableSetupScrollFreeze(int columns, int rows)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiTable* table = g.CurrentTable;
|
||||
IM_ASSERT(table != NULL && "Need to call TableSetupColumn() after BeginTable()!");
|
||||
if (table == NULL)
|
||||
{
|
||||
IM_ASSERT_USER_ERROR(table != NULL, "Call should only be done while in BeginTable() scope!");
|
||||
return;
|
||||
}
|
||||
IM_ASSERT(table->IsLayoutLocked == false && "Need to call TableSetupColumn() before first row!");
|
||||
IM_ASSERT(columns >= 0 && columns < IMGUI_TABLE_MAX_COLUMNS);
|
||||
IM_ASSERT(rows >= 0 && rows < 128); // Arbitrary limit
|
||||
@@ -1658,9 +1723,11 @@ void ImGui::TableSetColumnEnabled(int column_n, bool enabled)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiTable* table = g.CurrentTable;
|
||||
IM_ASSERT(table != NULL);
|
||||
if (!table)
|
||||
if (table == NULL)
|
||||
{
|
||||
IM_ASSERT_USER_ERROR(table != NULL, "Call should only be done while in BeginTable() scope!");
|
||||
return;
|
||||
}
|
||||
IM_ASSERT(table->Flags & ImGuiTableFlags_Hideable); // See comments above
|
||||
if (column_n < 0)
|
||||
column_n = table->CurrentColumn;
|
||||
@@ -1890,7 +1957,7 @@ void ImGui::TableEndRow(ImGuiTable* table)
|
||||
if (is_visible)
|
||||
{
|
||||
// Update data for TableGetHoveredRow()
|
||||
if (table->HoveredColumnBody != -1 && g.IO.MousePos.y >= bg_y1 && g.IO.MousePos.y < bg_y2)
|
||||
if (table->HoveredColumnBody != -1 && g.IO.MousePos.y >= bg_y1 && g.IO.MousePos.y < bg_y2 && table_instance->HoveredRowNext < 0)
|
||||
table_instance->HoveredRowNext = table->CurrentRow;
|
||||
|
||||
// Decide of background color for the row
|
||||
@@ -1945,7 +2012,8 @@ void ImGui::TableEndRow(ImGuiTable* table)
|
||||
cell_bg_rect.ClipWith(table->BgClipRect);
|
||||
cell_bg_rect.Min.x = ImMax(cell_bg_rect.Min.x, column->ClipRect.Min.x); // So that first column after frozen one gets clipped when scrolling
|
||||
cell_bg_rect.Max.x = ImMin(cell_bg_rect.Max.x, column->MaxX);
|
||||
window->DrawList->AddRectFilled(cell_bg_rect.Min, cell_bg_rect.Max, cell_data->BgColor);
|
||||
if (cell_bg_rect.Min.y < cell_bg_rect.Max.y)
|
||||
window->DrawList->AddRectFilled(cell_bg_rect.Min, cell_bg_rect.Max, cell_data->BgColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1962,34 +2030,37 @@ void ImGui::TableEndRow(ImGuiTable* table)
|
||||
// We need to do that in TableEndRow() instead of TableBeginRow() so the list clipper can mark end of row and
|
||||
// get the new cursor position.
|
||||
if (unfreeze_rows_request)
|
||||
{
|
||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||
table->Columns[column_n].NavLayerCurrent = ImGuiNavLayer_Main;
|
||||
if (unfreeze_rows_actual)
|
||||
{
|
||||
IM_ASSERT(table->IsUnfrozenRows == false);
|
||||
const float y0 = ImMax(table->RowPosY2 + 1, window->InnerClipRect.Min.y);
|
||||
table->IsUnfrozenRows = true;
|
||||
const float y0 = ImMax(table->RowPosY2 + 1, table->InnerClipRect.Min.y);
|
||||
table_instance->LastFrozenHeight = y0 - table->OuterRect.Min.y;
|
||||
|
||||
// BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect
|
||||
table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, window->InnerClipRect.Max.y);
|
||||
table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = window->InnerClipRect.Max.y;
|
||||
table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen;
|
||||
IM_ASSERT(table->Bg2ClipRectForDrawCmd.Min.y <= table->Bg2ClipRectForDrawCmd.Max.y);
|
||||
|
||||
float row_height = table->RowPosY2 - table->RowPosY1;
|
||||
table->RowPosY2 = window->DC.CursorPos.y = table->WorkRect.Min.y + table->RowPosY2 - table->OuterRect.Min.y;
|
||||
table->RowPosY1 = table->RowPosY2 - row_height;
|
||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||
if (unfreeze_rows_actual)
|
||||
{
|
||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
column->DrawChannelCurrent = column->DrawChannelUnfrozen;
|
||||
column->ClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y;
|
||||
}
|
||||
IM_ASSERT(table->IsUnfrozenRows == false);
|
||||
table->IsUnfrozenRows = true;
|
||||
|
||||
// Update cliprect ahead of TableBeginCell() so clipper can access to new ClipRect->Min.y
|
||||
SetWindowClipRectBeforeSetChannel(window, table->Columns[0].ClipRect);
|
||||
table->DrawSplitter->SetCurrentChannel(window->DrawList, table->Columns[0].DrawChannelCurrent);
|
||||
// BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect
|
||||
table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, table->InnerClipRect.Max.y);
|
||||
table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = table->InnerClipRect.Max.y;
|
||||
table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen;
|
||||
IM_ASSERT(table->Bg2ClipRectForDrawCmd.Min.y <= table->Bg2ClipRectForDrawCmd.Max.y);
|
||||
|
||||
float row_height = table->RowPosY2 - table->RowPosY1;
|
||||
table->RowPosY2 = window->DC.CursorPos.y = table->WorkRect.Min.y + table->RowPosY2 - table->OuterRect.Min.y;
|
||||
table->RowPosY1 = table->RowPosY2 - row_height;
|
||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||
{
|
||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
column->DrawChannelCurrent = column->DrawChannelUnfrozen;
|
||||
column->ClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y;
|
||||
}
|
||||
|
||||
// Update cliprect ahead of TableBeginCell() so clipper can access to new ClipRect->Min.y
|
||||
SetWindowClipRectBeforeSetChannel(window, table->Columns[0].ClipRect);
|
||||
table->DrawSplitter->SetCurrentChannel(window->DrawList, table->Columns[0].DrawChannelCurrent);
|
||||
}
|
||||
}
|
||||
|
||||
if (!(table->RowFlags & ImGuiTableRowFlags_Headers))
|
||||
@@ -2158,8 +2229,8 @@ void ImGui::TableEndCell(ImGuiTable* table)
|
||||
// Note that actual columns widths are computed in TableUpdateLayout().
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// Maximum column content width given current layout. Use column->MinX so this value on a per-column basis.
|
||||
float ImGui::TableGetMaxColumnWidth(const ImGuiTable* table, int column_n)
|
||||
// Maximum column content width given current layout. Use column->MinX so this value differs on a per-column basis.
|
||||
float ImGui::TableCalcMaxColumnWidth(const ImGuiTable* table, int column_n)
|
||||
{
|
||||
const ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
float max_width = FLT_MAX;
|
||||
@@ -2221,7 +2292,7 @@ void ImGui::TableSetColumnWidth(int column_n, float width)
|
||||
// Compare both requested and actual given width to avoid overwriting requested width when column is stuck (minimum size, bounded)
|
||||
IM_ASSERT(table->MinColumnWidth > 0.0f);
|
||||
const float min_width = table->MinColumnWidth;
|
||||
const float max_width = ImMax(min_width, TableGetMaxColumnWidth(table, column_n));
|
||||
const float max_width = ImMax(min_width, column_0->WidthMax); // Don't use TableCalcMaxColumnWidth() here as it would rely on MinX from last instance (#7933)
|
||||
column_0_width = ImClamp(column_0_width, min_width, max_width);
|
||||
if (column_0->WidthGiven == column_0_width || column_0->WidthRequest == column_0_width)
|
||||
return;
|
||||
@@ -2706,7 +2777,7 @@ void ImGui::TableDrawBorders(ImGuiTable* table)
|
||||
const ImU32 outer_col = table->BorderColorStrong;
|
||||
if ((table->Flags & ImGuiTableFlags_BordersOuter) == ImGuiTableFlags_BordersOuter)
|
||||
{
|
||||
inner_drawlist->AddRect(outer_border.Min, outer_border.Max + ImVec2(1, 1), outer_col, 0.0f, 0, border_size);
|
||||
inner_drawlist->AddRect(outer_border.Min, outer_border.Max, outer_col, 0.0f, 0, border_size);
|
||||
}
|
||||
else if (table->Flags & ImGuiTableFlags_BordersOuterV)
|
||||
{
|
||||
@@ -2766,7 +2837,7 @@ ImGuiTableSortSpecs* ImGui::TableGetSortSpecs()
|
||||
static inline ImGuiSortDirection TableGetColumnAvailSortDirection(ImGuiTableColumn* column, int n)
|
||||
{
|
||||
IM_ASSERT(n < column->SortDirectionsAvailCount);
|
||||
return (column->SortDirectionsAvailList >> (n << 1)) & 0x03;
|
||||
return (ImGuiSortDirection)((column->SortDirectionsAvailList >> (n << 1)) & 0x03);
|
||||
}
|
||||
|
||||
// Fix sort direction if currently set on a value which is unavailable (e.g. activating NoSortAscending/NoSortDescending)
|
||||
@@ -2907,6 +2978,7 @@ void ImGui::TableSortSpecsBuild(ImGuiTable* table)
|
||||
}
|
||||
|
||||
// Write output
|
||||
// May be able to move all SortSpecs data from table (48 bytes) to ImGuiTableTempData if we decide to write it back on every BeginTable()
|
||||
ImGuiTableColumnSortSpecs* sort_specs = (table->SortSpecsCount == 0) ? NULL : (table->SortSpecsCount == 1) ? &table->SortSpecsSingle : table->SortSpecsMulti.Data;
|
||||
if (dirty && sort_specs != NULL)
|
||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||
@@ -2919,7 +2991,7 @@ void ImGui::TableSortSpecsBuild(ImGuiTable* table)
|
||||
sort_spec->ColumnUserID = column->UserID;
|
||||
sort_spec->ColumnIndex = (ImGuiTableColumnIdx)column_n;
|
||||
sort_spec->SortOrder = (ImGuiTableColumnIdx)column->SortOrder;
|
||||
sort_spec->SortDirection = column->SortDirection;
|
||||
sort_spec->SortDirection = (ImGuiSortDirection)column->SortDirection;
|
||||
}
|
||||
|
||||
table->SortSpecs.Specs = sort_specs;
|
||||
@@ -2967,17 +3039,23 @@ float ImGui::TableGetHeaderAngledMaxLabelWidth()
|
||||
|
||||
// [Public] This is a helper to output TableHeader() calls based on the column names declared in TableSetupColumn().
|
||||
// The intent is that advanced users willing to create customized headers would not need to use this helper
|
||||
// and can create their own! For example: TableHeader() may be preceeded by Checkbox() or other custom widgets.
|
||||
// and can create their own! For example: TableHeader() may be preceded by Checkbox() or other custom widgets.
|
||||
// See 'Demo->Tables->Custom headers' for a demonstration of implementing a custom version of this.
|
||||
// This code is constructed to not make much use of internal functions, as it is intended to be a template to copy.
|
||||
// This code is intentionally written to not make much use of internal functions, to give you better direction
|
||||
// if you need to write your own.
|
||||
// FIXME-TABLE: TableOpenContextMenu() and TableGetHeaderRowHeight() are not public.
|
||||
void ImGui::TableHeadersRow()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiTable* table = g.CurrentTable;
|
||||
IM_ASSERT(table != NULL && "Need to call TableHeadersRow() after BeginTable()!");
|
||||
if (table == NULL)
|
||||
{
|
||||
IM_ASSERT_USER_ERROR(table != NULL, "Call should only be done while in BeginTable() scope!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Layout if not already done (this is automatically done by TableNextRow, we do it here solely to facilitate stepping in debugger as it is frequent to step in TableUpdateLayout)
|
||||
// Call layout if not already done. This is automatically done by TableNextRow: we do it here _only_ to make
|
||||
// it easier to debug-step in TableUpdateLayout(). Your own version of this function doesn't need this.
|
||||
if (!table->IsLayoutLocked)
|
||||
TableUpdateLayout(table);
|
||||
|
||||
@@ -2994,8 +3072,7 @@ void ImGui::TableHeadersRow()
|
||||
if (!TableSetColumnIndex(column_n))
|
||||
continue;
|
||||
|
||||
// Push an id to allow unnamed labels (generally accidental, but let's behave nicely with them)
|
||||
// In your own code you may omit the PushID/PopID all-together, provided you know they won't collide.
|
||||
// Push an id to allow empty/unnamed headers. This is also idiomatic as it ensure there is a consistent ID path to access columns (for e.g. automation)
|
||||
const char* name = (TableGetColumnFlags(column_n) & ImGuiTableColumnFlags_NoHeaderLabel) ? "" : TableGetColumnName(column_n);
|
||||
PushID(column_n);
|
||||
TableHeader(name);
|
||||
@@ -3020,7 +3097,12 @@ void ImGui::TableHeader(const char* label)
|
||||
return;
|
||||
|
||||
ImGuiTable* table = g.CurrentTable;
|
||||
IM_ASSERT(table != NULL && "Need to call TableHeader() after BeginTable()!");
|
||||
if (table == NULL)
|
||||
{
|
||||
IM_ASSERT_USER_ERROR(table != NULL, "Call should only be done while in BeginTable() scope!");
|
||||
return;
|
||||
}
|
||||
|
||||
IM_ASSERT(table->CurrentColumn != -1);
|
||||
const int column_n = table->CurrentColumn;
|
||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
@@ -3086,7 +3168,7 @@ void ImGui::TableHeader(const char* label)
|
||||
if ((table->RowFlags & ImGuiTableRowFlags_Headers) == 0)
|
||||
TableSetBgColor(ImGuiTableBgTarget_CellBg, GetColorU32(ImGuiCol_TableHeaderBg), table->CurrentColumn);
|
||||
}
|
||||
RenderNavHighlight(bb, id, ImGuiNavHighlightFlags_Compact | ImGuiNavHighlightFlags_NoRounding);
|
||||
RenderNavCursor(bb, id, ImGuiNavRenderCursorFlags_Compact | ImGuiNavRenderCursorFlags_NoRounding);
|
||||
if (held)
|
||||
table->HeldHeaderColumn = (ImGuiTableColumnIdx)column_n;
|
||||
window->DC.CursorPos.y -= g.Style.ItemSpacing.y * 0.5f;
|
||||
@@ -3153,21 +3235,53 @@ void ImGui::TableHeader(const char* label)
|
||||
}
|
||||
|
||||
// Unlike TableHeadersRow() it is not expected that you can reimplement or customize this with custom widgets.
|
||||
// FIXME: highlight without ImGuiTableFlags_HighlightHoveredColumn
|
||||
// FIXME: No hit-testing/button on the angled header.
|
||||
void ImGui::TableAngledHeadersRow()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
TableAngledHeadersRowEx(g.Style.TableAngledHeadersAngle, 0.0f);
|
||||
ImGuiTable* table = g.CurrentTable;
|
||||
ImGuiTableTempData* temp_data = table->TempData;
|
||||
temp_data->AngledHeadersRequests.resize(0);
|
||||
temp_data->AngledHeadersRequests.reserve(table->ColumnsEnabledCount);
|
||||
|
||||
// Which column needs highlight?
|
||||
const ImGuiID row_id = GetID("##AngledHeaders");
|
||||
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
|
||||
int highlight_column_n = table->HighlightColumnHeader;
|
||||
if (highlight_column_n == -1 && table->HoveredColumnBody != -1)
|
||||
if (table_instance->HoveredRowLast == 0 && table->HoveredColumnBorder == -1 && (g.ActiveId == 0 || g.ActiveId == row_id || (table->IsActiveIdInTable || g.DragDropActive)))
|
||||
highlight_column_n = table->HoveredColumnBody;
|
||||
|
||||
// Build up request
|
||||
ImU32 col_header_bg = GetColorU32(ImGuiCol_TableHeaderBg);
|
||||
ImU32 col_text = GetColorU32(ImGuiCol_Text);
|
||||
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
||||
if (IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
|
||||
{
|
||||
const int column_n = table->DisplayOrderToIndex[order_n];
|
||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
if ((column->Flags & ImGuiTableColumnFlags_AngledHeader) == 0) // Note: can't rely on ImGuiTableColumnFlags_IsVisible test here.
|
||||
continue;
|
||||
ImGuiTableHeaderData request = { (ImGuiTableColumnIdx)column_n, col_text, col_header_bg, (column_n == highlight_column_n) ? GetColorU32(ImGuiCol_Header) : 0 };
|
||||
temp_data->AngledHeadersRequests.push_back(request);
|
||||
}
|
||||
|
||||
// Render row
|
||||
TableAngledHeadersRowEx(row_id, g.Style.TableAngledHeadersAngle, 0.0f, temp_data->AngledHeadersRequests.Data, temp_data->AngledHeadersRequests.Size);
|
||||
}
|
||||
|
||||
void ImGui::TableAngledHeadersRowEx(float angle, float max_label_width)
|
||||
// Important: data must be fed left to right
|
||||
void ImGui::TableAngledHeadersRowEx(ImGuiID row_id, float angle, float max_label_width, const ImGuiTableHeaderData* data, int data_count)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiTable* table = g.CurrentTable;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
ImDrawList* draw_list = window->DrawList;
|
||||
IM_ASSERT(table != NULL && "Need to call TableHeadersRow() after BeginTable()!");
|
||||
if (table == NULL)
|
||||
{
|
||||
IM_ASSERT_USER_ERROR(table != NULL, "Call should only be done while in BeginTable() scope!");
|
||||
return;
|
||||
}
|
||||
IM_ASSERT(table->CurrentRow == -1 && "Must be first row");
|
||||
|
||||
if (max_label_width == 0.0f)
|
||||
@@ -3185,7 +3299,7 @@ void ImGui::TableAngledHeadersRowEx(float angle, float max_label_width)
|
||||
// Calculate our base metrics and set angled headers data _before_ the first call to TableNextRow()
|
||||
// FIXME-STYLE: Would it be better for user to submit 'max_label_width' or 'row_height' ? One can be derived from the other.
|
||||
const float header_height = g.FontSize + g.Style.CellPadding.x * 2.0f;
|
||||
const float row_height = ImFabs(ImRotate(ImVec2(max_label_width, flip_label ? +header_height : -header_height), cos_a, sin_a).y);
|
||||
const float row_height = ImTrunc(ImFabs(ImRotate(ImVec2(max_label_width, flip_label ? +header_height : -header_height), cos_a, sin_a).y));
|
||||
table->AngledHeadersHeight = row_height;
|
||||
table->AngledHeadersSlope = (sin_a != 0.0f) ? (cos_a / sin_a) : 0.0f;
|
||||
const ImVec2 header_angled_vector = unit_right * (row_height / -sin_a); // vector from bottom-left to top-left, and from bottom-right to top-right
|
||||
@@ -3203,28 +3317,22 @@ void ImGui::TableAngledHeadersRowEx(float angle, float max_label_width)
|
||||
draw_list->AddRectFilled(ImVec2(table->BgClipRect.Min.x, row_r.Min.y), ImVec2(table->BgClipRect.Max.x, row_r.Max.y), GetColorU32(ImGuiCol_TableHeaderBg, 0.25f)); // FIXME-STYLE: Change row background with an arbitrary color.
|
||||
PushClipRect(ImVec2(clip_rect_min_x, table->BgClipRect.Min.y), table->BgClipRect.Max, true); // Span all columns
|
||||
|
||||
const ImGuiID row_id = GetID("##AngledHeaders");
|
||||
ButtonBehavior(row_r, row_id, NULL, NULL);
|
||||
KeepAliveID(row_id);
|
||||
|
||||
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
|
||||
int highlight_column_n = table->HighlightColumnHeader;
|
||||
if (highlight_column_n == -1 && table->HoveredColumnBody != -1)
|
||||
if (table_instance->HoveredRowLast == 0 && table->HoveredColumnBorder == -1 && (g.ActiveId == 0 || g.ActiveId == row_id || (table->IsActiveIdInTable || g.DragDropActive)))
|
||||
highlight_column_n = table->HoveredColumnBody;
|
||||
const float ascent_scaled = g.Font->Ascent * g.FontScale; // FIXME: Standardize those scaling factors better
|
||||
const float line_off_for_ascent_x = (ImMax((g.FontSize - ascent_scaled) * 0.5f, 0.0f) / -sin_a) * (flip_label ? -1.0f : 1.0f);
|
||||
const ImVec2 padding = g.Style.CellPadding; // We will always use swapped component
|
||||
const ImVec2 align = g.Style.TableAngledHeadersTextAlign;
|
||||
|
||||
// Draw background and labels in first pass, then all borders.
|
||||
float max_x = 0.0f;
|
||||
ImVec2 padding = g.Style.CellPadding; // We will always use swapped component
|
||||
float max_x = -FLT_MAX;
|
||||
for (int pass = 0; pass < 2; pass++)
|
||||
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
||||
for (int order_n = 0; order_n < data_count; order_n++)
|
||||
{
|
||||
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
|
||||
continue;
|
||||
const int column_n = table->DisplayOrderToIndex[order_n];
|
||||
const ImGuiTableHeaderData* request = &data[order_n];
|
||||
const int column_n = request->Index;
|
||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
if ((column->Flags & ImGuiTableColumnFlags_AngledHeader) == 0) // Note: can't rely on ImGuiTableColumnFlags_IsVisible test here.
|
||||
continue;
|
||||
|
||||
ImVec2 bg_shape[4];
|
||||
bg_shape[0] = ImVec2(column->MaxX, row_r.Max.y);
|
||||
@@ -3234,9 +3342,8 @@ void ImGui::TableAngledHeadersRowEx(float angle, float max_label_width)
|
||||
if (pass == 0)
|
||||
{
|
||||
// Draw shape
|
||||
draw_list->AddQuadFilled(bg_shape[0], bg_shape[1], bg_shape[2], bg_shape[3], GetColorU32(ImGuiCol_TableHeaderBg));
|
||||
if (column_n == highlight_column_n)
|
||||
draw_list->AddQuadFilled(bg_shape[0], bg_shape[1], bg_shape[2], bg_shape[3], GetColorU32(ImGuiCol_Header)); // Highlight on hover
|
||||
draw_list->AddQuadFilled(bg_shape[0], bg_shape[1], bg_shape[2], bg_shape[3], request->BgColor0);
|
||||
draw_list->AddQuadFilled(bg_shape[0], bg_shape[1], bg_shape[2], bg_shape[3], request->BgColor1); // Optional highlight
|
||||
max_x = ImMax(max_x, bg_shape[3].x);
|
||||
|
||||
// Draw label
|
||||
@@ -3244,8 +3351,17 @@ void ImGui::TableAngledHeadersRowEx(float angle, float max_label_width)
|
||||
// - Handle multiple lines manually, as we want each lines to follow on the horizontal border, rather than see a whole block rotated.
|
||||
const char* label_name = TableGetColumnName(table, column_n);
|
||||
const char* label_name_end = FindRenderedTextEnd(label_name);
|
||||
const float line_off_step_x = g.FontSize / -sin_a;
|
||||
float line_off_curr_x = 0.0f;
|
||||
const float line_off_step_x = (g.FontSize / -sin_a);
|
||||
const int label_lines = ImTextCountLines(label_name, label_name_end);
|
||||
|
||||
// Left<>Right alignment
|
||||
float line_off_curr_x = flip_label ? (label_lines - 1) * line_off_step_x : 0.0f;
|
||||
float line_off_for_align_x = ImMax((((column->MaxX - column->MinX) - padding.x * 2.0f) - (label_lines * line_off_step_x)), 0.0f) * align.x;
|
||||
line_off_curr_x += line_off_for_align_x - line_off_for_ascent_x;
|
||||
|
||||
// Register header width
|
||||
column->ContentMaxXHeadersUsed = column->ContentMaxXHeadersIdeal = column->WorkMinX + ImCeil(label_lines * line_off_step_x - line_off_for_align_x);
|
||||
|
||||
while (label_name < label_name_end)
|
||||
{
|
||||
const char* label_name_eol = strchr(label_name, '\n');
|
||||
@@ -3254,26 +3370,30 @@ void ImGui::TableAngledHeadersRowEx(float angle, float max_label_width)
|
||||
|
||||
// FIXME: Individual line clipping for right-most column is broken for negative angles.
|
||||
ImVec2 label_size = CalcTextSize(label_name, label_name_eol);
|
||||
float clip_width = max_label_width - padding.y; // Using padding.y*2.0f would be symetrical but hide more text.
|
||||
float clip_width = max_label_width - padding.y; // Using padding.y*2.0f would be symmetrical but hide more text.
|
||||
float clip_height = ImMin(label_size.y, column->ClipRect.Max.x - column->WorkMinX - line_off_curr_x);
|
||||
ImRect clip_r(window->ClipRect.Min, window->ClipRect.Min + ImVec2(clip_width, clip_height));
|
||||
int vtx_idx_begin = draw_list->_VtxCurrentIdx;
|
||||
PushStyleColor(ImGuiCol_Text, request->TextColor);
|
||||
RenderTextEllipsis(draw_list, clip_r.Min, clip_r.Max, clip_r.Max.x, clip_r.Max.x, label_name, label_name_eol, &label_size);
|
||||
PopStyleColor();
|
||||
int vtx_idx_end = draw_list->_VtxCurrentIdx;
|
||||
|
||||
// Up<>Down alignment
|
||||
const float available_space = ImMax(clip_width - label_size.x + ImAbs(padding.x * cos_a) * 2.0f - ImAbs(padding.y * sin_a) * 2.0f, 0.0f);
|
||||
const float vertical_offset = available_space * align.y * (flip_label ? -1.0f : 1.0f);
|
||||
|
||||
// Rotate and offset label
|
||||
ImVec2 pivot_in = ImVec2(window->ClipRect.Min.x, window->ClipRect.Min.y + label_size.y);
|
||||
ImVec2 pivot_in = ImVec2(window->ClipRect.Min.x - vertical_offset, window->ClipRect.Min.y + label_size.y);
|
||||
ImVec2 pivot_out = ImVec2(column->WorkMinX, row_r.Max.y);
|
||||
line_off_curr_x += line_off_step_x;
|
||||
line_off_curr_x += flip_label ? -line_off_step_x : line_off_step_x;
|
||||
pivot_out += unit_right * padding.y;
|
||||
if (flip_label)
|
||||
pivot_out += unit_right * (clip_width - ImMax(0.0f, clip_width - label_size.x));
|
||||
pivot_out.x += flip_label ? line_off_curr_x - line_off_step_x : line_off_curr_x;
|
||||
pivot_out.x += flip_label ? line_off_curr_x + line_off_step_x : line_off_curr_x;
|
||||
ShadeVertsTransformPos(draw_list, vtx_idx_begin, vtx_idx_end, pivot_in, label_cos_a, label_sin_a, pivot_out); // Rotate and offset
|
||||
//if (g.IO.KeyShift) { ImDrawList* fg_dl = GetForegroundDrawList(); vtx_idx_begin = fg_dl->_VtxCurrentIdx; fg_dl->AddRect(clip_r.Min, clip_r.Max, IM_COL32(0, 255, 0, 255), 0.0f, 0, 2.0f); ShadeVertsTransformPos(fg_dl, vtx_idx_begin, fg_dl->_VtxCurrentIdx, pivot_in, label_cos_a, label_sin_a, pivot_out); }
|
||||
//if (g.IO.KeyShift) { ImDrawList* fg_dl = GetForegroundDrawList(); vtx_idx_begin = fg_dl->_VtxCurrentIdx; fg_dl->AddRect(clip_r.Min, clip_r.Max, IM_COL32(0, 255, 0, 255), 0.0f, 0, 1.0f); ShadeVertsTransformPos(fg_dl, vtx_idx_begin, fg_dl->_VtxCurrentIdx, pivot_in, label_cos_a, label_sin_a, pivot_out); }
|
||||
|
||||
// Register header width
|
||||
column->ContentMaxXHeadersUsed = column->ContentMaxXHeadersIdeal = column->WorkMinX + ImCeil(line_off_curr_x);
|
||||
label_name = label_name_eol + 1;
|
||||
}
|
||||
}
|
||||
@@ -3402,7 +3522,7 @@ void ImGui::TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags
|
||||
Separator();
|
||||
want_separator = true;
|
||||
|
||||
PushItemFlag(ImGuiItemFlags_SelectableDontClosePopup, true);
|
||||
PushItemFlag(ImGuiItemFlags_AutoClosePopups, false);
|
||||
for (int other_column_n = 0; other_column_n < table->ColumnsCount; other_column_n++)
|
||||
{
|
||||
ImGuiTableColumn* other_column = &table->Columns[other_column_n];
|
||||
@@ -3988,7 +4108,7 @@ float ImGui::GetColumnNormFromOffset(const ImGuiOldColumns* columns, float offse
|
||||
return offset / (columns->OffMaxX - columns->OffMinX);
|
||||
}
|
||||
|
||||
static const float COLUMNS_HIT_RECT_HALF_WIDTH = 4.0f;
|
||||
static const float COLUMNS_HIT_RECT_HALF_THICKNESS = 4.0f;
|
||||
|
||||
static float GetDraggedColumnOffset(ImGuiOldColumns* columns, int column_index)
|
||||
{
|
||||
@@ -3999,7 +4119,7 @@ static float GetDraggedColumnOffset(ImGuiOldColumns* columns, int column_index)
|
||||
IM_ASSERT(column_index > 0); // We are not supposed to drag column 0.
|
||||
IM_ASSERT(g.ActiveId == columns->ID + ImGuiID(column_index));
|
||||
|
||||
float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + COLUMNS_HIT_RECT_HALF_WIDTH - window->Pos.x;
|
||||
float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + ImTrunc(COLUMNS_HIT_RECT_HALF_THICKNESS * g.CurrentDpiScale) - window->Pos.x;
|
||||
x = ImMax(x, ImGui::GetColumnOffset(column_index - 1) + g.Style.ColumnsMinSpacing);
|
||||
if ((columns->Flags & ImGuiOldColumnFlags_NoPreserveWidths))
|
||||
x = ImMin(x, ImGui::GetColumnOffset(column_index + 1) - g.Style.ColumnsMinSpacing);
|
||||
@@ -4314,7 +4434,7 @@ void ImGui::EndColumns()
|
||||
ImGuiOldColumnData* column = &columns->Columns[n];
|
||||
float x = window->Pos.x + GetColumnOffset(n);
|
||||
const ImGuiID column_id = columns->ID + ImGuiID(n);
|
||||
const float column_hit_hw = COLUMNS_HIT_RECT_HALF_WIDTH;
|
||||
const float column_hit_hw = ImTrunc(COLUMNS_HIT_RECT_HALF_THICKNESS * g.CurrentDpiScale);
|
||||
const ImRect column_hit_rect(ImVec2(x - column_hit_hw, y1), ImVec2(x + column_hit_hw, y2));
|
||||
if (!ItemAdd(column_hit_rect, column_id, NULL, ImGuiItemFlags_NoNav))
|
||||
continue;
|
||||
@@ -4324,7 +4444,7 @@ void ImGui::EndColumns()
|
||||
{
|
||||
ButtonBehavior(column_hit_rect, column_id, &hovered, &held);
|
||||
if (hovered || held)
|
||||
g.MouseCursor = ImGuiMouseCursor_ResizeEW;
|
||||
SetMouseCursor(ImGuiMouseCursor_ResizeEW);
|
||||
if (held && !(column->Flags & ImGuiOldColumnFlags_NoResize))
|
||||
dragging_column = n;
|
||||
}
|
||||
@@ -4356,12 +4476,12 @@ void ImGui::EndColumns()
|
||||
NavUpdateCurrentWindowIsScrollPushableX();
|
||||
}
|
||||
|
||||
void ImGui::Columns(int columns_count, const char* id, bool border)
|
||||
void ImGui::Columns(int columns_count, const char* id, bool borders)
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindow();
|
||||
IM_ASSERT(columns_count >= 1);
|
||||
|
||||
ImGuiOldColumnFlags flags = (border ? 0 : ImGuiOldColumnFlags_NoBorder);
|
||||
ImGuiOldColumnFlags flags = (borders ? 0 : ImGuiOldColumnFlags_NoBorder);
|
||||
//flags |= ImGuiOldColumnFlags_NoPreserveWidths; // NB: Legacy behavior
|
||||
ImGuiOldColumns* columns = window->DC.CurrentColumns;
|
||||
if (columns != NULL && columns->Count == columns_count && columns->Flags == flags)
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// Those changes would need to be pushed into nothings/stb:
|
||||
// - Fix in stb_textedit_discard_redo (see https://github.com/nothings/stb/issues/321)
|
||||
// - Fix in stb_textedit_find_charpos to handle last line (see https://github.com/ocornut/imgui/issues/6000 + #6783)
|
||||
// - Added name to struct or it may be forward declared in our code.
|
||||
// - Added UTF-8 support (see https://github.com/nothings/stb/issues/188 + https://github.com/ocornut/imgui/pull/7925)
|
||||
// Grep for [DEAR IMGUI] to find the changes.
|
||||
// - Also renamed macros used or defined outside of IMSTB_TEXTEDIT_IMPLEMENTATION block from STB_TEXTEDIT_* to IMSTB_TEXTEDIT_*
|
||||
|
||||
@@ -41,7 +43,7 @@
|
||||
// 1.13 (2019-02-07) fix bug in undo size management
|
||||
// 1.12 (2018-01-29) user can change STB_TEXTEDIT_KEYTYPE, fix redo to avoid crash
|
||||
// 1.11 (2017-03-03) fix HOME on last line, dragging off single-line textfield
|
||||
// 1.10 (2016-10-25) supress warnings about casting away const with -Wcast-qual
|
||||
// 1.10 (2016-10-25) suppress warnings about casting away const with -Wcast-qual
|
||||
// 1.9 (2016-08-27) customizable move-by-word
|
||||
// 1.8 (2016-04-02) better keyboard handling when mouse button is down
|
||||
// 1.7 (2015-09-13) change y range handling in case baseline is non-0
|
||||
@@ -209,6 +211,7 @@
|
||||
// int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
|
||||
// int stb_textedit_paste(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE *text, int len)
|
||||
// void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXEDIT_KEYTYPE key)
|
||||
// void stb_textedit_text(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE *text, int text_len)
|
||||
//
|
||||
// Each of these functions potentially updates the string and updates the
|
||||
// state.
|
||||
@@ -243,7 +246,12 @@
|
||||
// various definitions like STB_TEXTEDIT_K_LEFT have the is-key-event bit
|
||||
// set, and make STB_TEXTEDIT_KEYTOCHAR check that the is-key-event bit is
|
||||
// clear. STB_TEXTEDIT_KEYTYPE defaults to int, but you can #define it to
|
||||
// anything other type you wante before including.
|
||||
// anything other type you want before including.
|
||||
// if the STB_TEXTEDIT_KEYTOTEXT function is defined, selected keys are
|
||||
// transformed into text and stb_textedit_text() is automatically called.
|
||||
//
|
||||
// text: [DEAR IMGUI] added 2024-09
|
||||
// call this to text inputs sent to the textfield.
|
||||
//
|
||||
//
|
||||
// When rendering, you can read the cursor position and selection state from
|
||||
@@ -318,7 +326,7 @@ typedef struct
|
||||
int undo_char_point, redo_char_point;
|
||||
} StbUndoState;
|
||||
|
||||
typedef struct
|
||||
typedef struct STB_TexteditState
|
||||
{
|
||||
/////////////////////
|
||||
//
|
||||
@@ -438,13 +446,13 @@ static int stb_text_locate_coord(IMSTB_TEXTEDIT_STRING *str, float x, float y)
|
||||
if (x < r.x1) {
|
||||
// search characters in row for one that straddles 'x'
|
||||
prev_x = r.x0;
|
||||
for (k=0; k < r.num_chars; ++k) {
|
||||
for (k=0; k < r.num_chars; k = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, i + k) - i) {
|
||||
float w = STB_TEXTEDIT_GETWIDTH(str, i, k);
|
||||
if (x < prev_x+w) {
|
||||
if (x < prev_x+w/2)
|
||||
return k+i;
|
||||
else
|
||||
return k+i+1;
|
||||
return IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, i + k);
|
||||
}
|
||||
prev_x += w;
|
||||
}
|
||||
@@ -563,7 +571,7 @@ static void stb_textedit_find_charpos(StbFindState *find, IMSTB_TEXTEDIT_STRING
|
||||
|
||||
// now scan to find xpos
|
||||
find->x = r.x0;
|
||||
for (i=0; first+i < n; ++i)
|
||||
for (i=0; first+i < n; i = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, first + i) - first)
|
||||
find->x += STB_TEXTEDIT_GETWIDTH(str, first, i);
|
||||
}
|
||||
|
||||
@@ -640,6 +648,17 @@ static void stb_textedit_move_to_last(IMSTB_TEXTEDIT_STRING *str, STB_TexteditSt
|
||||
}
|
||||
}
|
||||
|
||||
// [DEAR IMGUI]
|
||||
// Functions must be implemented for UTF8 support
|
||||
// Code in this file that uses those functions is modified for [DEAR IMGUI] and deviates from the original stb_textedit.
|
||||
// There is not necessarily a '[DEAR IMGUI]' at the usage sites.
|
||||
#ifndef IMSTB_TEXTEDIT_GETPREVCHARINDEX
|
||||
#define IMSTB_TEXTEDIT_GETPREVCHARINDEX(obj, idx) (idx - 1)
|
||||
#endif
|
||||
#ifndef IMSTB_TEXTEDIT_GETNEXTCHARINDEX
|
||||
#define IMSTB_TEXTEDIT_GETNEXTCHARINDEX(obj, idx) (idx + 1)
|
||||
#endif
|
||||
|
||||
#ifdef STB_TEXTEDIT_IS_SPACE
|
||||
static int is_word_boundary( IMSTB_TEXTEDIT_STRING *str, int idx )
|
||||
{
|
||||
@@ -720,36 +739,44 @@ static int stb_textedit_paste_internal(IMSTB_TEXTEDIT_STRING *str, STB_TexteditS
|
||||
#define STB_TEXTEDIT_KEYTYPE int
|
||||
#endif
|
||||
|
||||
// [DEAR IMGUI] Added stb_textedit_text(), extracted out and called by stb_textedit_key() for backward compatibility.
|
||||
static void stb_textedit_text(IMSTB_TEXTEDIT_STRING* str, STB_TexteditState* state, const IMSTB_TEXTEDIT_CHARTYPE* text, int text_len)
|
||||
{
|
||||
// can't add newline in single-line mode
|
||||
if (text[0] == '\n' && state->single_line)
|
||||
return;
|
||||
|
||||
if (state->insert_mode && !STB_TEXT_HAS_SELECTION(state) && state->cursor < STB_TEXTEDIT_STRINGLEN(str)) {
|
||||
stb_text_makeundo_replace(str, state, state->cursor, 1, 1);
|
||||
STB_TEXTEDIT_DELETECHARS(str, state->cursor, 1);
|
||||
if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, text, text_len)) {
|
||||
state->cursor += text_len;
|
||||
state->has_preferred_x = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
stb_textedit_delete_selection(str, state); // implicitly clamps
|
||||
if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, text, text_len)) {
|
||||
stb_text_makeundo_insert(state, state->cursor, text_len);
|
||||
state->cursor += text_len;
|
||||
state->has_preferred_x = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// API key: process a keyboard input
|
||||
static void stb_textedit_key(IMSTB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_KEYTYPE key)
|
||||
{
|
||||
retry:
|
||||
switch (key) {
|
||||
default: {
|
||||
#ifdef STB_TEXTEDIT_KEYTOTEXT
|
||||
int c = STB_TEXTEDIT_KEYTOTEXT(key);
|
||||
if (c > 0) {
|
||||
IMSTB_TEXTEDIT_CHARTYPE ch = (IMSTB_TEXTEDIT_CHARTYPE) c;
|
||||
|
||||
// can't add newline in single-line mode
|
||||
if (c == '\n' && state->single_line)
|
||||
break;
|
||||
|
||||
if (state->insert_mode && !STB_TEXT_HAS_SELECTION(state) && state->cursor < STB_TEXTEDIT_STRINGLEN(str)) {
|
||||
stb_text_makeundo_replace(str, state, state->cursor, 1, 1);
|
||||
STB_TEXTEDIT_DELETECHARS(str, state->cursor, 1);
|
||||
if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, &ch, 1)) {
|
||||
++state->cursor;
|
||||
state->has_preferred_x = 0;
|
||||
}
|
||||
} else {
|
||||
stb_textedit_delete_selection(str,state); // implicitly clamps
|
||||
if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, &ch, 1)) {
|
||||
stb_text_makeundo_insert(state, state->cursor, 1);
|
||||
++state->cursor;
|
||||
state->has_preferred_x = 0;
|
||||
}
|
||||
}
|
||||
IMSTB_TEXTEDIT_CHARTYPE ch = (IMSTB_TEXTEDIT_CHARTYPE)c;
|
||||
stb_textedit_text(str, state, &ch, 1);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -775,7 +802,7 @@ retry:
|
||||
stb_textedit_move_to_first(state);
|
||||
else
|
||||
if (state->cursor > 0)
|
||||
--state->cursor;
|
||||
state->cursor = IMSTB_TEXTEDIT_GETPREVCHARINDEX(str, state->cursor);
|
||||
state->has_preferred_x = 0;
|
||||
break;
|
||||
|
||||
@@ -784,7 +811,7 @@ retry:
|
||||
if (STB_TEXT_HAS_SELECTION(state))
|
||||
stb_textedit_move_to_last(str, state);
|
||||
else
|
||||
++state->cursor;
|
||||
state->cursor = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->cursor);
|
||||
stb_textedit_clamp(str, state);
|
||||
state->has_preferred_x = 0;
|
||||
break;
|
||||
@@ -794,7 +821,7 @@ retry:
|
||||
stb_textedit_prep_selection_at_cursor(state);
|
||||
// move selection left
|
||||
if (state->select_end > 0)
|
||||
--state->select_end;
|
||||
state->select_end = IMSTB_TEXTEDIT_GETPREVCHARINDEX(str, state->select_end);
|
||||
state->cursor = state->select_end;
|
||||
state->has_preferred_x = 0;
|
||||
break;
|
||||
@@ -844,7 +871,7 @@ retry:
|
||||
case STB_TEXTEDIT_K_RIGHT | STB_TEXTEDIT_K_SHIFT:
|
||||
stb_textedit_prep_selection_at_cursor(state);
|
||||
// move selection right
|
||||
++state->select_end;
|
||||
state->select_end = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->select_end);
|
||||
stb_textedit_clamp(str, state);
|
||||
state->cursor = state->select_end;
|
||||
state->has_preferred_x = 0;
|
||||
@@ -900,7 +927,7 @@ retry:
|
||||
x += dx;
|
||||
if (x > goal_x)
|
||||
break;
|
||||
++state->cursor;
|
||||
state->cursor = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->cursor);
|
||||
}
|
||||
stb_textedit_clamp(str, state);
|
||||
|
||||
@@ -962,7 +989,7 @@ retry:
|
||||
x += dx;
|
||||
if (x > goal_x)
|
||||
break;
|
||||
++state->cursor;
|
||||
state->cursor = IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->cursor);
|
||||
}
|
||||
stb_textedit_clamp(str, state);
|
||||
|
||||
@@ -990,7 +1017,7 @@ retry:
|
||||
else {
|
||||
int n = STB_TEXTEDIT_STRINGLEN(str);
|
||||
if (state->cursor < n)
|
||||
stb_textedit_delete(str, state, state->cursor, 1);
|
||||
stb_textedit_delete(str, state, state->cursor, IMSTB_TEXTEDIT_GETNEXTCHARINDEX(str, state->cursor) - state->cursor);
|
||||
}
|
||||
state->has_preferred_x = 0;
|
||||
break;
|
||||
@@ -1002,8 +1029,9 @@ retry:
|
||||
else {
|
||||
stb_textedit_clamp(str, state);
|
||||
if (state->cursor > 0) {
|
||||
stb_textedit_delete(str, state, state->cursor-1, 1);
|
||||
--state->cursor;
|
||||
int prev = IMSTB_TEXTEDIT_GETPREVCHARINDEX(str, state->cursor);
|
||||
stb_textedit_delete(str, state, prev, state->cursor - prev);
|
||||
state->cursor = prev;
|
||||
}
|
||||
}
|
||||
state->has_preferred_x = 0;
|
||||
|
||||
@@ -656,7 +656,7 @@ STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h
|
||||
STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip);
|
||||
// If skip != 0, this tells stb_truetype to skip any codepoints for which
|
||||
// there is no corresponding glyph. If skip=0, which is the default, then
|
||||
// codepoints without a glyph recived the font's "missing character" glyph,
|
||||
// codepoints without a glyph received the font's "missing character" glyph,
|
||||
// typically an empty box by convention.
|
||||
|
||||
STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above
|
||||
|
||||
78
enginecustom/src/hlsl/celshading.ps
Normal file
@@ -0,0 +1,78 @@
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
Texture2D shaderTexture : register(t0);
|
||||
SamplerState SampleType : register(s0);
|
||||
cbuffer SunLightBuffer
|
||||
{
|
||||
float4 ambientColor;
|
||||
float4 diffuseColor;
|
||||
float3 lightDirection;
|
||||
float intensity;
|
||||
};
|
||||
|
||||
cbuffer SunLightColorBuffer
|
||||
{
|
||||
float4 sunColor;
|
||||
};
|
||||
|
||||
//////////////
|
||||
// TYPEDEFS //
|
||||
//////////////
|
||||
struct PixelInputType
|
||||
{
|
||||
float4 position : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float3 normal : NORMAL;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Pixel Shader
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
float4 SunLightPixelShader(PixelInputType input) : SV_TARGET
|
||||
{
|
||||
float4 textureColor;
|
||||
float4 color;
|
||||
float lightIntensity;
|
||||
float4 colorArray;
|
||||
float4 colorSum;
|
||||
|
||||
// Sample the pixel color from the texture using the sampler at this texture coordinate location.
|
||||
textureColor = shaderTexture.Sample(SampleType, input.tex);
|
||||
|
||||
// Calculate the different amounts of light on this pixel based on the direction of the light.
|
||||
lightIntensity = saturate(dot(input.normal, -lightDirection));
|
||||
|
||||
if(lightIntensity > 0.95f)
|
||||
{
|
||||
lightIntensity = 1.0f;
|
||||
}
|
||||
else if(lightIntensity > 0.5f)
|
||||
{
|
||||
lightIntensity = 0.75f;
|
||||
}
|
||||
else if(lightIntensity > 0.25f)
|
||||
{
|
||||
lightIntensity = 0.5f;
|
||||
}
|
||||
else
|
||||
{
|
||||
lightIntensity = 0.25f;
|
||||
}
|
||||
|
||||
// Determine the diffuse color amount of the light.
|
||||
colorArray = (diffuseColor * lightIntensity) * intensity;
|
||||
|
||||
// Initialize the sum of colors.
|
||||
colorSum = float4(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
// Add the light color.
|
||||
colorSum.r += colorArray.r;
|
||||
colorSum.g += colorArray.g;
|
||||
colorSum.b += colorArray.b;
|
||||
|
||||
// Multiply the texture pixel by the light color to get the final result.
|
||||
color = saturate(colorSum) * textureColor;
|
||||
|
||||
return color;
|
||||
}
|
||||
@@ -1,8 +1,3 @@
|
||||
/////////////
|
||||
// DEFINES //
|
||||
/////////////
|
||||
#define NUM_LIGHTS 4
|
||||
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
@@ -19,9 +14,13 @@ cbuffer CameraBuffer
|
||||
float padding;
|
||||
};
|
||||
|
||||
cbuffer LightPositionBuffer
|
||||
cbuffer SunLightBuffer
|
||||
{
|
||||
float4 lightPosition[NUM_LIGHTS];
|
||||
float4 ambientColor; // Color of the ambient light.
|
||||
float4 diffuseColor; // Color of the diffuse light.
|
||||
float3 lightDirection; // Direction of the light.
|
||||
float intensity; // Intensity of the light.
|
||||
|
||||
};
|
||||
|
||||
//////////////
|
||||
@@ -39,18 +38,14 @@ struct PixelInputType
|
||||
float4 position : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float3 normal : NORMAL;
|
||||
float3 lightPos[NUM_LIGHTS] : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Vertex Shader
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
PixelInputType LightVertexShader(VertexInputType input)
|
||||
PixelInputType SunLightVertexShader(VertexInputType input)
|
||||
{
|
||||
PixelInputType output;
|
||||
float4 worldPosition;
|
||||
int i;
|
||||
|
||||
// Change the position vector to be 4 units for proper matrix calculations.
|
||||
input.position.w = 1.0f;
|
||||
@@ -64,22 +59,10 @@ PixelInputType LightVertexShader(VertexInputType input)
|
||||
output.tex = input.tex;
|
||||
|
||||
// Calculate the normal vector against the world matrix only.
|
||||
output.normal = mul(input.normal, (float3x3)worldMatrix);
|
||||
output.normal = mul(input.normal, (float3x3) worldMatrix);
|
||||
|
||||
// Normalize the normal vector.
|
||||
output.normal = normalize(output.normal);
|
||||
|
||||
// Calculate the position of the vertex in the world.
|
||||
worldPosition = mul(input.position, worldMatrix);
|
||||
|
||||
for(i=0; i<NUM_LIGHTS; i++)
|
||||
{
|
||||
// Determine the light positions based on the position of the lights and the position of the vertex in the world.
|
||||
output.lightPos[i] = lightPosition[i].xyz - worldPosition.xyz;
|
||||
|
||||
// Normalize the light position vectors.
|
||||
output.lightPos[i] = normalize(output.lightPos[i]);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ cbuffer PixelBuffer
|
||||
float4 pixelColor;
|
||||
};
|
||||
|
||||
|
||||
//////////////
|
||||
// TYPEDEFS //
|
||||
//////////////
|
||||
@@ -25,23 +24,18 @@ struct PixelInputType
|
||||
float4 FontPixelShader(PixelInputType input) : SV_TARGET
|
||||
{
|
||||
float4 color;
|
||||
|
||||
|
||||
|
||||
// Sample the texture pixel at this location.
|
||||
color = shaderTexture.Sample(SampleType, input.tex);
|
||||
|
||||
|
||||
// If the color is black on the texture then treat this pixel as transparent.
|
||||
if(color.r == 0.0f)
|
||||
if (color.r == 0.0f && color.g == 0.0f && color.b == 0.0f)
|
||||
{
|
||||
color.a = 0.0f;
|
||||
}
|
||||
|
||||
// If the color is other than black on the texture then this is a pixel in the font so draw it using the font pixel color.
|
||||
else
|
||||
{
|
||||
color.a = 1.0f;
|
||||
color = color * pixelColor;
|
||||
return color / color;
|
||||
}
|
||||
|
||||
// If the color is other than black on the texture then this is a pixel in the font so draw it using the font pixel color.
|
||||
color = color * pixelColor;
|
||||
|
||||
return color;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ cbuffer MatrixBuffer
|
||||
matrix projectionMatrix;
|
||||
};
|
||||
|
||||
|
||||
//////////////
|
||||
// TYPEDEFS //
|
||||
//////////////
|
||||
@@ -24,14 +23,12 @@ struct PixelInputType
|
||||
float2 tex : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Vertex Shader
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
PixelInputType FontVertexShader(VertexInputType input)
|
||||
{
|
||||
PixelInputType output;
|
||||
|
||||
|
||||
// Change the position vector to be 4 units for proper matrix calculations.
|
||||
input.position.w = 1.0f;
|
||||
@@ -40,9 +37,9 @@ PixelInputType FontVertexShader(VertexInputType input)
|
||||
output.position = mul(input.position, worldMatrix);
|
||||
output.position = mul(output.position, viewMatrix);
|
||||
output.position = mul(output.position, projectionMatrix);
|
||||
|
||||
|
||||
// Store the texture coordinates for the pixel shader.
|
||||
output.tex = input.tex;
|
||||
|
||||
|
||||
return output;
|
||||
}
|
||||
}
|
||||
61
enginecustom/src/hlsl/sunlight.ps
Normal file
@@ -0,0 +1,61 @@
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
Texture2D shaderTexture : register(t0);
|
||||
SamplerState SampleType : register(s0);
|
||||
cbuffer SunLightBuffer
|
||||
{
|
||||
float4 ambientColor;
|
||||
float4 diffuseColor;
|
||||
float3 lightDirection;
|
||||
float intensity;
|
||||
};
|
||||
|
||||
cbuffer SunLightColorBuffer
|
||||
{
|
||||
float4 sunColor;
|
||||
};
|
||||
|
||||
//////////////
|
||||
// TYPEDEFS //
|
||||
//////////////
|
||||
struct PixelInputType
|
||||
{
|
||||
float4 position : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float3 normal : NORMAL;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Pixel Shader
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
float4 SunLightPixelShader(PixelInputType input) : SV_TARGET
|
||||
{
|
||||
float4 textureColor;
|
||||
float4 color;
|
||||
float lightIntensity;
|
||||
float4 colorArray;
|
||||
float4 colorSum;
|
||||
|
||||
// Sample the pixel color from the texture using the sampler at this texture coordinate location.
|
||||
textureColor = shaderTexture.Sample(SampleType, input.tex);
|
||||
|
||||
// Calculate the different amounts of light on this pixel based on the direction of the light.
|
||||
lightIntensity = saturate(dot(input.normal, -lightDirection));
|
||||
|
||||
// Determine the diffuse color amount of the light.
|
||||
colorArray = (diffuseColor * lightIntensity) * intensity;
|
||||
|
||||
// Initialize the sum of colors.
|
||||
colorSum = float4(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
// Add the light color.
|
||||
colorSum.r += colorArray.r;
|
||||
colorSum.g += colorArray.g;
|
||||
colorSum.b += colorArray.b;
|
||||
|
||||
// Multiply the texture pixel by the light color to get the final result.
|
||||
color = saturate(colorSum) * textureColor;
|
||||
|
||||
return color;
|
||||
}
|
||||
67
enginecustom/src/hlsl/sunlight.vs
Normal file
@@ -0,0 +1,67 @@
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
cbuffer MatrixBuffer
|
||||
{
|
||||
matrix worldMatrix;
|
||||
matrix viewMatrix;
|
||||
matrix projectionMatrix;
|
||||
};
|
||||
|
||||
cbuffer CameraBuffer
|
||||
{
|
||||
float3 cameraPosition;
|
||||
float padding;
|
||||
};
|
||||
|
||||
cbuffer SunLightBuffer
|
||||
{
|
||||
float4 ambientColor;
|
||||
float4 diffuseColor;
|
||||
float3 lightDirection;
|
||||
float intensity;
|
||||
};
|
||||
|
||||
//////////////
|
||||
// TYPEDEFS //
|
||||
//////////////
|
||||
struct VertexInputType
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float3 normal : NORMAL;
|
||||
};
|
||||
|
||||
struct PixelInputType
|
||||
{
|
||||
float4 position : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float3 normal : NORMAL;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Vertex Shader
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
PixelInputType SunLightVertexShader(VertexInputType input)
|
||||
{
|
||||
PixelInputType output;
|
||||
|
||||
// Change the position vector to be 4 units for proper matrix calculations.
|
||||
input.position.w = 1.0f;
|
||||
|
||||
// Calculate the position of the vertex against the world, view, and projection matrices.
|
||||
output.position = mul(input.position, worldMatrix);
|
||||
output.position = mul(output.position, viewMatrix);
|
||||
output.position = mul(output.position, projectionMatrix);
|
||||
|
||||
// Store the texture coordinates for the pixel shader.
|
||||
output.tex = input.tex;
|
||||
|
||||
// Calculate the normal vector against the world matrix only.
|
||||
output.normal = mul(input.normal, (float3x3) worldMatrix);
|
||||
|
||||
// Normalize the normal vector.
|
||||
output.normal = normalize(output.normal);
|
||||
|
||||
return output;
|
||||
}
|
||||
64
enginecustom/src/inc/shader/CelShadingShader.h
Normal file
@@ -0,0 +1,64 @@
|
||||
#pragma once
|
||||
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
class CelshadeClass
|
||||
{
|
||||
|
||||
private :
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct CameraBufferType
|
||||
{
|
||||
XMFLOAT3 cameraPosition;
|
||||
float padding;
|
||||
};
|
||||
|
||||
struct SunLightBufferType
|
||||
{
|
||||
XMFLOAT4 diffuseColor;
|
||||
XMFLOAT4 ambientColor;
|
||||
XMFLOAT3 sunDirection;
|
||||
float intensity;
|
||||
};
|
||||
|
||||
|
||||
public :
|
||||
CelshadeClass();
|
||||
CelshadeClass(const CelshadeClass&);
|
||||
~CelshadeClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext* deviceContex, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix, ID3D11ShaderResourceView* texture, XMFLOAT4 diffuseColor, XMFLOAT4 ambientColor, XMFLOAT3 sunDirection,float intensity);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext* deviceContext, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix, ID3D11ShaderResourceView* texture, XMFLOAT4 ambientColor, XMFLOAT4 diffuseColor, XMFLOAT3 lightDirection, float sunIntensity);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11Buffer* m_cameraBuffer;
|
||||
ID3D11Buffer* m_sunlightBuffer;
|
||||
ID3D11Buffer* m_sunlightColorBuffer;
|
||||
ID3D11Buffer* m_sunlightPositionBuffer;
|
||||
};
|
||||
@@ -3,7 +3,7 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _LIGHTSHADERCLASS_H_
|
||||
#define _LIGHTSHADERCLASS_H_
|
||||
|
||||
#pragma once
|
||||
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
@@ -1,12 +1,13 @@
|
||||
#ifndef _SHADERMANAGERCLASS_H_
|
||||
#define _SHADERMANAGERCLASS_H_
|
||||
|
||||
///////////////////////
|
||||
// MY CLASS INCLUDES //
|
||||
///////////////////////
|
||||
// Inclure les en-têtes nécessaires
|
||||
#include <d3d11.h>
|
||||
#include <DirectXMath.h>
|
||||
#include <vector>
|
||||
#include "textureshaderclass.h"
|
||||
#include "normalmapshaderclass.h"
|
||||
#include "Multitextureshaderclass.h"
|
||||
#include "multitextureshaderclass.h"
|
||||
#include "translateshaderclass.h"
|
||||
#include "alphamapshaderclass.h"
|
||||
#include "specmapshaderclass.h"
|
||||
@@ -15,12 +16,11 @@
|
||||
#include "lightmapshaderclass.h"
|
||||
#include "refractionshaderclass.h"
|
||||
#include "watershaderclass.h"
|
||||
#include "CelShadingShader.h"
|
||||
#include "celshadingshader.h"
|
||||
#include "sunlightshaderclass.h"
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: ShaderManagerClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class ShaderManagerClass
|
||||
{
|
||||
public:
|
||||
@@ -30,21 +30,20 @@ public:
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
|
||||
bool RenderTextureShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*);
|
||||
bool RenderNormalMapShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4);
|
||||
bool RenderMultitextureShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
bool RenderTranslateShader(ID3D11DeviceContext*,int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, float);
|
||||
bool RenderTranslateShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, float);
|
||||
bool RenderAlphaMapShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
bool RenderSpecMapShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*,
|
||||
XMFLOAT3, XMFLOAT4, XMFLOAT3, XMFLOAT4, float);
|
||||
bool RenderSpecMapShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4, XMFLOAT3, XMFLOAT4, float);
|
||||
bool RenderTransparentShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, float);
|
||||
bool RenderlightShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[]);
|
||||
bool RenderlightMapShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
bool RenderRefractionShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*,
|
||||
XMFLOAT3, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[], XMFLOAT4);
|
||||
bool RenderWaterShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*,
|
||||
ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, float, float);
|
||||
bool RenderCelShadingShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4, XMFLOAT3);
|
||||
bool RenderRefractionShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[], XMFLOAT4);
|
||||
bool RenderWaterShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, float, float);
|
||||
bool RenderCelShadingShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float);
|
||||
bool RenderSunlightShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float);
|
||||
private:
|
||||
TextureShaderClass* m_TextureShader;
|
||||
NormalMapShaderClass* m_NormalMapShader;
|
||||
@@ -53,12 +52,12 @@ private:
|
||||
AlphaMapShaderClass* m_AlphaMapShader;
|
||||
SpecMapShaderClass* m_SpecMapShader;
|
||||
TransparentShaderClass* m_TransparentShader;
|
||||
|
||||
LightShaderClass* m_LightShader;
|
||||
LightMapShaderClass* m_LightMapShader;
|
||||
RefractionShaderClass* m_RefractionShader;
|
||||
WaterShaderClass* m_WaterShader;
|
||||
CelShadingShader* m_CelShadingShader;
|
||||
CelshadeClass* m_CelShadingShader;
|
||||
SunlightShaderClass* m_SunlightShader;
|
||||
};
|
||||
|
||||
#endif
|
||||