diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2015-10-21 03:46:28 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2015-10-21 03:46:28 +0000 |
| commit | 9ccee73baca0fd7ecb95c90cb983133b737c6c55 (patch) | |
| tree | 66fea1e6521df31727431520fe3c1ead1896bc5d /Platforms | |
| download | DiligentCore-9ccee73baca0fd7ecb95c90cb983133b737c6c55.tar.gz DiligentCore-9ccee73baca0fd7ecb95c90cb983133b737c6c55.zip | |
Release v1.0.0
Diffstat (limited to 'Platforms')
67 files changed, 4003 insertions, 0 deletions
diff --git a/Platforms/Android/build/Windows/AndroidPlatform-Debug.vgdbsettings b/Platforms/Android/build/Windows/AndroidPlatform-Debug.vgdbsettings new file mode 100644 index 00000000..3f5b24b1 --- /dev/null +++ b/Platforms/Android/build/Windows/AndroidPlatform-Debug.vgdbsettings @@ -0,0 +1,76 @@ +<?xml version="1.0"?> +<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <ConfigurationName>Debug</ConfigurationName> + <Project xsi:type="com.visualgdb.project.android"> + <CustomSourceDirectories> + <Directories /> + <PathStyle>MinGWWindowsSlash</PathStyle> + </CustomSourceDirectories> + <AndroidProjectPath>$(ProjectDir)</AndroidProjectPath> + </Project> + <Build xsi:type="com.visualgdb.build.android"> + <AndroidPlatform>android-19</AndroidPlatform> + <IsDebugConfiguration>true</IsDebugConfiguration> + <JNIOnlyBuild>true</JNIOnlyBuild> + <AdditionalDirectoriesToDeleteOnClean>bin;obj</AdditionalDirectoriesToDeleteOnClean> + <DeleteANTFilesOnClean>false</DeleteANTFilesOnClean> + <DoNotEditAndroidManifest>false</DoNotEditAndroidManifest> + <CustomActions /> + </Build> + <Debug xsi:type="com.visualgdb.debug.android"> + <AdditionalStartupCommands /> + <AdditionalGDBSettings> + <FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications> + <ForceSingleThreadedMode>false</ForceSingleThreadedMode> + <PendingBreakpointsSupported>true</PendingBreakpointsSupported> + <DisableChildRanges>false</DisableChildRanges> + <UseAppleExtensions>false</UseAppleExtensions> + <CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning> + <MakeLogFile>false</MakeLogFile> + <IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping> + <UseRelativePathsOnly>false</UseRelativePathsOnly> + <ExitAction>KillApp</ExitAction> + <Features> + <DisableAutoDetection>false</DisableAutoDetection> + <UseFrameParameter>false</UseFrameParameter> + <SimpleValuesFlagSupported>false</SimpleValuesFlagSupported> + <ListLocalsSupported>false</ListLocalsSupported> + <ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable> + <ThreadInfoSupported>false</ThreadInfoSupported> + <PendingBreakpointsSupported>false</PendingBreakpointsSupported> + <SupportTargetCommand>false</SupportTargetCommand> + </Features> + <DisableDisassembly>false</DisableDisassembly> + <ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand> + <StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry> + <ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat> + </AdditionalGDBSettings> + <LaunchGDBSettings xsi:type="GDBLaunchParametersAndroid" /> + <GenerateCtrlBreakInsteadOfCtrlC>false</GenerateCtrlBreakInsteadOfCtrlC> + <UseDefaultInstallDir>false</UseDefaultInstallDir> + <RemotePort>5039</RemotePort> + <LocalPort>5039</LocalPort> + <GDBServerStartupTimeout>10000</GDBServerStartupTimeout> + <AdditionalGDBServerStartupDelay>0</AdditionalGDBServerStartupDelay> + <DoubleSlashWorkaround>false</DoubleSlashWorkaround> + <AlreadyRunningDecision>Ask</AlreadyRunningDecision> + <ShowLogCat>true</ShowLogCat> + <EnableThreadNameWatcher>true</EnableThreadNameWatcher> + </Debug> + <CustomBuild> + <PreBuildActions /> + <PostBuildActions /> + <PreCleanActions /> + <PostCleanActions /> + </CustomBuild> + <CustomDebug> + <PreDebugActions /> + <PostDebugActions /> + <BreakMode>Default</BreakMode> + </CustomDebug> + <CustomShortcuts> + <Shortcuts /> + <ShowMessageAfterExecuting>true</ShowMessageAfterExecuting> + </CustomShortcuts> + <UserDefinedVariables /> +</VisualGDBProjectSettings2>
\ No newline at end of file diff --git a/Platforms/Android/build/Windows/AndroidPlatform-Release.vgdbsettings b/Platforms/Android/build/Windows/AndroidPlatform-Release.vgdbsettings new file mode 100644 index 00000000..669691f2 --- /dev/null +++ b/Platforms/Android/build/Windows/AndroidPlatform-Release.vgdbsettings @@ -0,0 +1,76 @@ +<?xml version="1.0"?> +<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <ConfigurationName>Release</ConfigurationName> + <Project xsi:type="com.visualgdb.project.android"> + <CustomSourceDirectories> + <Directories /> + <PathStyle>MinGWWindowsSlash</PathStyle> + </CustomSourceDirectories> + <AndroidProjectPath>$(ProjectDir)</AndroidProjectPath> + </Project> + <Build xsi:type="com.visualgdb.build.android"> + <AndroidPlatform>android-19</AndroidPlatform> + <IsDebugConfiguration>false</IsDebugConfiguration> + <JNIOnlyBuild>true</JNIOnlyBuild> + <AdditionalDirectoriesToDeleteOnClean>bin;obj</AdditionalDirectoriesToDeleteOnClean> + <DeleteANTFilesOnClean>false</DeleteANTFilesOnClean> + <DoNotEditAndroidManifest>false</DoNotEditAndroidManifest> + <CustomActions /> + </Build> + <Debug xsi:type="com.visualgdb.debug.android"> + <AdditionalStartupCommands /> + <AdditionalGDBSettings> + <FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications> + <ForceSingleThreadedMode>false</ForceSingleThreadedMode> + <PendingBreakpointsSupported>true</PendingBreakpointsSupported> + <DisableChildRanges>false</DisableChildRanges> + <UseAppleExtensions>false</UseAppleExtensions> + <CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning> + <MakeLogFile>false</MakeLogFile> + <IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping> + <UseRelativePathsOnly>false</UseRelativePathsOnly> + <ExitAction>KillApp</ExitAction> + <Features> + <DisableAutoDetection>false</DisableAutoDetection> + <UseFrameParameter>false</UseFrameParameter> + <SimpleValuesFlagSupported>false</SimpleValuesFlagSupported> + <ListLocalsSupported>false</ListLocalsSupported> + <ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable> + <ThreadInfoSupported>false</ThreadInfoSupported> + <PendingBreakpointsSupported>false</PendingBreakpointsSupported> + <SupportTargetCommand>false</SupportTargetCommand> + </Features> + <DisableDisassembly>false</DisableDisassembly> + <ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand> + <StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry> + <ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat> + </AdditionalGDBSettings> + <LaunchGDBSettings xsi:type="GDBLaunchParametersAndroid" /> + <GenerateCtrlBreakInsteadOfCtrlC>false</GenerateCtrlBreakInsteadOfCtrlC> + <UseDefaultInstallDir>false</UseDefaultInstallDir> + <RemotePort>5039</RemotePort> + <LocalPort>5039</LocalPort> + <GDBServerStartupTimeout>10000</GDBServerStartupTimeout> + <AdditionalGDBServerStartupDelay>0</AdditionalGDBServerStartupDelay> + <DoubleSlashWorkaround>false</DoubleSlashWorkaround> + <AlreadyRunningDecision>Ask</AlreadyRunningDecision> + <ShowLogCat>true</ShowLogCat> + <EnableThreadNameWatcher>true</EnableThreadNameWatcher> + </Debug> + <CustomBuild> + <PreBuildActions /> + <PostBuildActions /> + <PreCleanActions /> + <PostCleanActions /> + </CustomBuild> + <CustomDebug> + <PreDebugActions /> + <PostDebugActions /> + <BreakMode>Default</BreakMode> + </CustomDebug> + <CustomShortcuts> + <Shortcuts /> + <ShowMessageAfterExecuting>true</ShowMessageAfterExecuting> + </CustomShortcuts> + <UserDefinedVariables /> +</VisualGDBProjectSettings2>
\ No newline at end of file diff --git a/Platforms/Android/build/Windows/AndroidPlatform.vcxproj b/Platforms/Android/build/Windows/AndroidPlatform.vcxproj new file mode 100644 index 00000000..43e5b9b8 --- /dev/null +++ b/Platforms/Android/build/Windows/AndroidPlatform.vcxproj @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|ARM"> + <Configuration>Debug</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|ARM"> + <Configuration>Release</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{E333476E-15E3-4D43-A4CF-8748058B3BE9}</ProjectGuid> + <RootNamespace>AndroidPlatform</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <PlatformToolset>v120</PlatformToolset> + <ConfigurationType>Makefile</ConfigurationType> + </PropertyGroup> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <PlatformToolset>v120</PlatformToolset> + <ConfigurationType>Makefile</ConfigurationType> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <Import Project="..\..\..\..\Shared\build\Windows\Android32d.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <Import Project="..\..\..\..\Shared\build\Windows\Android32r.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup /> + <ItemGroup> + <None Include="jni\Android.mk" /> + <None Include="jni\Application.mk" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\include\AndroidDebug.h" /> + <ClInclude Include="..\..\include\AndroidFileSystem.h" /> + <ClInclude Include="..\..\include\AndroidPlatformDefinitions.h" /> + <ClInclude Include="..\..\include\AndroidPlatformMisc.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\AndroidDebug.cpp" /> + <ClCompile Include="..\..\src\AndroidFileSystem.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Android/build/Windows/AndroidPlatform.vcxproj.filters b/Platforms/Android/build/Windows/AndroidPlatform.vcxproj.filters new file mode 100644 index 00000000..e9a68010 --- /dev/null +++ b/Platforms/Android/build/Windows/AndroidPlatform.vcxproj.filters @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="jni"> + <UniqueIdentifier>{5af229be-bfa0-48dc-9c77-f42bceac4839}</UniqueIdentifier> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <None Include="jni\Android.mk"> + <Filter>jni</Filter> + </None> + <None Include="jni\Application.mk"> + <Filter>jni</Filter> + </None> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\include\AndroidPlatformDefinitions.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\include\AndroidFileSystem.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\include\AndroidDebug.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\include\AndroidPlatformMisc.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\AndroidFileSystem.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\AndroidDebug.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Android/build/Windows/jni/Android.mk b/Platforms/Android/build/Windows/jni/Android.mk new file mode 100644 index 00000000..79916efd --- /dev/null +++ b/Platforms/Android/build/Windows/jni/Android.mk @@ -0,0 +1,26 @@ +# Android NDK project makefile autogenerated by Premake + +# Preamble +DEPENDENCY_PATH := $(call my-dir) +LOCAL_PATH := $(abspath $(DEPENDENCY_PATH)) +include $(CLEAR_VARS) + + +# Project configuration +LOCAL_MODULE := AndroidPlatform +LOCAL_CFLAGS := -std=c++11 +LOCAL_CPP_FEATURES := exceptions +LOCAL_STATIC_LIBRARIES += ndk_helper native_app_glue + +# Include paths +SOLUTION_ROOT := $(LOCAL_PATH)/../../../../.. +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../include $(LOCAL_PATH)/../../../../interface $(LOCAL_PATH)/../../../../interface $(SOLUTION_ROOT)/Common/include $(SOLUTION_ROOT)/Common/interface + +# Source files +#VisualGDBAndroid: AutoUpdateSourcesInNextLine +LOCAL_SRC_FILES := ../../../src/AndroidDebug.cpp ../../../src/AndroidFileSystem.cpp + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,android/ndk_helper) +$(call import-module,android/native_app_glue) diff --git a/Platforms/Android/build/Windows/jni/Application.mk b/Platforms/Android/build/Windows/jni/Application.mk new file mode 100644 index 00000000..4715824e --- /dev/null +++ b/Platforms/Android/build/Windows/jni/Application.mk @@ -0,0 +1,7 @@ +# Generated by VisualGDB + +DEPENDENCY_PATH := $(call my-dir) +LOCAL_PATH := $(abspath $(DEPENDENCY_PATH)) +include $(LOCAL_PATH)/../../../../../Common/make/AppCommon.mk + +APP_MODULES := AndroidPlatform
\ No newline at end of file diff --git a/Platforms/Android/include/AndroidDebug.h b/Platforms/Android/include/AndroidDebug.h new file mode 100644 index 00000000..f222aad0 --- /dev/null +++ b/Platforms/Android/include/AndroidDebug.h @@ -0,0 +1,32 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "..\Basic\include\BasicPlatformDebug.h" + +struct AndroidDebug : public BasicPlatformDebug +{ + static void AssertionFailed( const Diligent::Char *Message, const char *Function, const char *File, int Line ); + static void OutputDebugMessage( DebugMessageSeverity Severity, const Diligent::Char *Message ); +}; diff --git a/Platforms/Android/include/AndroidFileSystem.h b/Platforms/Android/include/AndroidFileSystem.h new file mode 100644 index 00000000..6edb760d --- /dev/null +++ b/Platforms/Android/include/AndroidFileSystem.h @@ -0,0 +1,66 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "..\Basic\include\BasicFileSystem.h" + +#include <memory> +#include <vector> + +class AndroidFile : public BasicFile +{ +public: + AndroidFile( const FileOpenAttribs &OpenAttribs ); + ~AndroidFile(); + + void Read( Diligent::IDataBlob *pData ); + + bool Read( void* Data, size_t BufferSize ); + + bool Write( const void *Data, size_t BufferSize ); + + size_t GetSize(); + + size_t GetPos(); + + void SetPos(size_t Offset, FilePosOrigin Origin); + +private: + //FILE *m_pFile; +}; + +struct AndroidFileSystem : public BasicFileSystem +{ +public: + static AndroidFile* OpenFile( const FileOpenAttribs &OpenAttribs ); + static inline Diligent::Char GetSlashSymbol(){ return '/'; } + + static bool FileExists( const Diligent::Char *strFilePath ); + static bool PathExists( const Diligent::Char *strPath ); + + static bool CreateDirectory( const Diligent::Char *strPath ); + static void ClearDirectory( const Diligent::Char *strPath ); + static void DeleteFile( const Diligent::Char *strPath ); + static std::vector<std::unique_ptr<FindFileData>> Search(const Diligent::Char *SearchPattern); +}; diff --git a/Platforms/Android/include/AndroidPlatformDefinitions.h b/Platforms/Android/include/AndroidPlatformDefinitions.h new file mode 100644 index 00000000..0f297c20 --- /dev/null +++ b/Platforms/Android/include/AndroidPlatformDefinitions.h @@ -0,0 +1,30 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include <cstddef> + +template <typename _CountofType, std::size_t _SizeOfArray> +char (*__countof_helper(_CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray]; +#define _countof(_Array) (sizeof(*__countof_helper(_Array)) + 0) diff --git a/Platforms/Android/include/AndroidPlatformMisc.h b/Platforms/Android/include/AndroidPlatformMisc.h new file mode 100644 index 00000000..69277b7b --- /dev/null +++ b/Platforms/Android/include/AndroidPlatformMisc.h @@ -0,0 +1,43 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "..\Basic\include\BasicPlatformMisc.h" +#include "DebugUtilities.h" + +struct AndroidMisc : public BasicPlatformMisc +{ + static Diligent::Uint32 GetMSB(Diligent::Uint32 Val) + { + if( Val == 0 )return 32; + + // Returns the number of leading 0-bits in x, starting at the + // most significant bit position. If x is 0, the result is undefined. + auto LeadingZeros = __builtin_clz(Val); + auto MSB = 31 - LeadingZeros; + VERIFY_EXPR(MSB == BasicPlatformMisc::GetMSB(Val)); + + return MSB; + } +}; diff --git a/Platforms/Android/src/AndroidDebug.cpp b/Platforms/Android/src/AndroidDebug.cpp new file mode 100644 index 00000000..31fd3cde --- /dev/null +++ b/Platforms/Android/src/AndroidDebug.cpp @@ -0,0 +1,47 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#include "AndroidDebug.h" +#include "FormatMessage.h" +#include "FileSystem.h" +#include <android/log.h> +#include <csignal> + +void AndroidDebug :: AssertionFailed( const Diligent::Char *Message, const char *Function, const char *File, int Line ) +{ + std::string FileName; + FileSystem::SplitFilePath( File, nullptr, &FileName ); + std::stringstream msgss; + Diligent::FormatMsg( msgss, "\nDebug assertion failed in ", Function, "(), file ", FileName, ", line ", Line, ":\n", Message); + auto FullMsg = msgss.str(); + OutputDebugMessage( DebugMessageSeverity::Error, FullMsg.c_str() ); + + raise( SIGTRAP ); +}; + + +void AndroidDebug::OutputDebugMessage( DebugMessageSeverity Severity, const Diligent::Char *Message ) +{ + static const android_LogPriority Priorities[] = { ANDROID_LOG_INFO, ANDROID_LOG_WARN, ANDROID_LOG_ERROR, ANDROID_LOG_FATAL }; + __android_log_print( Priorities[static_cast<int>(Severity)], "Graphics Engine", "%s", Message ); +} diff --git a/Platforms/Android/src/AndroidFileSystem.cpp b/Platforms/Android/src/AndroidFileSystem.cpp new file mode 100644 index 00000000..d6c4419b --- /dev/null +++ b/Platforms/Android/src/AndroidFileSystem.cpp @@ -0,0 +1,180 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#include "AndroidFileSystem.h" +#include "Errors.h" +#include "DebugUtilities.h" +#include <JNIHelper.h> + +using namespace ndk_helper; + +AndroidFile::AndroidFile( const FileOpenAttribs &OpenAttribs ) : + BasicFile(OpenAttribs, AndroidFileSystem::GetSlashSymbol())/*, + m_pFile(nullptr)*/ +{ + //auto OpenModeStr = GetOpenModeStr(); + // + //m_pFile = fopen( FileName, OpenModeStr.c_str()); + //if( m_pFile != nullptr ) + //{ + // break; + //} + //else + //{ + // std::stringstream ErrSS; + // ErrSS<< "Failed to open file" << std::endl << FileName; + // LOG_ERROR_AND_THROW(ErrSS.str().c_str()); + //} + + // Workaround: + // Try to read data from the file to make sure it exists + auto FullPath = m_OpenAttribs.strFilePath; + std::vector<Diligent::Uint8> Data; + if( !JNIHelper::GetInstance()->ReadFile( FullPath, &Data ) ) + { + LOG_ERROR_AND_THROW( "Failed to open file ", FullPath ); + } +} + +AndroidFile::~AndroidFile() +{ + //if( m_pFile ) + //{ + // fclose( m_pFile ); + // m_pFile = nullptr; + //} +} + +void AndroidFile::Read( Diligent::IDataBlob *pData ) +{ + auto FullPath = m_OpenAttribs.strFilePath; + std::vector<Diligent::Uint8> Data; + bool b = JNIHelper::GetInstance()->ReadFile( FullPath, &Data ); + if( b ) + { + pData->Resize( Data.size() ); + memcpy( pData->GetDataPtr(), Data.data(), Data.size() ); + } + else + { + LOG_ERROR_MESSAGE( "Unable to open file ", m_OpenAttribs.strFilePath, "\nFull path: ", FullPath ); + } +} + +size_t AndroidFile::GetSize() +{ + UNSUPPORTED( "Not implemented" ); + + return 0; +} + +bool AndroidFile::Read( void *Data, size_t BufferSize ) +{ + UNSUPPORTED( "Not implemented" ); + + //VERIFY( m_pFile, "File not opened" ); + //auto OrigPos = ftell( m_pFile ); + //fseek( m_pFile, 0, SEEK_END ); + //auto FileSize = ftell( m_pFile ); + //fseek( m_pFile, 0, SEEK_SET ); + //Data.resize( FileSize ); + //auto ItemsRead = fread( Data.data(), FileSize, 1, m_pFile ); + //fseek( m_pFile, OrigPos, SEEK_SET ); + //return ItemsRead == 1; + return false; +} + +bool AndroidFile::Write( const void *Data, size_t BufferSize ) +{ + UNSUPPORTED( "Not implemented" ); + + return false; +} + +size_t AndroidFile::GetPos() +{ + UNSUPPORTED( "Not implemented" ); + + return 0; +} + +void AndroidFile::SetPos(size_t Offset, FilePosOrigin Origin) +{ + UNSUPPORTED( "Not implemented" ); +} + + +AndroidFile* AndroidFileSystem::OpenFile( const FileOpenAttribs &OpenAttribs ) +{ + AndroidFile *pFile = nullptr; + try + { + pFile = new AndroidFile( OpenAttribs ); + } + catch( const std::runtime_error &err ) + { + + } + + return pFile; +} + + +bool AndroidFileSystem::FileExists( const Diligent::Char *strFilePath ) +{ + FileOpenAttribs OpenAttribs; + OpenAttribs.strFilePath = strFilePath; + BasicFile DummyFile( OpenAttribs, AndroidFileSystem::GetSlashSymbol() ); + const auto& Path = DummyFile.GetPath(); + std::vector<Diligent::Uint8> Data; + bool b = JNIHelper::GetInstance()->ReadFile( Path.c_str(), &Data ); + return b; +} + +bool AndroidFileSystem::PathExists( const Diligent::Char *strPath ) +{ + UNSUPPORTED( "Not implemented" ); + return false; +} + +bool AndroidFileSystem::CreateDirectory( const Diligent::Char *strPath ) +{ + UNSUPPORTED( "Not implemented" ); + return false; +} + +void AndroidFileSystem::ClearDirectory( const Diligent::Char *strPath ) +{ + UNSUPPORTED( "Not implemented" ); +} + +void AndroidFileSystem::DeleteFile( const Diligent::Char *strPath ) +{ + UNSUPPORTED( "Not implemented" ); +} + +std::vector<std::unique_ptr<FindFileData>> AndroidFileSystem::Search(const Diligent::Char *SearchPattern) +{ + UNSUPPORTED( "Not implemented" ); + return std::vector<std::unique_ptr<FindFileData>>(); +} diff --git a/Platforms/Basic/build/Windows/BasicPlatform-Debug.vgdbsettings b/Platforms/Basic/build/Windows/BasicPlatform-Debug.vgdbsettings new file mode 100644 index 00000000..3f5b24b1 --- /dev/null +++ b/Platforms/Basic/build/Windows/BasicPlatform-Debug.vgdbsettings @@ -0,0 +1,76 @@ +<?xml version="1.0"?> +<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <ConfigurationName>Debug</ConfigurationName> + <Project xsi:type="com.visualgdb.project.android"> + <CustomSourceDirectories> + <Directories /> + <PathStyle>MinGWWindowsSlash</PathStyle> + </CustomSourceDirectories> + <AndroidProjectPath>$(ProjectDir)</AndroidProjectPath> + </Project> + <Build xsi:type="com.visualgdb.build.android"> + <AndroidPlatform>android-19</AndroidPlatform> + <IsDebugConfiguration>true</IsDebugConfiguration> + <JNIOnlyBuild>true</JNIOnlyBuild> + <AdditionalDirectoriesToDeleteOnClean>bin;obj</AdditionalDirectoriesToDeleteOnClean> + <DeleteANTFilesOnClean>false</DeleteANTFilesOnClean> + <DoNotEditAndroidManifest>false</DoNotEditAndroidManifest> + <CustomActions /> + </Build> + <Debug xsi:type="com.visualgdb.debug.android"> + <AdditionalStartupCommands /> + <AdditionalGDBSettings> + <FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications> + <ForceSingleThreadedMode>false</ForceSingleThreadedMode> + <PendingBreakpointsSupported>true</PendingBreakpointsSupported> + <DisableChildRanges>false</DisableChildRanges> + <UseAppleExtensions>false</UseAppleExtensions> + <CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning> + <MakeLogFile>false</MakeLogFile> + <IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping> + <UseRelativePathsOnly>false</UseRelativePathsOnly> + <ExitAction>KillApp</ExitAction> + <Features> + <DisableAutoDetection>false</DisableAutoDetection> + <UseFrameParameter>false</UseFrameParameter> + <SimpleValuesFlagSupported>false</SimpleValuesFlagSupported> + <ListLocalsSupported>false</ListLocalsSupported> + <ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable> + <ThreadInfoSupported>false</ThreadInfoSupported> + <PendingBreakpointsSupported>false</PendingBreakpointsSupported> + <SupportTargetCommand>false</SupportTargetCommand> + </Features> + <DisableDisassembly>false</DisableDisassembly> + <ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand> + <StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry> + <ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat> + </AdditionalGDBSettings> + <LaunchGDBSettings xsi:type="GDBLaunchParametersAndroid" /> + <GenerateCtrlBreakInsteadOfCtrlC>false</GenerateCtrlBreakInsteadOfCtrlC> + <UseDefaultInstallDir>false</UseDefaultInstallDir> + <RemotePort>5039</RemotePort> + <LocalPort>5039</LocalPort> + <GDBServerStartupTimeout>10000</GDBServerStartupTimeout> + <AdditionalGDBServerStartupDelay>0</AdditionalGDBServerStartupDelay> + <DoubleSlashWorkaround>false</DoubleSlashWorkaround> + <AlreadyRunningDecision>Ask</AlreadyRunningDecision> + <ShowLogCat>true</ShowLogCat> + <EnableThreadNameWatcher>true</EnableThreadNameWatcher> + </Debug> + <CustomBuild> + <PreBuildActions /> + <PostBuildActions /> + <PreCleanActions /> + <PostCleanActions /> + </CustomBuild> + <CustomDebug> + <PreDebugActions /> + <PostDebugActions /> + <BreakMode>Default</BreakMode> + </CustomDebug> + <CustomShortcuts> + <Shortcuts /> + <ShowMessageAfterExecuting>true</ShowMessageAfterExecuting> + </CustomShortcuts> + <UserDefinedVariables /> +</VisualGDBProjectSettings2>
\ No newline at end of file diff --git a/Platforms/Basic/build/Windows/BasicPlatform-Release.vgdbsettings b/Platforms/Basic/build/Windows/BasicPlatform-Release.vgdbsettings new file mode 100644 index 00000000..669691f2 --- /dev/null +++ b/Platforms/Basic/build/Windows/BasicPlatform-Release.vgdbsettings @@ -0,0 +1,76 @@ +<?xml version="1.0"?> +<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <ConfigurationName>Release</ConfigurationName> + <Project xsi:type="com.visualgdb.project.android"> + <CustomSourceDirectories> + <Directories /> + <PathStyle>MinGWWindowsSlash</PathStyle> + </CustomSourceDirectories> + <AndroidProjectPath>$(ProjectDir)</AndroidProjectPath> + </Project> + <Build xsi:type="com.visualgdb.build.android"> + <AndroidPlatform>android-19</AndroidPlatform> + <IsDebugConfiguration>false</IsDebugConfiguration> + <JNIOnlyBuild>true</JNIOnlyBuild> + <AdditionalDirectoriesToDeleteOnClean>bin;obj</AdditionalDirectoriesToDeleteOnClean> + <DeleteANTFilesOnClean>false</DeleteANTFilesOnClean> + <DoNotEditAndroidManifest>false</DoNotEditAndroidManifest> + <CustomActions /> + </Build> + <Debug xsi:type="com.visualgdb.debug.android"> + <AdditionalStartupCommands /> + <AdditionalGDBSettings> + <FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications> + <ForceSingleThreadedMode>false</ForceSingleThreadedMode> + <PendingBreakpointsSupported>true</PendingBreakpointsSupported> + <DisableChildRanges>false</DisableChildRanges> + <UseAppleExtensions>false</UseAppleExtensions> + <CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning> + <MakeLogFile>false</MakeLogFile> + <IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping> + <UseRelativePathsOnly>false</UseRelativePathsOnly> + <ExitAction>KillApp</ExitAction> + <Features> + <DisableAutoDetection>false</DisableAutoDetection> + <UseFrameParameter>false</UseFrameParameter> + <SimpleValuesFlagSupported>false</SimpleValuesFlagSupported> + <ListLocalsSupported>false</ListLocalsSupported> + <ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable> + <ThreadInfoSupported>false</ThreadInfoSupported> + <PendingBreakpointsSupported>false</PendingBreakpointsSupported> + <SupportTargetCommand>false</SupportTargetCommand> + </Features> + <DisableDisassembly>false</DisableDisassembly> + <ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand> + <StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry> + <ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat> + </AdditionalGDBSettings> + <LaunchGDBSettings xsi:type="GDBLaunchParametersAndroid" /> + <GenerateCtrlBreakInsteadOfCtrlC>false</GenerateCtrlBreakInsteadOfCtrlC> + <UseDefaultInstallDir>false</UseDefaultInstallDir> + <RemotePort>5039</RemotePort> + <LocalPort>5039</LocalPort> + <GDBServerStartupTimeout>10000</GDBServerStartupTimeout> + <AdditionalGDBServerStartupDelay>0</AdditionalGDBServerStartupDelay> + <DoubleSlashWorkaround>false</DoubleSlashWorkaround> + <AlreadyRunningDecision>Ask</AlreadyRunningDecision> + <ShowLogCat>true</ShowLogCat> + <EnableThreadNameWatcher>true</EnableThreadNameWatcher> + </Debug> + <CustomBuild> + <PreBuildActions /> + <PostBuildActions /> + <PreCleanActions /> + <PostCleanActions /> + </CustomBuild> + <CustomDebug> + <PreDebugActions /> + <PostDebugActions /> + <BreakMode>Default</BreakMode> + </CustomDebug> + <CustomShortcuts> + <Shortcuts /> + <ShowMessageAfterExecuting>true</ShowMessageAfterExecuting> + </CustomShortcuts> + <UserDefinedVariables /> +</VisualGDBProjectSettings2>
\ No newline at end of file diff --git a/Platforms/Basic/build/Windows/BasicPlatform.props b/Platforms/Basic/build/Windows/BasicPlatform.props new file mode 100644 index 00000000..a8cf5f7f --- /dev/null +++ b/Platforms/Basic/build/Windows/BasicPlatform.props @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ImportGroup Label="PropertySheets" /> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <IncludePath>$(EngineRoot)\Platforms\Basic\include;$(EngineRoot)\Platforms\interface;$(EngineRoot)\Common\interface;$(EngineRoot)\Common\include;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath> + </PropertyGroup> + <ItemDefinitionGroup /> + <ItemGroup /> +</Project>
\ No newline at end of file diff --git a/Platforms/Basic/build/Windows/BasicPlatform.vcxproj b/Platforms/Basic/build/Windows/BasicPlatform.vcxproj new file mode 100644 index 00000000..034f6fa0 --- /dev/null +++ b/Platforms/Basic/build/Windows/BasicPlatform.vcxproj @@ -0,0 +1,173 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|ARM"> + <Configuration>Debug</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|ARM"> + <Configuration>Release</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{8ADA5F93-7A38-4AD8-B8F5-1FFD4D4F630C}</ProjectGuid> + <RootNamespace>PlatformCommon</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <PlatformToolset>v120</PlatformToolset> + <ConfigurationType>Makefile</ConfigurationType> + </PropertyGroup> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <PlatformToolset>v120</PlatformToolset> + <ConfigurationType>Makefile</ConfigurationType> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + <Import Project="..\WindowsStore\BasicPlatform.Shared\BasicPlatform.Shared.vcxitems" Label="Shared" Condition="Exists('..\WindowsStore\BasicPlatform.Shared\BasicPlatform.Shared.vcxitems')" /> + </ImportGroup> + <ImportGroup Label="Shared"> + <Import Project="..\..\..\interface\build\WindowsStore\PlatformInterface.Shared.vcxitems" Label="Shared" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\Shared\build\Windows\Win32d.props" /> + <Import Project="EngineRoot.props" /> + <Import Project="BasicPlatform.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\Shared\build\Windows\Win64d.props" /> + <Import Project="EngineRoot.props" /> + <Import Project="BasicPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\Shared\build\Windows\Win32r.props" /> + <Import Project="EngineRoot.props" /> + <Import Project="BasicPlatform.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\Shared\build\Windows\Win64r.props" /> + <Import Project="EngineRoot.props" /> + <Import Project="BasicPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <Import Project="..\..\..\..\Shared\build\Windows\Android32d.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <Import Project="..\..\..\..\Shared\build\Windows\Android32r.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <None Include="jni\Android.mk" /> + <None Include="jni\Application.mk" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\BasicFileSystem.cpp"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> + </ClCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Basic/build/Windows/BasicPlatform.vcxproj.filters b/Platforms/Basic/build/Windows/BasicPlatform.vcxproj.filters new file mode 100644 index 00000000..bce03812 --- /dev/null +++ b/Platforms/Basic/build/Windows/BasicPlatform.vcxproj.filters @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="jni"> + <UniqueIdentifier>{fbef7424-2a7d-4879-b301-6b7e61c3571d}</UniqueIdentifier> + </Filter> + <Filter Include="android_src"> + <UniqueIdentifier>{fcd7c682-f6f2-45ed-9bd8-dabd9bf9db06}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <None Include="jni\Application.mk"> + <Filter>jni</Filter> + </None> + <None Include="jni\Android.mk"> + <Filter>jni</Filter> + </None> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\BasicFileSystem.cpp"> + <Filter>android_src</Filter> + </ClCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Basic/build/Windows/EngineRoot.props b/Platforms/Basic/build/Windows/EngineRoot.props new file mode 100644 index 00000000..c2337431 --- /dev/null +++ b/Platforms/Basic/build/Windows/EngineRoot.props @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ImportGroup Label="PropertySheets" /> + <PropertyGroup Label="UserMacros"> + <EngineRoot>..\..\..\..</EngineRoot> + </PropertyGroup> + <PropertyGroup /> + <ItemDefinitionGroup /> + <ItemGroup> + <BuildMacro Include="EngineRoot"> + <Value>$(EngineRoot)</Value> + </BuildMacro> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Basic/build/Windows/jni/Android.mk b/Platforms/Basic/build/Windows/jni/Android.mk new file mode 100644 index 00000000..2eb21c09 --- /dev/null +++ b/Platforms/Basic/build/Windows/jni/Android.mk @@ -0,0 +1,26 @@ +# Android NDK project makefile autogenerated by Premake + +# Preamble +DEPENDENCY_PATH := $(call my-dir) +LOCAL_PATH := $(abspath $(DEPENDENCY_PATH)) +include $(CLEAR_VARS) + + +# Project configuration +LOCAL_MODULE := BasicPlatform +LOCAL_CFLAGS := -std=c++11 +LOCAL_CPP_FEATURES := exceptions +LOCAL_STATIC_LIBRARIES += ndk_helper native_app_glue + +# Include paths +SOLUTION_ROOT := $(LOCAL_PATH)/../../../../.. +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../include $(LOCAL_PATH)/../../../../interface $(SOLUTION_ROOT)/Common/include $(SOLUTION_ROOT)/Common/interface + +# Source files +#VisualGDBAndroid: AutoUpdateSourcesInNextLine +LOCAL_SRC_FILES := ../../../src/BasicFileSystem.cpp + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,android/ndk_helper) +$(call import-module,android/native_app_glue) diff --git a/Platforms/Basic/build/Windows/jni/Application.mk b/Platforms/Basic/build/Windows/jni/Application.mk new file mode 100644 index 00000000..6e6b4a7e --- /dev/null +++ b/Platforms/Basic/build/Windows/jni/Application.mk @@ -0,0 +1,7 @@ +# Generated by VisualGDB + +DEPENDENCY_PATH := $(call my-dir) +LOCAL_PATH := $(abspath $(DEPENDENCY_PATH)) +include $(LOCAL_PATH)/../../../../../Common/make/AppCommon.mk + +APP_MODULES := BasicPlatform
\ No newline at end of file diff --git a/Platforms/Basic/build/WindowsStore/BasicPlatform.Shared/BasicPlatform.Shared.vcxitems b/Platforms/Basic/build/WindowsStore/BasicPlatform.Shared/BasicPlatform.Shared.vcxitems new file mode 100644 index 00000000..195ea80f --- /dev/null +++ b/Platforms/Basic/build/WindowsStore/BasicPlatform.Shared/BasicPlatform.Shared.vcxitems @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup Label="Globals"> + <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> + <HasSharedItems>true</HasSharedItems> + <ItemsProjectGuid>{c50f6528-6a12-49a9-bec0-e07cf153fca8}</ItemsProjectGuid> + <ItemsRootNamespace>BasicPlatform</ItemsRootNamespace> + <ItemsProjectName>BasicPlatform.Shared</ItemsProjectName> + <CodeSharingProject>248F659F-DAC5-46E8-AC09-60EC9FC95053</CodeSharingProject> + </PropertyGroup> + <ItemDefinitionGroup> + <ClCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories> + </ClCompile> + </ItemDefinitionGroup> + <ItemGroup> + <ProjectCapability Include="SourceItemsFromImports" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\src\BasicFileSystem.cpp" /> + <ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\src\pch.cpp"> + <PrecompiledHeader>Create</PrecompiledHeader> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\BasicAtomics.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\BasicPlatformDebug.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\BasicFileSystem.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\BasicPlatformMisc.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\pch.h" /> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Basic/build/WindowsStore/BasicPlatform.Shared/BasicPlatform.Shared.vcxitems.filters b/Platforms/Basic/build/WindowsStore/BasicPlatform.Shared/BasicPlatform.Shared.vcxitems.filters new file mode 100644 index 00000000..38335184 --- /dev/null +++ b/Platforms/Basic/build/WindowsStore/BasicPlatform.Shared/BasicPlatform.Shared.vcxitems.filters @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="include"> + <UniqueIdentifier>{6cd2ad8c-c15c-4156-aa37-d00759bc0611}</UniqueIdentifier> + </Filter> + <Filter Include="src"> + <UniqueIdentifier>{b0ccce69-d437-4e82-ae8e-a33f1581f7ed}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\src\BasicFileSystem.cpp"> + <Filter>src</Filter> + </ClCompile> + <ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\src\pch.cpp"> + <Filter>src</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\BasicFileSystem.h"> + <Filter>include</Filter> + </ClInclude> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\BasicAtomics.h"> + <Filter>include</Filter> + </ClInclude> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\pch.h"> + <Filter>include</Filter> + </ClInclude> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\BasicPlatformDebug.h"> + <Filter>include</Filter> + </ClInclude> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\BasicPlatformMisc.h"> + <Filter>include</Filter> + </ClInclude> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Basic/build/WindowsStore/BasicPlatform.Windows/BasicPlatform.Windows.vcxproj b/Platforms/Basic/build/WindowsStore/BasicPlatform.Windows/BasicPlatform.Windows.vcxproj new file mode 100644 index 00000000..a1afa627 --- /dev/null +++ b/Platforms/Basic/build/WindowsStore/BasicPlatform.Windows/BasicPlatform.Windows.vcxproj @@ -0,0 +1,207 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|ARM"> + <Configuration>Debug</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|ARM"> + <Configuration>Release</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{3f28c683-66ad-42ca-a264-b18d0743f518}</ProjectGuid> + <RootNamespace>BasicPlatform</RootNamespace> + <DefaultLanguage>en-US</DefaultLanguage> + <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion> + <AppContainerApplication>true</AppContainerApplication> + <ApplicationType>Windows Store</ApplicationType> + <ApplicationTypeRevision>8.1</ApplicationTypeRevision> + <ConvergedProjectType>CodeSharingStaticLibrary</ConvergedProjectType> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <Import Project="..\BasicPlatform.Shared\BasicPlatform.Shared.vcxitems" Label="Shared" /> + <Import Project="..\..\..\..\interface\build\WindowsStore\PlatformInterface.Shared.vcxitems" Label="Shared" /> + <ImportGroup Label="Shared" /> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStore32Dbg.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\Windows\BasicPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStore32Rel.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\Windows\BasicPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStoreArmDbg.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\Windows\BasicPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStoreArmRel.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\Windows\BasicPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStore64Dbg.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\Windows\BasicPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStore64Rel.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\Windows\BasicPlatform.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Basic/build/WindowsStore/BasicPlatform.Windows/BasicPlatform.Windows.vcxproj.filters b/Platforms/Basic/build/WindowsStore/BasicPlatform.Windows/BasicPlatform.Windows.vcxproj.filters new file mode 100644 index 00000000..a7761ab0 --- /dev/null +++ b/Platforms/Basic/build/WindowsStore/BasicPlatform.Windows/BasicPlatform.Windows.vcxproj.filters @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + </ItemGroup> +</Project> diff --git a/Platforms/Basic/build/WindowsStore/BasicPlatform.WindowsPhone/BasicPlatform.WindowsPhone.vcxproj b/Platforms/Basic/build/WindowsStore/BasicPlatform.WindowsPhone/BasicPlatform.WindowsPhone.vcxproj new file mode 100644 index 00000000..083b6ab1 --- /dev/null +++ b/Platforms/Basic/build/WindowsStore/BasicPlatform.WindowsPhone/BasicPlatform.WindowsPhone.vcxproj @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|ARM"> + <Configuration>Debug</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|ARM"> + <Configuration>Release</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{6b4cf863-1024-45e2-ba7e-263de516468b}</ProjectGuid> + <RootNamespace>BasicPlatform</RootNamespace> + <DefaultLanguage>en-US</DefaultLanguage> + <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion> + <AppContainerApplication>true</AppContainerApplication> + <ApplicationType>Windows Phone</ApplicationType> + <ApplicationTypeRevision>8.1</ApplicationTypeRevision> + <ConvergedProjectType>CodeSharingStaticLibrary</ConvergedProjectType> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120_wp81</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120_wp81</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v120_wp81</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v120_wp81</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <Import Project="..\BasicPlatform.Shared\BasicPlatform.Shared.vcxitems" Label="Shared" /> + <Import Project="..\..\..\..\interface\build\WindowsStore\PlatformInterface.Shared.vcxitems" Label="Shared" /> + <ImportGroup Label="Shared" /> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStore32Dbg.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\Windows\BasicPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStore32Rel.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\Windows\BasicPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStoreArmDbg.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\Windows\BasicPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStoreArmRel.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\Windows\BasicPlatform.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <GenerateManifest>false</GenerateManifest> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Basic/build/WindowsStore/BasicPlatform.WindowsPhone/BasicPlatform.WindowsPhone.vcxproj.filters b/Platforms/Basic/build/WindowsStore/BasicPlatform.WindowsPhone/BasicPlatform.WindowsPhone.vcxproj.filters new file mode 100644 index 00000000..a7761ab0 --- /dev/null +++ b/Platforms/Basic/build/WindowsStore/BasicPlatform.WindowsPhone/BasicPlatform.WindowsPhone.vcxproj.filters @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + </ItemGroup> +</Project> diff --git a/Platforms/Basic/build/WindowsStore/EngineRoot.props b/Platforms/Basic/build/WindowsStore/EngineRoot.props new file mode 100644 index 00000000..7020603b --- /dev/null +++ b/Platforms/Basic/build/WindowsStore/EngineRoot.props @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ImportGroup Label="PropertySheets" /> + <PropertyGroup Label="UserMacros"> + <EngineRoot>..\..\..\..\..</EngineRoot> + </PropertyGroup> + <PropertyGroup /> + <ItemDefinitionGroup /> + <ItemGroup> + <BuildMacro Include="EngineRoot"> + <Value>$(EngineRoot)</Value> + </BuildMacro> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Basic/include/BasicAtomics.h b/Platforms/Basic/include/BasicAtomics.h new file mode 100644 index 00000000..492851a5 --- /dev/null +++ b/Platforms/Basic/include/BasicAtomics.h @@ -0,0 +1,65 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include <atomic> + +struct BasicAtomics +{ + typedef long Long; + typedef std::atomic<Long> AtomicLong; + typedef std::atomic<int64_t> AtomicInt64; + + // The function returns the resulting INCREMENTED value. + template<typename Type> + static inline Type AtomicIncrement(std::atomic<Type> &Val) + { + return ++Val; + } + + // The function returns the resulting DECREMENTED value. + template<typename Type> + static inline Type AtomicDecrement(std::atomic<Type> &Val) + { + return --Val; + } + + // The function compares the Destination value with the Comparand value. If the Destination value is equal + // to the Comparand value, the Exchange value is stored in the address specified by Destination. + // Otherwise, no operation is performed. + // The function returns the initial value of the Destination parameter + template<typename Type> + static inline Type AtomicCompareExchange( std::atomic<Type> &Destination, Type Exchange, Type Comparand) + { + Destination.compare_exchange_strong(Comparand, Exchange); + return Comparand; + } + + template<typename Type> + static inline Type AtomicAdd( std::atomic<Type> &Destination, Type Val) + { + return std::atomic_fetch_add(&Destination, Val); + } + +}; diff --git a/Platforms/Basic/include/BasicFileSystem.h b/Platforms/Basic/include/BasicFileSystem.h new file mode 100644 index 00000000..8d083aea --- /dev/null +++ b/Platforms/Basic/include/BasicFileSystem.h @@ -0,0 +1,103 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include <vector> +#include "BasicTypes.h" +#include "DataBlob.h" + +enum class EFileAccessMode +{ + Read, + Overwrite, + Append +}; + +enum class FilePosOrigin +{ + Start, + Curr, + End +}; + + +struct FileOpenAttribs +{ + const Diligent::Char *strFilePath; + EFileAccessMode AccessMode; + FileOpenAttribs(const Diligent::Char *Path = nullptr, + EFileAccessMode Access = EFileAccessMode::Read) : + strFilePath( Path ), + AccessMode( Access ) + {} +}; + +class BasicFile +{ +public: + BasicFile( const FileOpenAttribs &OpenAttribs, Diligent::Char SlashSymbol ); + virtual ~BasicFile(); + + size_t GetSize(); + + const Diligent::String& GetPath(){ return m_Path; } + +protected: + Diligent::String GetOpenModeStr(); + + FileOpenAttribs m_OpenAttribs; + Diligent::String m_Path; +}; + +struct FindFileData +{ + virtual const Diligent::Char* Name()const = 0; + virtual bool IsDirectory()const = 0; + + virtual ~FindFileData(){} +}; + +struct BasicFileSystem +{ +public: + static BasicFile* OpenFile( FileOpenAttribs &OpenAttribs ); + static void ReleaseFile( BasicFile* ); + + static std::string GetFullPath( const Diligent::Char *strFilePath ); + + static bool FileExists( const Diligent::Char *strFilePath ); + + static void SetWorkingDirectory( const Diligent::Char *strWorkingDir ){ m_strWorkingDirectory = strWorkingDir; } + static const Diligent::String &GetWorkingDirectory(){ return m_strWorkingDirectory; } + + static Diligent::Char GetSlashSymbol(); + static void CorrectSlashes(Diligent::String &Path, Diligent::Char SlashSymbol); + + static void SplitFilePath(const Diligent::String& FullName, + Diligent::String *Path, + Diligent::String *Name); + +protected: + static Diligent::String m_strWorkingDirectory; +}; diff --git a/Platforms/Basic/include/BasicPlatformDebug.h b/Platforms/Basic/include/BasicPlatformDebug.h new file mode 100644 index 00000000..e08433f8 --- /dev/null +++ b/Platforms/Basic/include/BasicPlatformDebug.h @@ -0,0 +1,40 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "BasicTypes.h" + +struct BasicPlatformDebug +{ + enum class DebugMessageSeverity + { + Info, + Warning, + Error, + FatalError + }; + + static void AssertionFailed( const Diligent::Char* /*Message*/, const char* /*Function*/, const char* /*File*/, int /*Line*/ ){} + static void OutputDebugMessage( DebugMessageSeverity /*Severity*/, const Diligent::Char* /*Message */){} +}; diff --git a/Platforms/Basic/include/BasicPlatformMisc.h b/Platforms/Basic/include/BasicPlatformMisc.h new file mode 100644 index 00000000..39c0b105 --- /dev/null +++ b/Platforms/Basic/include/BasicPlatformMisc.h @@ -0,0 +1,40 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "BasicTypes.h" + +struct BasicPlatformMisc +{ + static Diligent::Uint32 GetMSB(Diligent::Uint32 Val) + { + if( Val == 0 )return 32; + + Diligent::Uint32 MSB = 31; + while( !(Val & (1 << MSB)) ) + --MSB; + + return MSB; + } +}; diff --git a/Platforms/Basic/include/pch.h b/Platforms/Basic/include/pch.h new file mode 100644 index 00000000..53b5f663 --- /dev/null +++ b/Platforms/Basic/include/pch.h @@ -0,0 +1,27 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "BasicAtomics.h" +#include "BasicFileSystem.h"
\ No newline at end of file diff --git a/Platforms/Basic/src/BasicFileSystem.cpp b/Platforms/Basic/src/BasicFileSystem.cpp new file mode 100644 index 00000000..4bc5536b --- /dev/null +++ b/Platforms/Basic/src/BasicFileSystem.cpp @@ -0,0 +1,124 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#include "pch.h" +#include "BasicFileSystem.h" +#include "DebugUtilities.h" +#include <algorithm> + +Diligent::String BasicFileSystem::m_strWorkingDirectory; + +BasicFile::BasicFile( const FileOpenAttribs &OpenAttribs, Diligent::Char SlashSymbol ) : + m_OpenAttribs(OpenAttribs), + m_Path( BasicFileSystem::GetFullPath(OpenAttribs.strFilePath) ) +{ + BasicFileSystem::CorrectSlashes(m_Path, SlashSymbol); + + m_OpenAttribs.strFilePath = m_Path.c_str(); +} + +BasicFile::~BasicFile() +{ +} + +Diligent::String BasicFile::GetOpenModeStr() +{ + std::string OpenModeStr; + switch(m_OpenAttribs.AccessMode) + { + case EFileAccessMode::Read: OpenModeStr += 'r'; break; + case EFileAccessMode::Overwrite: OpenModeStr += 'w'; break; + case EFileAccessMode::Append: OpenModeStr += 'a'; break; + default: break; + } + + // Always open file in binary mode. Text mode is platform-specific + OpenModeStr += 'b'; + + return OpenModeStr; +} + + +std::string BasicFileSystem::GetFullPath( const Diligent::Char *strFilePath ) +{ + std::string FullPath = m_strWorkingDirectory; + auto len = FullPath.length(); + if( len>0 && FullPath[len - 1] != '\\' ) + { + FullPath += '\\'; + } + FullPath += strFilePath; + return FullPath; +} + +BasicFile* BasicFileSystem::OpenFile( FileOpenAttribs &OpenAttribs ) +{ + return nullptr; +} + +void BasicFileSystem::ReleaseFile( BasicFile * pFile) +{ + if( pFile ) + delete pFile; +} + +bool BasicFileSystem::FileExists( const Diligent::Char *strFilePath ) +{ + return false; +} + +Diligent::Char BasicFileSystem::GetSlashSymbol() +{ + UNSUPPORTED( "Unsupported" ); + return 0; +} + +void BasicFileSystem::CorrectSlashes( Diligent::String &Path, Diligent::Char SlashSymbol ) +{ + VERIFY( SlashSymbol == '\\' || SlashSymbol == '/', + "Incorrect slash symbol" ); + Diligent::Char RevSlashSym = (SlashSymbol == '\\') ? '/' : '\\'; + std::replace( Path.begin(), Path.end(), RevSlashSym, SlashSymbol); +} + +void BasicFileSystem::SplitFilePath(const Diligent::String& FullName, + Diligent::String *Path, + Diligent::String *Name) +{ + auto LastSlashPos = FullName.find_last_of( "/\\" ); + if( Path ) + { + if( LastSlashPos != Diligent::String::npos ) + *Path = FullName.substr( 0, LastSlashPos ); + else + *Path = ""; + } + + if( Name ) + { + if( LastSlashPos != Diligent::String::npos ) + *Name = FullName.substr( LastSlashPos+1 ); + else + *Path = FullName; + } +} diff --git a/Platforms/Basic/src/pch.cpp b/Platforms/Basic/src/pch.cpp new file mode 100644 index 00000000..809315e1 --- /dev/null +++ b/Platforms/Basic/src/pch.cpp @@ -0,0 +1,24 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#include "pch.h" diff --git a/Platforms/Windows/build/Windows/EngineRoot.props b/Platforms/Windows/build/Windows/EngineRoot.props new file mode 100644 index 00000000..c2337431 --- /dev/null +++ b/Platforms/Windows/build/Windows/EngineRoot.props @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ImportGroup Label="PropertySheets" /> + <PropertyGroup Label="UserMacros"> + <EngineRoot>..\..\..\..</EngineRoot> + </PropertyGroup> + <PropertyGroup /> + <ItemDefinitionGroup /> + <ItemGroup> + <BuildMacro Include="EngineRoot"> + <Value>$(EngineRoot)</Value> + </BuildMacro> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Windows/build/Windows/WindowsPlatform.props b/Platforms/Windows/build/Windows/WindowsPlatform.props new file mode 100644 index 00000000..2287b6b6 --- /dev/null +++ b/Platforms/Windows/build/Windows/WindowsPlatform.props @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ImportGroup Label="PropertySheets" /> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <IncludePath>$(EngineRoot)\Platforms\interface;$(EngineRoot)\Common\interface;$(EngineRoot)\Common\include;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath> + </PropertyGroup> + <ItemDefinitionGroup /> + <ItemGroup /> +</Project>
\ No newline at end of file diff --git a/Platforms/Windows/build/Windows/WindowsPlatform.vcxproj b/Platforms/Windows/build/Windows/WindowsPlatform.vcxproj new file mode 100644 index 00000000..16cf586b --- /dev/null +++ b/Platforms/Windows/build/Windows/WindowsPlatform.vcxproj @@ -0,0 +1,164 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\include\pch.h" /> + <ClInclude Include="..\..\include\WindowsDebug.h" /> + <ClInclude Include="..\..\include\WindowsFileSystem.h" /> + <ClInclude Include="..\..\include\WindowsPlatformDefinitions.h" /> + <ClInclude Include="..\..\include\WindowsPlatformMisc.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\pch.cpp"> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> + </ClCompile> + <ClCompile Include="..\..\src\WindowsDebug.cpp" /> + <ClCompile Include="..\..\src\WindowsFileSystem.cpp" /> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{58F32677-436B-412A-BBF8-2B1310D82CD8}</ProjectGuid> + <RootNamespace>WindowsPlatform</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\Shared\build\Windows\Win32d.props" /> + <Import Project="EngineRoot.props" /> + <Import Project="WindowsPlatform.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\Shared\build\Windows\Win64d.props" /> + <Import Project="EngineRoot.props" /> + <Import Project="WindowsPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\Shared\build\Windows\Win32r.props" /> + <Import Project="EngineRoot.props" /> + <Import Project="WindowsPlatform.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\Shared\build\Windows\Win64r.props" /> + <Import Project="EngineRoot.props" /> + <Import Project="WindowsPlatform.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <IncludePath>$(EngineRoot)\Platforms\Windows\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <IncludePath>$(EngineRoot)\Platforms\Windows\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <IncludePath>$(EngineRoot)\Platforms\Windows\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <IncludePath>$(EngineRoot)\Platforms\Windows\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Windows/build/Windows/WindowsPlatform.vcxproj.filters b/Platforms/Windows/build/Windows/WindowsPlatform.vcxproj.filters new file mode 100644 index 00000000..0ff7b20a --- /dev/null +++ b/Platforms/Windows/build/Windows/WindowsPlatform.vcxproj.filters @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\include\WindowsPlatformDefinitions.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\include\WindowsFileSystem.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\include\pch.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\include\WindowsDebug.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\include\WindowsPlatformMisc.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\WindowsFileSystem.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\pch.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\src\WindowsDebug.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/Windows/include/WindowsDebug.h b/Platforms/Windows/include/WindowsDebug.h new file mode 100644 index 00000000..d29a4d5b --- /dev/null +++ b/Platforms/Windows/include/WindowsDebug.h @@ -0,0 +1,32 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "..\Basic\include\BasicPlatformDebug.h" + +struct WindowsDebug : public BasicPlatformDebug +{ + static void AssertionFailed( const Diligent::Char *Message, const char *Function, const char *File, int Line ); + static void OutputDebugMessage( DebugMessageSeverity Severity, const Diligent::Char *Message ); +}; diff --git a/Platforms/Windows/include/WindowsFileSystem.h b/Platforms/Windows/include/WindowsFileSystem.h new file mode 100644 index 00000000..3dd4c00d --- /dev/null +++ b/Platforms/Windows/include/WindowsFileSystem.h @@ -0,0 +1,65 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "..\Basic\include\BasicFileSystem.h" +#include <memory> + +class WindowsFile : public BasicFile +{ +public: + WindowsFile( const FileOpenAttribs &OpenAttribs ); + ~WindowsFile(); + + void Read( Diligent::IDataBlob *pData ); + + bool Read( void *Data, size_t BufferSize ); + + bool Write( const void *Data, size_t BufferSize ); + + size_t GetSize(); + + size_t GetPos(); + + void SetPos(size_t Offset, FilePosOrigin Origin); + +private: + FILE *m_pFile; +}; + + +struct WindowsFileSystem : public BasicFileSystem +{ +public: + static WindowsFile* OpenFile( const FileOpenAttribs &OpenAttribs ); + static inline Diligent::Char GetSlashSymbol(){ return '\\'; } + + static bool FileExists( const Diligent::Char *strFilePath ); + static bool PathExists( const Diligent::Char *strPath ); + + static bool CreateDirectory( const Diligent::Char *strPath ); + static void ClearDirectory( const Diligent::Char *strPath ); + static void DeleteFile( const Diligent::Char *strPath ); + static std::vector<std::unique_ptr<FindFileData>> Search(const Diligent::Char *SearchPattern); +}; diff --git a/Platforms/Windows/include/WindowsPlatformDefinitions.h b/Platforms/Windows/include/WindowsPlatformDefinitions.h new file mode 100644 index 00000000..7f6a56e3 --- /dev/null +++ b/Platforms/Windows/include/WindowsPlatformDefinitions.h @@ -0,0 +1,25 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + diff --git a/Platforms/Windows/include/WindowsPlatformMisc.h b/Platforms/Windows/include/WindowsPlatformMisc.h new file mode 100644 index 00000000..1da47345 --- /dev/null +++ b/Platforms/Windows/include/WindowsPlatformMisc.h @@ -0,0 +1,43 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "..\Basic\include\BasicPlatformMisc.h" +#include "DebugUtilities.h" + +#include <intrin.h> + +struct WindowsMisc : public BasicPlatformMisc +{ + static Diligent::Uint32 GetMSB(Diligent::Uint32 Val) + { + if( Val == 0 )return 32; + + unsigned long MSB = 32; + _BitScanReverse(&MSB, Val); + VERIFY_EXPR(MSB == BasicPlatformMisc::GetMSB(Val)); + + return MSB; + } +}; diff --git a/Platforms/Windows/include/pch.h b/Platforms/Windows/include/pch.h new file mode 100644 index 00000000..3234e05f --- /dev/null +++ b/Platforms/Windows/include/pch.h @@ -0,0 +1,29 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +// Do not include <Windows.h> here as this will +// mess up names in file system implementation! +#include "PlatformDefinitions.h" +#include "DebugUtilities.h" diff --git a/Platforms/Windows/src/WindowsDebug.cpp b/Platforms/Windows/src/WindowsDebug.cpp new file mode 100644 index 00000000..61ccb18a --- /dev/null +++ b/Platforms/Windows/src/WindowsDebug.cpp @@ -0,0 +1,88 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#include "pch.h" + +#include "WindowsDebug.h" +#include "FormatMessage.h" +#include "FileSystem.h" +#include <csignal> +#include <iostream> +#include <Windows.h> + +using namespace Diligent; + +void WindowsDebug :: AssertionFailed( const Diligent::Char *Message, const char *Function, const char *File, int Line ) +{ + std::string FileName; + FileSystem::SplitFilePath( File, nullptr, &FileName ); + std::stringstream msgss; + Diligent::FormatMsg( msgss, "Debug assertion failed in ", Function, "(), file ", FileName, ", line ", Line, ":\n"); + auto Msg = msgss.str(); + String DebugOutput = Msg + Message; + OutputDebugMessage( DebugMessageSeverity::Error, DebugOutput.c_str()); + + String MBText = Msg + "\n" + Message; + int nCode = MessageBoxA(NULL, + MBText.c_str(), + "Runtime assertion failed", + MB_TASKMODAL|MB_ICONHAND|MB_ABORTRETRYIGNORE|MB_SETFOREGROUND); + + // Abort: abort the program + if (nCode == IDABORT) + { + // raise abort signal + raise(SIGABRT); + + // We usually won't get here, but it's possible that + // SIGABRT was ignored. So exit the program anyway. + exit(3); + } + + // Retry: call the debugger + if (nCode == IDRETRY) + { + DebugBreak(); + // return to user code + return; + } + + // Ignore: continue execution + if (nCode == IDIGNORE) + return; +}; + +void WindowsDebug::OutputDebugMessage( DebugMessageSeverity Severity, const Diligent::Char *Message ) +{ + static Char* strSeverities[] = { "Info: ", "Warning: ", "ERROR: ", "CRITICAL ERROR: " }; + auto* MessageSevery = strSeverities[ static_cast<int>(Severity) ]; + String str = MessageSevery; + str += Message; + str += '\n'; + OutputDebugStringA( str.c_str() ); + + if( Severity == DebugMessageSeverity::Error || Severity == DebugMessageSeverity::FatalError ) + std::cerr<<str; + else + std::cout<<str; +} diff --git a/Platforms/Windows/src/WindowsFileSystem.cpp b/Platforms/Windows/src/WindowsFileSystem.cpp new file mode 100644 index 00000000..d31b4bbe --- /dev/null +++ b/Platforms/Windows/src/WindowsFileSystem.cpp @@ -0,0 +1,287 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#include "pch.h" +#include "WindowsFileSystem.h" +#include "Errors.h" + +// We can't use namespace Diligent before #including <Windows.h> because Diligent::INTERFACE_ID will confilct with windows InterfaceID +//using namespace Diligent; + +// Windows.h defines CreateDirectory and DeleteFile as macros. +// So we need to do some tricks to avoid name mess. +bool CreateDirectoryImpl( const Diligent::Char *strPath ); +bool WindowsFileSystem::CreateDirectory( const Diligent::Char *strPath ) +{ + return CreateDirectoryImpl(strPath); +} + +void DeleteFileImpl( const Diligent::Char *strPath ); +void WindowsFileSystem::DeleteFile( const Diligent::Char *strPath ) +{ + DeleteFileImpl(strPath); +} + +#include <Windows.h> +#include "Shlwapi.h" +#pragma comment(lib, "Shlwapi.lib") + +using namespace Diligent; + +WindowsFile::WindowsFile( const FileOpenAttribs &OpenAttribs ) : + BasicFile(OpenAttribs, WindowsFileSystem::GetSlashSymbol()), + m_pFile(nullptr) +{ + auto OpenModeStr = GetOpenModeStr(); + + for( ;; ) + { + errno_t err = fopen_s( &m_pFile, m_OpenAttribs.strFilePath, OpenModeStr.c_str() ); + if( err == 0 ) + { + break; + } + else if( err == ENFILE || // Too many files open in system + err == EMFILE ) // Too many open files + { + // No more file descriptors are available: we have to wait + //g_SystemMetricsStream << "Failed to open file " << FileName; + //g_SystemMetricsStream << "\nWaiting 50 ms...\n"; + Sleep(50); + continue; + } + else + { + char errstr[128]; + strerror_s( errstr, _countof( errstr ), err ); + LOG_ERROR_AND_THROW( "Failed to open file ", m_OpenAttribs.strFilePath, + "\nThe following error occured: ", errstr ); + } + } +} + +WindowsFile::~WindowsFile() +{ + if( m_pFile ) + { + fclose( m_pFile ); + m_pFile = nullptr; + } +} + +void WindowsFile::Read( Diligent::IDataBlob *pData ) +{ + auto FileSize = GetSize(); + pData->Resize(FileSize); + auto Res = Read( pData->GetDataPtr(), pData->GetSize() ); + VERIFY( Res, "Failed to read ", FileSize, " bytes from file" ); +} + +bool WindowsFile::Read( void *Data, size_t BufferSize ) +{ + VERIFY( m_pFile, "File is not opened" ); + if( !m_pFile ) + return 0; + auto BytesRead = fread( Data, 1, BufferSize, m_pFile ); + + return BytesRead == BufferSize; +} + +bool WindowsFile::Write( const void *Data, size_t BufferSize ) +{ + VERIFY( m_pFile, "File is not opened" ); + if( !m_pFile ) + return 0; + auto BytesWritten = fwrite( Data, 1, BufferSize, m_pFile ); + + return BytesWritten == BufferSize; +} + +size_t WindowsFile::GetSize() +{ + auto OrigPos = ftell( m_pFile ); + fseek( m_pFile, 0, SEEK_END ); + auto FileSize = ftell( m_pFile ); + + fseek( m_pFile, OrigPos, SEEK_SET ); + return FileSize; +} + +size_t WindowsFile::GetPos() +{ + VERIFY( m_pFile, "File is not opened" ); + if( !m_pFile ) + return 0; + + return ftell(m_pFile); +} + +void WindowsFile::SetPos(size_t Offset, FilePosOrigin Origin) +{ + VERIFY( m_pFile, "File is not opened" ); + if( !m_pFile ) + return; + + int orig = SEEK_SET; + switch( Origin ) + { + case FilePosOrigin::Start: orig = SEEK_SET; break; + case FilePosOrigin::Curr: orig = SEEK_CUR; break; + case FilePosOrigin::End: orig = SEEK_END; break; + default: UNEXPECTED("Unknown origin"); + } + + fseek(m_pFile, static_cast<long>(Offset), orig); +} + +WindowsFile* WindowsFileSystem::OpenFile( const FileOpenAttribs &OpenAttribs ) +{ + WindowsFile *pFile = nullptr; + try + { + pFile = new WindowsFile( OpenAttribs ); + } + catch( const std::runtime_error &/*err*/ ) + { + + } + + return pFile; +} + +bool WindowsFileSystem::FileExists( const Char *strFilePath ) +{ + FileOpenAttribs OpenAttribs; + OpenAttribs.strFilePath = strFilePath; + BasicFile DummyFile( OpenAttribs, WindowsFileSystem::GetSlashSymbol() ); + const auto& Path = DummyFile.GetPath(); + FILE *pFile = nullptr; + auto err = fopen_s( &pFile, Path.c_str(), "r" ); + bool Exists = (err == 0); + if( Exists && pFile ) + fclose( pFile ); + return Exists; +} + +bool CreateDirectoryImpl( const Char *strPath ) +{ + // Test all parent directories + std::string DirectoryPath = strPath; + std::string::size_type SlashPos = std::wstring::npos; + do + { + SlashPos = DirectoryPath.find( '\\', (SlashPos != std::string::npos) ? SlashPos+1 : 0); + std::string ParentDir = (SlashPos != std::wstring::npos) ? DirectoryPath.substr(0, SlashPos) : DirectoryPath; + if( !WindowsFileSystem::PathExists(ParentDir.c_str()) ) + { + // If there is no directory, create it + if( !::CreateDirectoryA(ParentDir.c_str(), NULL) ) + return false; + } + } + while( SlashPos != std::string::npos ); + + return true; +} + +void WindowsFileSystem::ClearDirectory( const Char *strPath ) +{ + WIN32_FIND_DATA ffd; + HANDLE hFind = INVALID_HANDLE_VALUE; + + // Find the first file in the directory. + std::string Directory ( strPath ); + if( Directory.length() > 0 && Directory.back() != GetSlashSymbol() ) + Directory.push_back( GetSlashSymbol() ); + + auto SearchPattern = Directory + "*"; + hFind = FindFirstFileA( SearchPattern.c_str(), &ffd); + + if (INVALID_HANDLE_VALUE == hFind) + { + LOG_ERROR_AND_THROW("FindFirstFile"); + } + + // List all the files in the directory + do + { + if( !(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ) + { + auto FileName = Directory + ffd.cFileName; + DeleteFileImpl( FileName.c_str() ); + } + } + while( FindNextFile(hFind, &ffd) != 0 ); +} + + +void DeleteFileImpl( const Char *strPath ) +{ + DeleteFileA(strPath); +} + +bool WindowsFileSystem::PathExists( const Char *strPath ) +{ + return PathFileExistsA(strPath) != FALSE; +} + +struct WndFindFileData : public FindFileData +{ + virtual const Char* Name()const override{return ffd.cFileName;} + virtual bool IsDirectory()const override{return (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;} + + WIN32_FIND_DATA ffd; + + WndFindFileData(const WIN32_FIND_DATA& _ffd) : ffd(_ffd){} +}; + +std::vector<std::unique_ptr<FindFileData>> WindowsFileSystem::Search(const Char *SearchPattern) +{ + std::vector<std::unique_ptr<FindFileData>> SearchRes; + + WIN32_FIND_DATA ffd; + // Find the first file in the directory. + auto hFind = FindFirstFileA( SearchPattern, &ffd); + + if (INVALID_HANDLE_VALUE == hFind) + { + return SearchRes; + } + + // List all the files in the directory + do + { + SearchRes.emplace_back( new WndFindFileData(ffd) ); + } + while( FindNextFile(hFind, &ffd) != 0 ); + + auto dwError = GetLastError(); + if (dwError != ERROR_NO_MORE_FILES) + { + //ErrorHandler(TEXT("FindFirstFile")); + } + + FindClose(hFind); + + return SearchRes; +} diff --git a/Platforms/Windows/src/pch.cpp b/Platforms/Windows/src/pch.cpp new file mode 100644 index 00000000..809315e1 --- /dev/null +++ b/Platforms/Windows/src/pch.cpp @@ -0,0 +1,24 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#include "pch.h" diff --git a/Platforms/WindowsStore/build/WindowsStore/EngineRoot.props b/Platforms/WindowsStore/build/WindowsStore/EngineRoot.props new file mode 100644 index 00000000..7020603b --- /dev/null +++ b/Platforms/WindowsStore/build/WindowsStore/EngineRoot.props @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ImportGroup Label="PropertySheets" /> + <PropertyGroup Label="UserMacros"> + <EngineRoot>..\..\..\..\..</EngineRoot> + </PropertyGroup> + <PropertyGroup /> + <ItemDefinitionGroup /> + <ItemGroup> + <BuildMacro Include="EngineRoot"> + <Value>$(EngineRoot)</Value> + </BuildMacro> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.Shared/WindowsStorePlatform.Shared.vcxitems b/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.Shared/WindowsStorePlatform.Shared.vcxitems new file mode 100644 index 00000000..3038876f --- /dev/null +++ b/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.Shared/WindowsStorePlatform.Shared.vcxitems @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup Label="Globals"> + <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> + <HasSharedItems>true</HasSharedItems> + <ItemsProjectGuid>{65c1955f-c69e-4185-8b89-864725706a36}</ItemsProjectGuid> + <ItemsRootNamespace>WindowsStoreAppPlatform</ItemsRootNamespace> + <ItemsProjectName>WindowsStorePlatform.Shared</ItemsProjectName> + <CodeSharingProject>248F659F-DAC5-46E8-AC09-60EC9FC95053</CodeSharingProject> + </PropertyGroup> + <ItemDefinitionGroup> + <ClCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories> + </ClCompile> + </ItemDefinitionGroup> + <ItemGroup> + <ProjectCapability Include="SourceItemsFromImports" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\pch.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\WindowsStoreDebug.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\WindowsStoreFileSystem.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\WindowsStorePlatformDefinitions.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\src\pch.cpp"> + <PrecompiledHeader>Create</PrecompiledHeader> + </ClCompile> + <ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\src\WindowsStoreDebug.cpp" /> + <ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\src\WindowsStoreFileSystem.cpp" /> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.Shared/WindowsStorePlatform.Shared.vcxitems.filters b/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.Shared/WindowsStorePlatform.Shared.vcxitems.filters new file mode 100644 index 00000000..ba33e21f --- /dev/null +++ b/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.Shared/WindowsStorePlatform.Shared.vcxitems.filters @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="include"> + <UniqueIdentifier>{670fa2df-d6dd-43d2-b203-5e9e31068bd1}</UniqueIdentifier> + </Filter> + <Filter Include="src"> + <UniqueIdentifier>{6be7cc95-dbc1-4438-a844-0a3178a336bb}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\pch.h"> + <Filter>include</Filter> + </ClInclude> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\WindowsStoreFileSystem.h"> + <Filter>include</Filter> + </ClInclude> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\WindowsStorePlatformDefinitions.h"> + <Filter>include</Filter> + </ClInclude> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\include\WindowsStoreDebug.h"> + <Filter>include</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\src\pch.cpp"> + <Filter>src</Filter> + </ClCompile> + <ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\src\WindowsStoreFileSystem.cpp"> + <Filter>src</Filter> + </ClCompile> + <ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\src\WindowsStoreDebug.cpp"> + <Filter>src</Filter> + </ClCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.Windows/WindowsStorePlatform.Windows.vcxproj b/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.Windows/WindowsStorePlatform.Windows.vcxproj new file mode 100644 index 00000000..b40cebe7 --- /dev/null +++ b/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.Windows/WindowsStorePlatform.Windows.vcxproj @@ -0,0 +1,212 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|ARM"> + <Configuration>Debug</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|ARM"> + <Configuration>Release</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{eba5d25b-265d-4936-92c3-6ee01bf1b6d7}</ProjectGuid> + <RootNamespace>WindowsStoreAppPlatform</RootNamespace> + <DefaultLanguage>en-US</DefaultLanguage> + <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion> + <AppContainerApplication>true</AppContainerApplication> + <ApplicationType>Windows Store</ApplicationType> + <ApplicationTypeRevision>8.1</ApplicationTypeRevision> + <ConvergedProjectType>CodeSharingStaticLibrary</ConvergedProjectType> + <ProjectName>WindowsStorePlatform.Windows</ProjectName> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <Import Project="..\WindowsStorePlatform.Shared\WindowsStorePlatform.Shared.vcxitems" Label="Shared" /> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStore32Dbg.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\..\..\Windows\build\Windows\WindowsPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStore32Rel.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\..\..\Windows\build\Windows\WindowsPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStoreArmDbg.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\..\..\Windows\build\Windows\WindowsPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStoreArmRel.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\..\..\Windows\build\Windows\WindowsPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStore64Dbg.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\..\..\Windows\build\Windows\WindowsPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStore64Rel.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\..\..\Windows\build\Windows\WindowsPlatform.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <GenerateManifest>false</GenerateManifest> + <IncludePath>$(EngineRoot)\Platforms\WindowsStore\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <GenerateManifest>false</GenerateManifest> + <IncludePath>$(EngineRoot)\Platforms\WindowsStore\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <GenerateManifest>false</GenerateManifest> + <IncludePath>$(EngineRoot)\Platforms\WindowsStore\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <GenerateManifest>false</GenerateManifest> + <IncludePath>$(EngineRoot)\Platforms\WindowsStore\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <GenerateManifest>false</GenerateManifest> + <IncludePath>$(EngineRoot)\Platforms\WindowsStore\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <GenerateManifest>false</GenerateManifest> + <IncludePath>$(EngineRoot)\Platforms\WindowsStore\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.Windows/WindowsStorePlatform.Windows.vcxproj.filters b/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.Windows/WindowsStorePlatform.Windows.vcxproj.filters new file mode 100644 index 00000000..a7761ab0 --- /dev/null +++ b/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.Windows/WindowsStorePlatform.Windows.vcxproj.filters @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + </ItemGroup> +</Project> diff --git a/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.WindowsPhone/WindowsStorePlatform.WindowsPhone.vcxproj b/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.WindowsPhone/WindowsStorePlatform.WindowsPhone.vcxproj new file mode 100644 index 00000000..f21c0f8a --- /dev/null +++ b/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.WindowsPhone/WindowsStorePlatform.WindowsPhone.vcxproj @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|ARM"> + <Configuration>Debug</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|ARM"> + <Configuration>Release</Configuration> + <Platform>ARM</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{e518043b-b99a-414f-a276-d93b0f263df2}</ProjectGuid> + <RootNamespace>WindowsStoreAppPlatform</RootNamespace> + <DefaultLanguage>en-US</DefaultLanguage> + <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion> + <AppContainerApplication>true</AppContainerApplication> + <ApplicationType>Windows Phone</ApplicationType> + <ApplicationTypeRevision>8.1</ApplicationTypeRevision> + <ConvergedProjectType>CodeSharingStaticLibrary</ConvergedProjectType> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120_wp81</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120_wp81</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v120_wp81</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v120_wp81</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <Import Project="..\WindowsStorePlatform.Shared\WindowsStorePlatform.Shared.vcxitems" Label="Shared" /> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStore32Dbg.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\..\..\Windows\build\Windows\WindowsPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStore32Rel.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\..\..\Windows\build\Windows\WindowsPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStoreArmDbg.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\..\..\Windows\build\Windows\WindowsPlatform.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\..\..\..\..\Shared\build\WindowsStore\WinStoreArmRel.props" /> + <Import Project="..\EngineRoot.props" /> + <Import Project="..\..\..\..\Windows\build\Windows\WindowsPlatform.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <GenerateManifest>false</GenerateManifest> + <IncludePath>$(EngineRoot)\Platforms\WindowsStore\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <GenerateManifest>false</GenerateManifest> + <IncludePath>$(EngineRoot)\Platforms\WindowsStore\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> + <GenerateManifest>false</GenerateManifest> + <IncludePath>$(EngineRoot)\Platforms\WindowsStore\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> + <GenerateManifest>false</GenerateManifest> + <IncludePath>$(EngineRoot)\Platforms\WindowsStore\include;$(IncludePath)</IncludePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <CompileAsWinRT>false</CompileAsWinRT> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> + <GenerateWindowsMetadata>false</GenerateWindowsMetadata> + </Link> + </ItemDefinitionGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.WindowsPhone/WindowsStorePlatform.WindowsPhone.vcxproj.filters b/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.WindowsPhone/WindowsStorePlatform.WindowsPhone.vcxproj.filters new file mode 100644 index 00000000..a7761ab0 --- /dev/null +++ b/Platforms/WindowsStore/build/WindowsStore/WindowsStorePlatform.WindowsPhone/WindowsStorePlatform.WindowsPhone.vcxproj.filters @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + </ItemGroup> +</Project> diff --git a/Platforms/WindowsStore/include/WindowsStoreDebug.h b/Platforms/WindowsStore/include/WindowsStoreDebug.h new file mode 100644 index 00000000..a4ed3ace --- /dev/null +++ b/Platforms/WindowsStore/include/WindowsStoreDebug.h @@ -0,0 +1,32 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "..\Basic\include\BasicPlatformDebug.h" + +struct WindowsStoreDebug : public BasicPlatformDebug +{ + static void AssertionFailed( const Diligent::Char *Message, const char *Function, const char *File, int Line ); + static void OutputDebugMessage( DebugMessageSeverity Severity, const Diligent::Char *Message ); +}; diff --git a/Platforms/WindowsStore/include/WindowsStoreFileSystem.h b/Platforms/WindowsStore/include/WindowsStoreFileSystem.h new file mode 100644 index 00000000..d2ac1d1f --- /dev/null +++ b/Platforms/WindowsStore/include/WindowsStoreFileSystem.h @@ -0,0 +1,72 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "..\Basic\include\BasicFileSystem.h" +#include <memory> + +// Do not include windows headers here as they will mess up CreateDirectory() +// and DeleteFile() functions! +//#define NOMINMAX +//#include <wrl.h> + +class WindowsStoreFile : public BasicFile +{ +public: + WindowsStoreFile( const FileOpenAttribs &OpenAttribs ); + ~WindowsStoreFile(); + + void Read( Diligent::IDataBlob *pData ); + + bool Read( void *Data, size_t BufferSize ); + + void Write( Diligent::IDataBlob *pData ); + bool Write( const void *Data, size_t BufferSize ); + + size_t GetSize(); + + size_t GetPos(); + + void SetPos(size_t Offset, FilePosOrigin Origin); + +private: + // We have to do such tricks, because we cannot #include <wrl.h> + // to avoid name clashes. + std::unique_ptr<class FileHandleWrapper> m_FileHandle; +}; + +struct WindowsStoreFileSystem : public BasicFileSystem +{ +public: + static WindowsStoreFile* OpenFile( const FileOpenAttribs &OpenAttribs ); + static inline Diligent::Char GetSlashSymbol(){ return '\\'; } + + static bool FileExists( const Diligent::Char *strFilePath ); + static bool PathExists( const Diligent::Char *strPath ); + + static bool CreateDirectory( const Diligent::Char *strPath ); + static void ClearDirectory( const Diligent::Char *strPath ); + static void DeleteFile( const Diligent::Char *strPath ); + static std::vector<std::unique_ptr<FindFileData>> Search(const Diligent::Char *SearchPattern); +}; diff --git a/Platforms/WindowsStore/include/WindowsStorePlatformDefinitions.h b/Platforms/WindowsStore/include/WindowsStorePlatformDefinitions.h new file mode 100644 index 00000000..7f6a56e3 --- /dev/null +++ b/Platforms/WindowsStore/include/WindowsStorePlatformDefinitions.h @@ -0,0 +1,25 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + diff --git a/Platforms/WindowsStore/include/pch.h b/Platforms/WindowsStore/include/pch.h new file mode 100644 index 00000000..1d97fc93 --- /dev/null +++ b/Platforms/WindowsStore/include/pch.h @@ -0,0 +1,29 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include <cassert> + +// Do not include windows headers here because they mess up DeleteFile() and CreateDirectory() +// #include <wrl.h>
\ No newline at end of file diff --git a/Platforms/WindowsStore/src/WindowsStoreDebug.cpp b/Platforms/WindowsStore/src/WindowsStoreDebug.cpp new file mode 100644 index 00000000..a694d6ec --- /dev/null +++ b/Platforms/WindowsStore/src/WindowsStoreDebug.cpp @@ -0,0 +1,84 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#include "pch.h" + +#include "WindowsStoreDebug.h" +#include "FormatMessage.h" +#include "FileSystem.h" +#include <csignal> + +#define NOMINMAX +#include <wrl.h> + +using namespace Diligent; + +void WindowsStoreDebug :: AssertionFailed( const Diligent::Char *Message, const char *Function, const char *File, int Line ) +{ + std::string FileName; + FileSystem::SplitFilePath( File, nullptr, &FileName ); + std::stringstream msgss; + Diligent::FormatMsg( msgss, "Debug assertion failed in ", Function, "(), file ", FileName, ", line ", Line, ":\n\n", Message); + auto FullMsg = msgss.str(); + OutputDebugMessage( DebugMessageSeverity::Error, FullMsg.c_str() ); + + __debugbreak(); + //int nCode = MessageBoxA(NULL, + // FullMsg.c_str(), + // "Runtime assertion failed", + // MB_TASKMODAL|MB_ICONHAND|MB_ABORTRETRYIGNORE|MB_SETFOREGROUND); + + //// Abort: abort the program + //if (nCode == IDABORT) + //{ + // // raise abort signal + // raise(SIGABRT); + + // // We usually won't get here, but it's possible that + // // SIGABRT was ignored. So exit the program anyway. + // exit(3); + //} + + //// Retry: call the debugger + //if (nCode == IDRETRY) + //{ + // DebugBreak(); + // /* return to user code */ + // return; + //} + + //// Ignore: continue execution + //if (nCode == IDIGNORE) + // return; +}; + + +void WindowsStoreDebug::OutputDebugMessage( DebugMessageSeverity Severity, const Diligent::Char *Message ) +{ + String str = Message; + str += '\n'; + static Char* strSeverities[] = { "Info: ", "Warning: ", "ERROR: ", "CRITICAL ERROR: " }; + auto* MessageSevery = strSeverities[ static_cast<int>(Severity) ]; + str += MessageSevery; + OutputDebugStringA( str.c_str() ); +} diff --git a/Platforms/WindowsStore/src/WindowsStoreFileSystem.cpp b/Platforms/WindowsStore/src/WindowsStoreFileSystem.cpp new file mode 100644 index 00000000..1f6fd239 --- /dev/null +++ b/Platforms/WindowsStore/src/WindowsStoreFileSystem.cpp @@ -0,0 +1,273 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#include "pch.h" +#include "WindowsStoreFileSystem.h" +#include "Errors.h" +#include "StringTools.h" +#include "DebugUtilities.h" + + +// Windows headers define CreateDirectory and DeleteFile as macros. +// So we need to do some tricks to avoid name mess. +bool CreateDirectoryImpl( const Diligent::Char *strPath ); +bool WindowsStoreFileSystem::CreateDirectory( const Diligent::Char *strPath ) +{ + return CreateDirectoryImpl(strPath); +} + +void DeleteFileImpl( const Diligent::Char *strPath ); +void WindowsStoreFileSystem::DeleteFile( const Diligent::Char *strPath ) +{ + return DeleteFileImpl(strPath); +} + + +#define NOMINMAX +#include <wrl.h> + +using namespace Diligent; +using namespace Microsoft::WRL; + +class FileHandleWrapper +{ +public: + Wrappers::FileHandle FH; +}; + +WindowsStoreFile::WindowsStoreFile( const FileOpenAttribs &OpenAttribs ) : + BasicFile(OpenAttribs, WindowsStoreFileSystem::GetSlashSymbol()), + m_FileHandle(new FileHandleWrapper) +{ + CREATEFILE2_EXTENDED_PARAMETERS extendedParams = {0}; + extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS); + extendedParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; + extendedParams.dwFileFlags = FILE_FLAG_SEQUENTIAL_SCAN; + extendedParams.dwSecurityQosFlags = SECURITY_ANONYMOUS; + extendedParams.lpSecurityAttributes = nullptr; + extendedParams.hTemplateFile = nullptr; + + auto wstrPath = Diligent::WidenString(m_OpenAttribs.strFilePath); + DWORD dwDesiredAccess = 0; + DWORD dwShareMode = 0; + DWORD dwCreateDeposition = 0; + switch( OpenAttribs.AccessMode ) + { + case EFileAccessMode::Read: + dwDesiredAccess = GENERIC_READ; + // In Windows 8.1, the file cannot be opened if it is not shared! + dwShareMode = FILE_SHARE_READ; + dwCreateDeposition = OPEN_EXISTING; + break; + + case EFileAccessMode::Overwrite: + dwDesiredAccess = GENERIC_WRITE; + dwShareMode = 0; + dwCreateDeposition = CREATE_ALWAYS; + break; + + case EFileAccessMode::Append: + dwDesiredAccess = GENERIC_WRITE; + dwShareMode = 0; + dwCreateDeposition = OPEN_ALWAYS; + break; + + default: + UNEXPECTED( "Unknown file access mode" ); + break; + } + m_FileHandle->FH.Attach( CreateFile2( + wstrPath.c_str(), + dwDesiredAccess, + dwShareMode, + dwCreateDeposition, + &extendedParams + ) ); + + if (m_FileHandle->FH.Get() == INVALID_HANDLE_VALUE) + { + LOG_ERROR_AND_THROW( "Failed to open file ", m_OpenAttribs.strFilePath ); + } +} + +WindowsStoreFile::~WindowsStoreFile() +{ +} + +bool WindowsStoreFile::Read( void *Data, size_t BufferSize ) +{ + UNSUPPORTED( "Not implemented" ); + + return false; +} + +size_t WindowsStoreFile::GetSize() +{ + FILE_STANDARD_INFO fileInfo = {0}; + if (!GetFileInformationByHandleEx( + m_FileHandle->FH.Get(), + FileStandardInfo, + &fileInfo, + sizeof(fileInfo) + )) + { + LOG_ERROR_AND_THROW( "Failed to get file info" ); + } + + if (fileInfo.EndOfFile.HighPart != 0) + { + LOG_ERROR_AND_THROW( "File is too large to be read" ); + } + + return fileInfo.EndOfFile.LowPart; +} + +void WindowsStoreFile::Read( Diligent::IDataBlob *pData ) +{ + pData->Resize( GetSize() ); + + if (!ReadFile( + m_FileHandle->FH.Get(), + pData->GetDataPtr(), + static_cast<DWORD>(pData->GetSize()), + nullptr, + nullptr + )) + { + LOG_ERROR_AND_THROW( "Failed to read data from file" ); + } +} + +void WindowsStoreFile::Write( Diligent::IDataBlob *pData ) +{ + DWORD numBytesWritten; + if ( + !WriteFile( + m_FileHandle->FH.Get(), + pData->GetDataPtr(), + static_cast<DWORD>(pData->GetSize()), + &numBytesWritten, + nullptr + ) || + numBytesWritten != pData->GetSize() + ) + { + LOG_ERROR_AND_THROW( "Failed to write data to file" ); + } +} + +bool WindowsStoreFile::Write( const void *Data, size_t BufferSize ) +{ + UNSUPPORTED("Not implemented"); + return false; +} + +size_t WindowsStoreFile::GetPos() +{ + UNSUPPORTED("Not implemented"); + return 0; +} + +void WindowsStoreFile::SetPos(size_t Offset, FilePosOrigin Origin) +{ + UNSUPPORTED("Not implemented"); +} + + +WindowsStoreFile* WindowsStoreFileSystem::OpenFile( const FileOpenAttribs &OpenAttribs ) +{ + WindowsStoreFile *pFile = nullptr; + try + { + pFile = new WindowsStoreFile( OpenAttribs ); + } + catch( const std::runtime_error &/*err*/ ) + { + + } + + return pFile; +} + +bool WindowsStoreFileSystem::FileExists( const Diligent::Char *strFilePath ) +{ + FileOpenAttribs OpenAttribs; + OpenAttribs.AccessMode = EFileAccessMode::Read; + OpenAttribs.strFilePath = strFilePath; + BasicFile DummyFile( OpenAttribs, WindowsStoreFileSystem::GetSlashSymbol() ); + const auto &Path = DummyFile.GetPath(); + + CREATEFILE2_EXTENDED_PARAMETERS extendedParams = {0}; + extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS); + extendedParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; + extendedParams.dwFileFlags = FILE_FLAG_SEQUENTIAL_SCAN; + extendedParams.dwSecurityQosFlags = SECURITY_ANONYMOUS; + extendedParams.lpSecurityAttributes = nullptr; + extendedParams.hTemplateFile = nullptr; + + auto wstrPath = Diligent::WidenString(Path); + + auto Handle = CreateFile2( + wstrPath.c_str(), + GENERIC_READ, + FILE_SHARE_READ, + OPEN_EXISTING, + &extendedParams); + bool Exists = false; + if( Handle != INVALID_HANDLE_VALUE ) + { + CloseHandle( Handle ); + Exists = true; + } + return Exists; +} + + +bool WindowsStoreFileSystem::PathExists( const Diligent::Char *strPath ) +{ + UNSUPPORTED("Not implemented"); + return false; +} + +void WindowsStoreFileSystem::ClearDirectory( const Diligent::Char *strPath ) +{ + UNSUPPORTED("Not implemented"); +} + + +bool CreateDirectoryImpl( const Diligent::Char *strPath ) +{ + UNSUPPORTED("Not implemented"); + return false; +} + +void DeleteFileImpl( const Diligent::Char *strPath ) +{ + UNSUPPORTED("Not implemented"); +} + +std::vector<std::unique_ptr<FindFileData>> WindowsStoreFileSystem::Search(const Diligent::Char *SearchPattern) +{ + UNSUPPORTED("Not implemented"); + return std::vector<std::unique_ptr<FindFileData>>(); +} diff --git a/Platforms/WindowsStore/src/pch.cpp b/Platforms/WindowsStore/src/pch.cpp new file mode 100644 index 00000000..809315e1 --- /dev/null +++ b/Platforms/WindowsStore/src/pch.cpp @@ -0,0 +1,24 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#include "pch.h" diff --git a/Platforms/interface/Atomics.h b/Platforms/interface/Atomics.h new file mode 100644 index 00000000..01f0ba0e --- /dev/null +++ b/Platforms/interface/Atomics.h @@ -0,0 +1,32 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "PlatformDefinitions.h" + +// Atomics are implemented using c++11 standard atomics, so there is no need +// to use different implementations for different platforms +#include "..\Basic\include\BasicAtomics.h" + +typedef BasicAtomics Atomics; diff --git a/Platforms/interface/FileSystem.h b/Platforms/interface/FileSystem.h new file mode 100644 index 00000000..42dbbf39 --- /dev/null +++ b/Platforms/interface/FileSystem.h @@ -0,0 +1,45 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "PlatformDefinitions.h" + +#if defined( PLATFORM_WINDOWS ) + + #include "..\Windows\include\WindowsFileSystem.h" + typedef WindowsFileSystem FileSystem; + typedef WindowsFile CFile; + +#elif defined( PLATFORM_WINDOWS_STORE ) + + #include "..\WindowsStore\include\WindowsStoreFileSystem.h" + typedef WindowsStoreFileSystem FileSystem; + typedef WindowsStoreFile CFile; + +#elif defined ( PLATFORM_ANDROID ) + + #include "..\Android\include\AndroidFileSystem.h" + typedef AndroidFileSystem FileSystem; + typedef AndroidFile CFile; +#endif diff --git a/Platforms/interface/PlatformDebug.h b/Platforms/interface/PlatformDebug.h new file mode 100644 index 00000000..7c3a4c77 --- /dev/null +++ b/Platforms/interface/PlatformDebug.h @@ -0,0 +1,39 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "PlatformDefinitions.h" + +#if defined( PLATFORM_WINDOWS ) + #include "..\Windows\include\WindowsDebug.h" + typedef WindowsDebug PlatformDebug; + +#elif defined( PLATFORM_WINDOWS_STORE ) + #include "..\WindowsStore\include\WindowsStoreDebug.h" + typedef WindowsStoreDebug PlatformDebug; + +#elif defined ( PLATFORM_ANDROID ) + #include "..\Android\include\AndroidDebug.h" + typedef AndroidDebug PlatformDebug; +#endif diff --git a/Platforms/interface/PlatformDefinitions.h b/Platforms/interface/PlatformDefinitions.h new file mode 100644 index 00000000..15c4658b --- /dev/null +++ b/Platforms/interface/PlatformDefinitions.h @@ -0,0 +1,42 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#if defined(_WINDOWS) + #define PLATFORM_WINDOWS +#elif defined (_WINDOWS_STORE) + #define PLATFORM_WINDOWS_STORE +#elif defined (ANDROID) + #define PLATFORM_ANDROID +#else + #error Platform is not defined +#endif + +#if defined( PLATFORM_WINDOWS ) + #include "..\Windows\include\WindowsPlatformDefinitions.h" +#elif defined( PLATFORM_WINDOWS_STORE ) + #include "..\WindowsStore\include\WindowsStorePlatformDefinitions.h" +#elif defined ( PLATFORM_ANDROID ) + #include "..\Android\include\AndroidPlatformDefinitions.h" +#endif diff --git a/Platforms/interface/PlatformMisc.h b/Platforms/interface/PlatformMisc.h new file mode 100644 index 00000000..1b4368c0 --- /dev/null +++ b/Platforms/interface/PlatformMisc.h @@ -0,0 +1,39 @@ +/* Copyright 2015 Egor Yusov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS. + * + * In no event and under no legal theory, whether in tort (including negligence), + * contract, or otherwise, unless required by applicable law (such as deliberate + * and grossly negligent acts) or agreed to in writing, shall any Contributor be + * liable for any damages, including any direct, indirect, special, incidental, + * or consequential damages of any character arising as a result of this License or + * out of the use or inability to use the software (including but not limited to damages + * for loss of goodwill, work stoppage, computer failure or malfunction, or any and + * all other commercial damages or losses), even if such Contributor has been advised + * of the possibility of such damages. + */ + +#pragma once + +#include "PlatformDefinitions.h" + +#if defined( PLATFORM_WINDOWS ) + #include "..\Windows\include\WindowsPlatformMisc.h" + typedef WindowsMisc PlatformMisc; + +#elif defined( PLATFORM_WINDOWS_STORE ) + #include "..\Windows\include\WindowsPlatformMisc.h" + typedef WindowsMisc PlatformMisc; + +#elif defined ( PLATFORM_ANDROID ) + #include "..\Android\include\AndroidPlatformMisc.h" + typedef AndroidMisc PlatformMisc; +#endif diff --git a/Platforms/interface/build/WindowsStore/PlatformInterface.Shared.vcxitems b/Platforms/interface/build/WindowsStore/PlatformInterface.Shared.vcxitems new file mode 100644 index 00000000..8e2ef7dd --- /dev/null +++ b/Platforms/interface/build/WindowsStore/PlatformInterface.Shared.vcxitems @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup Label="Globals"> + <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> + <HasSharedItems>true</HasSharedItems> + <ItemsProjectGuid>{C8F281ED-F3B9-4C24-A2D3-40A922363466}</ItemsProjectGuid> + <ItemsRootNamespace>BasicPlatform</ItemsRootNamespace> + <ItemsProjectName>PlatformInterface.Shared</ItemsProjectName> + <CodeSharingProject>248F659F-DAC5-46E8-AC09-60EC9FC95053</CodeSharingProject> + </PropertyGroup> + <ItemDefinitionGroup> + <ClCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories> + </ClCompile> + </ItemDefinitionGroup> + <ItemGroup> + <ProjectCapability Include="SourceItemsFromImports" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\Atomics.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\FileSystem.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\PlatformDebug.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\PlatformDefinitions.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\PlatformMisc.h" /> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Platforms/interface/build/WindowsStore/PlatformInterface.Shared.vcxitems.filters b/Platforms/interface/build/WindowsStore/PlatformInterface.Shared.vcxitems.filters new file mode 100644 index 00000000..9945c4f3 --- /dev/null +++ b/Platforms/interface/build/WindowsStore/PlatformInterface.Shared.vcxitems.filters @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\Atomics.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\FileSystem.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\PlatformDebug.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\PlatformDefinitions.h" /> + <ClInclude Include="$(MSBuildThisFileDirectory)..\..\PlatformMisc.h" /> + </ItemGroup> +</Project>
\ No newline at end of file |
