mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 06:20:21 +02:00
Avoid warning and make local variable lower-case.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6000 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
56
examples/10.Shaders/Makefile
Normal file
56
examples/10.Shaders/Makefile
Normal file
@ -0,0 +1,56 @@
|
||||
# Makefile for Irrlicht Examples
|
||||
# It's usually sufficient to change just the target name and source file list
|
||||
# and be sure that CXX is set to a valid compiler
|
||||
|
||||
# Name of the executable created (.exe will be added automatically if necessary)
|
||||
Target := 10.Shaders
|
||||
# List of source files, separated by spaces
|
||||
Sources := main.cpp
|
||||
# Path to Irrlicht directory, should contain include/ and lib/
|
||||
IrrlichtHome := ../..
|
||||
# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems
|
||||
BinPath = ../../bin/$(SYSTEM)
|
||||
|
||||
# general compiler settings (might need to be set when compiling the lib, too)
|
||||
CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include
|
||||
ifndef NDEBUG
|
||||
CXXFLAGS += -g -Wall
|
||||
else
|
||||
CXXFLAGS += -O3
|
||||
endif
|
||||
|
||||
#default target is Linux
|
||||
all: all_linux
|
||||
|
||||
# target specific settings
|
||||
all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht
|
||||
all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lXext -lX11 -lXcursor
|
||||
all_linux clean_linux: SYSTEM=Linux
|
||||
all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc
|
||||
all_win32 clean_win32 static_win32: SUF=.exe
|
||||
static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_
|
||||
all_win32: LDFLAGS += -lopengl32 -lm
|
||||
static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32
|
||||
# name of the binary - only valid for targets which set SYSTEM
|
||||
DESTPATH = $(BinPath)/$(Target)$(SUF)
|
||||
|
||||
all_linux all_win32 static_win32:
|
||||
$(warning Building...)
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
|
||||
|
||||
clean: clean_linux clean_win32
|
||||
$(warning Cleaning...)
|
||||
|
||||
clean_linux clean_win32:
|
||||
@$(RM) $(DESTPATH)
|
||||
|
||||
.PHONY: all all_win32 static_win32 clean clean_linux clean_win32
|
||||
|
||||
#multilib handling
|
||||
ifeq ($(HOSTTYPE), x86_64)
|
||||
LIBSELECT=64
|
||||
endif
|
||||
#solaris real-time features
|
||||
ifeq ($(HOSTTYPE), sun4)
|
||||
LDFLAGS += -lrt
|
||||
endif
|
56
examples/10.Shaders/Shaders.cbp
Normal file
56
examples/10.Shaders/Shaders.cbp
Normal file
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Irrlicht Example 10 Shaders" />
|
||||
<Option pch_mode="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Windows">
|
||||
<Option platforms="Windows;" />
|
||||
<Option output="../../bin/Win32-gcc/Shaders" prefix_auto="0" extension_auto="1" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Option projectResourceIncludeDirsRelation="1" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add directory="../../lib/Win32-gcc" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Linux">
|
||||
<Option platforms="Unix;" />
|
||||
<Option output="../../bin/Linux/Shaders" prefix_auto="0" extension_auto="0" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
<Add option="-D_IRR_STATIC_LIB_" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Xxf86vm" />
|
||||
<Add library="X11" />
|
||||
<Add library="GL" />
|
||||
<Add directory="../../lib/Linux" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<VirtualTargets>
|
||||
<Add alias="All" targets="Windows;Linux;" />
|
||||
</VirtualTargets>
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
<Add directory="../../include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="Irrlicht" />
|
||||
</Linker>
|
||||
<Unit filename="main.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
<envvars />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
163
examples/10.Shaders/Shaders.vcproj
Normal file
163
examples/10.Shaders/Shaders.vcproj
Normal file
@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="10.Shaders"
|
||||
ProjectGUID="{A4F71E8D-4042-4909-9AB8-1BA4CF5B926D}"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Debug/Shaders.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\10.Shaders.exe"
|
||||
LinkIncremental="0"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Debug/Shaders.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/Shaders.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="3079"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Release/Shaders.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="..\..\bin\Win32-VisualStudio\10.Shaders.exe"
|
||||
LinkIncremental="0"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
|
||||
ProgramDatabaseFile=".\Release/Shaders.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/Shaders.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="3079"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="main.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
290
examples/10.Shaders/Shaders.xcodeproj/project.pbxproj
Normal file
290
examples/10.Shaders/Shaders.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,290 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
5E34CC751B7F8EEF00F212E8 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E34CC741B7F8EEF00F212E8 /* main.cpp */; };
|
||||
5E8570B61B7F9A3200B267D2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E8570B01B7F99F500B267D2 /* Cocoa.framework */; };
|
||||
5E8570B71B7F9A3200B267D2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E8570B41B7F9A0700B267D2 /* IOKit.framework */; };
|
||||
5E8570B81B7F9A3200B267D2 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */; };
|
||||
5E8570BF1B7F9D3A00B267D2 /* media in Resources */ = {isa = PBXBuildFile; fileRef = 5E8570BE1B7F9D3A00B267D2 /* media */; };
|
||||
5E8571181B7FBE8D00B267D2 /* libIrrlicht.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
5E34CC511B7F8E6E00F212E8 /* 10.Shaders.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 10.Shaders.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
|
||||
5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = "<group>"; };
|
||||
5E8570B01B7F99F500B267D2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
5E8570B21B7F99FE00B267D2 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
|
||||
5E8570B41B7F9A0700B267D2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
|
||||
5E8570BE1B7F9D3A00B267D2 /* media */ = {isa = PBXFileReference; lastKnownFileType = folder; name = media; path = ../../media; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
5E34CC4E1B7F8E6E00F212E8 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5E8570B61B7F9A3200B267D2 /* Cocoa.framework in Frameworks */,
|
||||
5E8570B71B7F9A3200B267D2 /* IOKit.framework in Frameworks */,
|
||||
5E8570B81B7F9A3200B267D2 /* OpenGL.framework in Frameworks */,
|
||||
5E8571181B7FBE8D00B267D2 /* libIrrlicht.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
5E34C6D81B7F4A0C00F212E8 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5E34CC741B7F8EEF00F212E8 /* main.cpp */,
|
||||
5E34CC761B7F905600F212E8 /* Libraries */,
|
||||
5E34CC521B7F8E6E00F212E8 /* Products */,
|
||||
5E34CC771B7F906D00F212E8 /* Resources */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5E34CC521B7F8E6E00F212E8 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5E34CC511B7F8E6E00F212E8 /* 10.Shaders.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5E34CC761B7F905600F212E8 /* Libraries */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5E8570B01B7F99F500B267D2 /* Cocoa.framework */,
|
||||
5E8570B41B7F9A0700B267D2 /* IOKit.framework */,
|
||||
5E8570B21B7F99FE00B267D2 /* OpenGL.framework */,
|
||||
5E34CC781B7F90A000F212E8 /* libIrrlicht.a */,
|
||||
);
|
||||
name = Libraries;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5E34CC771B7F906D00F212E8 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5E8570BE1B7F9D3A00B267D2 /* media */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
5E34CC501B7F8E6E00F212E8 /* 10.Shaders */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "10.Shaders" */;
|
||||
buildPhases = (
|
||||
5E34CC4D1B7F8E6E00F212E8 /* Sources */,
|
||||
5E34CC4E1B7F8E6E00F212E8 /* Frameworks */,
|
||||
5E34CC4F1B7F8E6E00F212E8 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = 10.Shaders;
|
||||
productName = 01.HelloWorld;
|
||||
productReference = 5E34CC511B7F8E6E00F212E8 /* 10.Shaders.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
5E34C6D91B7F4A0C00F212E8 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0710;
|
||||
TargetAttributes = {
|
||||
5E34CC501B7F8E6E00F212E8 = {
|
||||
CreatedOnToolsVersion = 6.1;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 5E34C6DC1B7F4A0C00F212E8 /* Build configuration list for PBXProject "Shaders" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 5E34C6D81B7F4A0C00F212E8;
|
||||
productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
5E34CC501B7F8E6E00F212E8 /* 10.Shaders */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
5E34CC4F1B7F8E6E00F212E8 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5E8570BF1B7F9D3A00B267D2 /* media in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
5E34CC4D1B7F8E6E00F212E8 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5E34CC751B7F8EEF00F212E8 /* main.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
5E34C6DD1B7F4A0C00F212E8 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_TESTABILITY = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
5E34C6DE1B7F4A0C00F212E8 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
5E34CC6C1B7F8E6E00F212E8 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEPLOYMENT_LOCATION = YES;
|
||||
DSTROOT = "$(SRCROOT)/../../bin/OSX";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../include",
|
||||
);
|
||||
INFOPLIST_FILE = "$(SRCROOT)/../../media/info_osx.plist";
|
||||
INSTALL_PATH = /;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../lib/OSX",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
5E34CC6D1B7F8E6E00F212E8 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEPLOYMENT_LOCATION = YES;
|
||||
DSTROOT = "$(SRCROOT)/../../bin/OSX";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../include",
|
||||
);
|
||||
INFOPLIST_FILE = "$(SRCROOT)/../../media/info_osx.plist";
|
||||
INSTALL_PATH = /;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(SRCROOT)/../../lib/OSX",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
5E34C6DC1B7F4A0C00F212E8 /* Build configuration list for PBXProject "Shaders" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
5E34C6DD1B7F4A0C00F212E8 /* Debug */,
|
||||
5E34C6DE1B7F4A0C00F212E8 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "10.Shaders" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
5E34CC6C1B7F8E6E00F212E8 /* Debug */,
|
||||
5E34CC6D1B7F8E6E00F212E8 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */;
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0710"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
|
||||
BuildableName = "10.Shaders.app"
|
||||
BlueprintName = "10.Shaders"
|
||||
ReferencedContainer = "container:Shaders.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
|
||||
BuildableName = "10.Shaders.app"
|
||||
BlueprintName = "10.Shaders"
|
||||
ReferencedContainer = "container:Shaders.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
|
||||
BuildableName = "10.Shaders.app"
|
||||
BlueprintName = "10.Shaders"
|
||||
ReferencedContainer = "container:Shaders.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
|
||||
BuildableName = "10.Shaders.app"
|
||||
BlueprintName = "10.Shaders"
|
||||
ReferencedContainer = "container:Shaders.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
235
examples/10.Shaders/Shaders_vc10.vcxproj
Normal file
235
examples/10.Shaders/Shaders_vc10.vcxproj
Normal file
@ -0,0 +1,235 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>10.Shaders</ProjectName>
|
||||
<ProjectGuid>{27158C82-CD15-4A9B-9848-35E7065B209F}</ProjectGuid>
|
||||
<RootNamespace>Shaders</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.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="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.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="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win32-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win64-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win32-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win64-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
235
examples/10.Shaders/Shaders_vc11.vcxproj
Normal file
235
examples/10.Shaders/Shaders_vc11.vcxproj
Normal file
@ -0,0 +1,235 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.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>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>10.Shaders</ProjectName>
|
||||
<ProjectGuid>{27158C82-CD15-4A9B-9848-35E7065B209F}</ProjectGuid>
|
||||
<RootNamespace>Shaders</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.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="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.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="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win32-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win64-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win32-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win64-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
235
examples/10.Shaders/Shaders_vc12.vcxproj
Normal file
235
examples/10.Shaders/Shaders_vc12.vcxproj
Normal file
@ -0,0 +1,235 @@
|
||||
<?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|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>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>10.Shaders</ProjectName>
|
||||
<ProjectGuid>{27158C82-CD15-4A9B-9848-35E7065B209F}</ProjectGuid>
|
||||
<RootNamespace>Shaders</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.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="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.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="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win32-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win64-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win32-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win64-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
235
examples/10.Shaders/Shaders_vc14.vcxproj
Normal file
235
examples/10.Shaders/Shaders_vc14.vcxproj
Normal file
@ -0,0 +1,235 @@
|
||||
<?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>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>10.Shaders</ProjectName>
|
||||
<ProjectGuid>{27158C82-CD15-4A9B-9848-35E7065B209F}</ProjectGuid>
|
||||
<RootNamespace>Shaders</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.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="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.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="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win32-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Debug/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win64-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win32-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TypeLibraryName>.\Release/Shaders.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0c07</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>..\..\bin\Win64-VisualStudio\10.Shaders.exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
456
examples/10.Shaders/main.cpp
Normal file
456
examples/10.Shaders/main.cpp
Normal file
@ -0,0 +1,456 @@
|
||||
/** Example 010 Shaders
|
||||
|
||||
This tutorial shows how to use shaders for D3D9, and OpenGL with the
|
||||
engine and how to create new material types with them. It also shows how to
|
||||
disable the generation of mipmaps at texture loading, and how to use text scene
|
||||
nodes.
|
||||
|
||||
This tutorial does not explain how shaders work. I would recommend to read the
|
||||
D3D or OpenGL, documentation, to search a tutorial, or to read a book about
|
||||
this.
|
||||
|
||||
At first, we need to include all headers and do the stuff we always do, like in
|
||||
nearly all other tutorials:
|
||||
*/
|
||||
#include <irrlicht.h>
|
||||
#include <iostream>
|
||||
#include "driverChoice.h"
|
||||
#include "exampleHelper.h"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma comment(lib, "Irrlicht.lib")
|
||||
#endif
|
||||
|
||||
/*
|
||||
Because we want to use some interesting shaders in this tutorials, we need to
|
||||
set some data for them to make them able to compute nice colors. In this
|
||||
example, we'll use a simple vertex shader which will calculate the color of the
|
||||
vertex based on the position of the camera.
|
||||
For this, the shader needs the following data: The inverted world matrix for
|
||||
transforming the normal, the clip matrix for transforming the position, the
|
||||
camera position and the world position of the object for the calculation of the
|
||||
angle of light, and the color of the light. To be able to tell the shader all
|
||||
this data every frame, we have to derive a class from the
|
||||
IShaderConstantSetCallBack interface and override its only method, namely
|
||||
OnSetConstants(). This method will be called every time the material is set.
|
||||
The method setVertexShaderConstant() of the IMaterialRendererServices interface
|
||||
is used to set the data the shader needs. If the user chose to use a High Level
|
||||
shader language like HLSL instead of Assembler in this example, you have to set
|
||||
the variable name as parameter instead of the register index.
|
||||
*/
|
||||
|
||||
IrrlichtDevice* device = 0;
|
||||
bool UseHighLevelShaders = false;
|
||||
|
||||
class MyShaderCallBack : public video::IShaderConstantSetCallBack
|
||||
{
|
||||
public:
|
||||
MyShaderCallBack() : WorldViewProjID(-1), TransWorldID(-1), InvWorldID(-1), PositionID(-1),
|
||||
ColorID(-1), TextureID(-1), FirstUpdate(true)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void OnSetConstants(video::IMaterialRendererServices* services,
|
||||
s32 userData)
|
||||
{
|
||||
video::IVideoDriver* driver = services->getVideoDriver();
|
||||
|
||||
// get shader constants id.
|
||||
|
||||
if (UseHighLevelShaders && FirstUpdate)
|
||||
{
|
||||
WorldViewProjID = services->getVertexShaderConstantID("mWorldViewProj");
|
||||
TransWorldID = services->getVertexShaderConstantID("mTransWorld");
|
||||
InvWorldID = services->getVertexShaderConstantID("mInvWorld");
|
||||
PositionID = services->getVertexShaderConstantID("mLightPos");
|
||||
ColorID = services->getVertexShaderConstantID("mLightColor");
|
||||
|
||||
// Textures ID are important only for OpenGL interface.
|
||||
|
||||
if(driver->getDriverType() == video::EDT_OPENGL)
|
||||
TextureID = services->getVertexShaderConstantID("myTexture");
|
||||
|
||||
FirstUpdate = false;
|
||||
}
|
||||
|
||||
// set inverted world matrix
|
||||
// if we are using highlevel shaders (the user can select this when
|
||||
// starting the program), we must set the constants by name.
|
||||
|
||||
core::matrix4 invWorld = driver->getTransform(video::ETS_WORLD);
|
||||
invWorld.makeInverse();
|
||||
|
||||
if (UseHighLevelShaders)
|
||||
services->setVertexShaderConstant(InvWorldID, invWorld.pointer(), 16);
|
||||
else
|
||||
services->setVertexShaderConstant(invWorld.pointer(), 0, 4);
|
||||
|
||||
// set clip matrix
|
||||
|
||||
core::matrix4 worldViewProj;
|
||||
worldViewProj = driver->getTransform(video::ETS_PROJECTION);
|
||||
worldViewProj *= driver->getTransform(video::ETS_VIEW);
|
||||
worldViewProj *= driver->getTransform(video::ETS_WORLD);
|
||||
|
||||
if (UseHighLevelShaders)
|
||||
services->setVertexShaderConstant(WorldViewProjID, worldViewProj.pointer(), 16);
|
||||
else
|
||||
services->setVertexShaderConstant(worldViewProj.pointer(), 4, 4);
|
||||
|
||||
// set camera position
|
||||
|
||||
core::vector3df pos = device->getSceneManager()->
|
||||
getActiveCamera()->getAbsolutePosition();
|
||||
|
||||
if (UseHighLevelShaders)
|
||||
services->setVertexShaderConstant(PositionID, reinterpret_cast<f32*>(&pos), 3);
|
||||
else
|
||||
services->setVertexShaderConstant(reinterpret_cast<f32*>(&pos), 8, 1);
|
||||
|
||||
// set light color
|
||||
|
||||
video::SColorf col(0.0f,1.0f,1.0f,0.0f);
|
||||
|
||||
if (UseHighLevelShaders)
|
||||
services->setVertexShaderConstant(ColorID,
|
||||
reinterpret_cast<f32*>(&col), 4);
|
||||
else
|
||||
services->setVertexShaderConstant(reinterpret_cast<f32*>(&col), 9, 1);
|
||||
|
||||
// set transposed world matrix
|
||||
|
||||
core::matrix4 world = driver->getTransform(video::ETS_WORLD);
|
||||
world = world.getTransposed();
|
||||
|
||||
if (UseHighLevelShaders)
|
||||
{
|
||||
services->setVertexShaderConstant(TransWorldID, world.pointer(), 16);
|
||||
|
||||
// set texture, for textures you can use both an int and a float setPixelShaderConstant interfaces (You need it only for an OpenGL driver).
|
||||
s32 TextureLayerID = 0;
|
||||
services->setPixelShaderConstant(TextureID, &TextureLayerID, 1);
|
||||
}
|
||||
else
|
||||
services->setVertexShaderConstant(world.pointer(), 10, 4);
|
||||
}
|
||||
|
||||
private:
|
||||
s32 WorldViewProjID;
|
||||
s32 TransWorldID;
|
||||
s32 InvWorldID;
|
||||
s32 PositionID;
|
||||
s32 ColorID;
|
||||
s32 TextureID;
|
||||
|
||||
bool FirstUpdate;
|
||||
};
|
||||
|
||||
/*
|
||||
The next few lines start up the engine just like in most other tutorials
|
||||
before. But in addition, we ask the user if he wants to use high level shaders
|
||||
in this example, if he selected a driver which is capable of doing so.
|
||||
*/
|
||||
int main()
|
||||
{
|
||||
// ask user for driver
|
||||
video::E_DRIVER_TYPE driverType=driverChoiceConsole();
|
||||
if (driverType==video::EDT_COUNT)
|
||||
return 1;
|
||||
|
||||
// ask the user if we should use high level shaders for this example
|
||||
if (driverType == video::EDT_DIRECT3D9 ||
|
||||
driverType == video::EDT_OPENGL)
|
||||
{
|
||||
char i = 'y';
|
||||
printf("Please press 'y' if you want to use high level shaders.\n");
|
||||
std::cin >> i;
|
||||
if (i == 'y')
|
||||
{
|
||||
UseHighLevelShaders = true;
|
||||
}
|
||||
}
|
||||
|
||||
// create device
|
||||
|
||||
device = createDevice(driverType, core::dimension2d<u32>(640, 480));
|
||||
|
||||
if (device == 0)
|
||||
return 1; // could not create selected driver.
|
||||
|
||||
|
||||
video::IVideoDriver* driver = device->getVideoDriver();
|
||||
scene::ISceneManager* smgr = device->getSceneManager();
|
||||
gui::IGUIEnvironment* gui = device->getGUIEnvironment();
|
||||
|
||||
const io::path mediaPath = getExampleMediaPath();
|
||||
|
||||
/*
|
||||
Now for the more interesting parts. If we are using Direct3D, we want
|
||||
to load vertex and pixel shader programs, if we have OpenGL, we want to
|
||||
use ARB fragment and vertex programs. I wrote the corresponding
|
||||
programs down into the files d3d9.ps, d3d9.vs, opengl.ps and opengl.vs.
|
||||
We only need the right filenames now. This is done in the following switch.
|
||||
Note, that it is not necessary to write the shaders into text files,
|
||||
like in this example. You can even write the shaders directly as strings
|
||||
into the cpp source file, and use later addShaderMaterial() instead of
|
||||
addShaderMaterialFromFiles().
|
||||
*/
|
||||
|
||||
io::path vsFileName; // filename for the vertex shader
|
||||
io::path psFileName; // filename for the pixel shader
|
||||
|
||||
switch(driverType)
|
||||
{
|
||||
case video::EDT_DIRECT3D9:
|
||||
if (UseHighLevelShaders)
|
||||
{
|
||||
psFileName = mediaPath + "d3d9.hlsl";
|
||||
vsFileName = psFileName; // both shaders are in the same file
|
||||
}
|
||||
else
|
||||
{
|
||||
psFileName = mediaPath + "d3d9.psh";
|
||||
vsFileName = mediaPath + "d3d9.vsh";
|
||||
}
|
||||
break;
|
||||
|
||||
case video::EDT_OPENGL:
|
||||
if (UseHighLevelShaders)
|
||||
{
|
||||
psFileName = mediaPath + "opengl.frag";
|
||||
vsFileName = mediaPath + "opengl.vert";
|
||||
}
|
||||
else
|
||||
{
|
||||
psFileName = mediaPath + "opengl.psh";
|
||||
vsFileName = mediaPath + "opengl.vsh";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
In addition, we check if the hardware and the selected renderer is
|
||||
capable of executing the shaders we want. If not, we simply set the
|
||||
filename string to 0. This is not necessary, but useful in this
|
||||
example: For example, if the hardware is able to execute vertex shaders
|
||||
but not pixel shaders, we create a new material which only uses the
|
||||
vertex shader, and no pixel shader. Otherwise, if we would tell the
|
||||
engine to create this material and the engine sees that the hardware
|
||||
wouldn't be able to fulfill the request completely, it would not
|
||||
create any new material at all. So in this example you would see at
|
||||
least the vertex shader in action, without the pixel shader.
|
||||
*/
|
||||
|
||||
if (!driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) &&
|
||||
!driver->queryFeature(video::EVDF_ARB_FRAGMENT_PROGRAM_1))
|
||||
{
|
||||
device->getLogger()->log("WARNING: Pixel shaders disabled "\
|
||||
"because of missing driver/hardware support.");
|
||||
psFileName = "";
|
||||
}
|
||||
|
||||
if (!driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1) &&
|
||||
!driver->queryFeature(video::EVDF_ARB_VERTEX_PROGRAM_1))
|
||||
{
|
||||
device->getLogger()->log("WARNING: Vertex shaders disabled "\
|
||||
"because of missing driver/hardware support.");
|
||||
vsFileName = "";
|
||||
}
|
||||
|
||||
/*
|
||||
Now lets create the new materials. As you maybe know from previous
|
||||
examples, a material type in the Irrlicht engine is set by simply
|
||||
changing the MaterialType value in the SMaterial struct. And this value
|
||||
is just a simple 32 bit value, like video::EMT_SOLID. So we only need
|
||||
the engine to create a new value for us which we can set there. To do
|
||||
this, we get a pointer to the IGPUProgrammingServices and call
|
||||
addShaderMaterialFromFiles(), which returns such a new 32 bit value.
|
||||
That's all.
|
||||
|
||||
The parameters to this method are the following: First, the names of
|
||||
the files containing the code of the vertex and the pixel shader. If
|
||||
you would use addShaderMaterial() instead, you would not need file
|
||||
names, then you could write the code of the shader directly as string.
|
||||
The following parameter is a pointer to the IShaderConstantSetCallBack
|
||||
class we wrote at the beginning of this tutorial. If you don't want to
|
||||
set constants, set this to 0. The last parameter tells the engine which
|
||||
material it should use as base material.
|
||||
|
||||
To demonstrate this, we create two materials with a different base
|
||||
material, one with EMT_SOLID and one with EMT_TRANSPARENT_ADD_COLOR.
|
||||
*/
|
||||
|
||||
// create materials
|
||||
|
||||
video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices();
|
||||
s32 newMaterialType1 = 0;
|
||||
s32 newMaterialType2 = 0;
|
||||
|
||||
if (gpu)
|
||||
{
|
||||
/*
|
||||
Create one callback instance for each shader material you add.
|
||||
Reason is that the getVertexShaderConstantID returns ID's which are
|
||||
only valid per added material (The ID's tend to be identical
|
||||
as long as the shader code is exactly identical, but it's not good
|
||||
style to depend on that).
|
||||
*/
|
||||
MyShaderCallBack* mcSolid = new MyShaderCallBack();
|
||||
MyShaderCallBack* mcTransparentAdd = new MyShaderCallBack();
|
||||
|
||||
// create the shaders depending on if the user wanted high level
|
||||
// or low level shaders:
|
||||
|
||||
if (UseHighLevelShaders)
|
||||
{
|
||||
// create material from high level shaders (hlsl, glsl)
|
||||
|
||||
newMaterialType1 = gpu->addHighLevelShaderMaterialFromFiles(
|
||||
vsFileName, "vertexMain", video::EVST_VS_1_1,
|
||||
psFileName, "pixelMain", video::EPST_PS_1_1,
|
||||
mcSolid, video::EMT_SOLID, 0);
|
||||
|
||||
newMaterialType2 = gpu->addHighLevelShaderMaterialFromFiles(
|
||||
vsFileName, "vertexMain", video::EVST_VS_1_1,
|
||||
psFileName, "pixelMain", video::EPST_PS_1_1,
|
||||
mcTransparentAdd, video::EMT_TRANSPARENT_ADD_COLOR, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// create material from low level shaders (asm or arb_asm)
|
||||
|
||||
newMaterialType1 = gpu->addShaderMaterialFromFiles(vsFileName,
|
||||
psFileName, mcSolid, video::EMT_SOLID);
|
||||
|
||||
newMaterialType2 = gpu->addShaderMaterialFromFiles(vsFileName,
|
||||
psFileName, mcTransparentAdd, video::EMT_TRANSPARENT_ADD_COLOR);
|
||||
}
|
||||
|
||||
mcSolid->drop();
|
||||
mcTransparentAdd->drop();
|
||||
}
|
||||
|
||||
/*
|
||||
Now it's time for testing the materials. We create a test cube and set
|
||||
the material we created. In addition, we add a text scene node to the
|
||||
cube and a rotation animator to make it look more interesting and
|
||||
important.
|
||||
*/
|
||||
|
||||
// create test scene node 1, with the new created material type 1
|
||||
|
||||
scene::ISceneNode* node = smgr->addCubeSceneNode(50);
|
||||
node->setPosition(core::vector3df(0,0,0));
|
||||
node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp"));
|
||||
node->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType1);
|
||||
|
||||
smgr->addTextSceneNode(gui->getBuiltInFont(),
|
||||
L"PS & VS & EMT_SOLID",
|
||||
video::SColor(255,255,255,255), node);
|
||||
|
||||
scene::ISceneNodeAnimator* anim = smgr->createRotationAnimator(
|
||||
core::vector3df(0,0.3f,0));
|
||||
node->addAnimator(anim);
|
||||
anim->drop();
|
||||
|
||||
/*
|
||||
Same for the second cube, but with the second material we created.
|
||||
*/
|
||||
|
||||
// create test scene node 2, with the new created material type 2
|
||||
|
||||
node = smgr->addCubeSceneNode(50);
|
||||
node->setPosition(core::vector3df(0,-10,50));
|
||||
node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp"));
|
||||
node->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
node->setMaterialFlag(video::EMF_BLEND_OPERATION, true);
|
||||
node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType2);
|
||||
|
||||
smgr->addTextSceneNode(gui->getBuiltInFont(),
|
||||
L"PS & VS & EMT_TRANSPARENT",
|
||||
video::SColor(255,255,255,255), node);
|
||||
|
||||
anim = smgr->createRotationAnimator(core::vector3df(0,0.3f,0));
|
||||
node->addAnimator(anim);
|
||||
anim->drop();
|
||||
|
||||
/*
|
||||
Then we add a third cube without a shader on it, to be able to compare
|
||||
the cubes.
|
||||
*/
|
||||
|
||||
// add a scene node with no shader
|
||||
|
||||
node = smgr->addCubeSceneNode(50);
|
||||
node->setPosition(core::vector3df(0,50,25));
|
||||
node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp"));
|
||||
node->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
smgr->addTextSceneNode(gui->getBuiltInFont(), L"NO SHADER",
|
||||
video::SColor(255,255,255,255), node);
|
||||
|
||||
/*
|
||||
And last, we add a skybox and a user controlled camera to the scene.
|
||||
For the skybox textures, we disable mipmap generation, because we don't
|
||||
need mipmaps on it.
|
||||
*/
|
||||
|
||||
// add a nice skybox
|
||||
|
||||
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
|
||||
|
||||
smgr->addSkyBoxSceneNode(
|
||||
driver->getTexture(mediaPath + "irrlicht2_up.jpg"),
|
||||
driver->getTexture(mediaPath + "irrlicht2_dn.jpg"),
|
||||
driver->getTexture(mediaPath + "irrlicht2_lf.jpg"),
|
||||
driver->getTexture(mediaPath + "irrlicht2_rt.jpg"),
|
||||
driver->getTexture(mediaPath + "irrlicht2_ft.jpg"),
|
||||
driver->getTexture(mediaPath + "irrlicht2_bk.jpg"));
|
||||
|
||||
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);
|
||||
|
||||
// add a camera and disable the mouse cursor
|
||||
|
||||
scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS();
|
||||
cam->setPosition(core::vector3df(-100,50,100));
|
||||
cam->setTarget(core::vector3df(0,0,0));
|
||||
device->getCursorControl()->setVisible(false);
|
||||
|
||||
/*
|
||||
Now draw everything. That's all.
|
||||
*/
|
||||
|
||||
int lastFPS = -1;
|
||||
|
||||
while(device->run())
|
||||
if (device->isWindowActive())
|
||||
{
|
||||
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0));
|
||||
smgr->drawAll();
|
||||
driver->endScene();
|
||||
|
||||
int fps = driver->getFPS();
|
||||
|
||||
if (lastFPS != fps)
|
||||
{
|
||||
core::stringw str = L"Irrlicht Engine - Vertex and pixel shader example [";
|
||||
str += driver->getName();
|
||||
str += "] FPS:";
|
||||
str += fps;
|
||||
|
||||
device->setWindowCaption(str.c_str());
|
||||
lastFPS = fps;
|
||||
}
|
||||
}
|
||||
|
||||
device->drop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Compile and run this, and I hope you have fun with your new little shader
|
||||
writing tool :).
|
||||
**/
|
566
examples/10.Shaders/tutorial.html
Normal file
566
examples/10.Shaders/tutorial.html
Normal file
@ -0,0 +1,566 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Irrlicht Engine Tutorial</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
|
||||
<br>
|
||||
<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
|
||||
<tr>
|
||||
<td bgcolor="#666699" width="10"><b><a href="http://irrlicht.sourceforge.net" target="_blank"><img src="../../media/irrlichtlogo.jpg" width="88" height="31" border="0"></a></b></td>
|
||||
<td bgcolor="#666699" width="100%">
|
||||
<div align="center">
|
||||
<div align="left"><b><font color="#FFFFFF">Tutorial 10. Shaders</font></b></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr bgcolor="#eeeeff">
|
||||
<td height="90" colspan="2">
|
||||
<div align="left">
|
||||
<p> This tutorial shows how to use shaders for D3D8, D3D9 and OpenGL with
|
||||
the engine and how to create new material types with them. It also shows
|
||||
how to disable the generation of mipmaps at texture loading, and how
|
||||
to use text scene nodes.</p>
|
||||
<p>This tutorial does not explain how shaders work. I would recommend
|
||||
to read the D3D or OpenGL documentation, to search a tutorial, or to
|
||||
read a book about this.</p>
|
||||
<p>The program which is described here will look like this:</p>
|
||||
<p align="center"><img src="../../media/010shot.jpg" width="260" height="203"><br>
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
|
||||
<tr>
|
||||
<td bgcolor="#666699"> <b><font color="#FFFFFF">Lets start!</font></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="90" bgcolor="#eeeeff" valign="top"> <div align="left">
|
||||
<div align="left">
|
||||
<p>At first, we need to include all headers and do the stuff we always
|
||||
do, like in nearly all other tutorials:</p>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td> <pre>#include <irrlicht.h><br>#include <iostream><br><br>using namespace irr;<br><br>#pragma comment(lib, "Irrlicht.lib")<br></pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>Because we want to use some interesting shaders in this tutorials,
|
||||
we need to set some data for them to make them able to compute nice
|
||||
colors. In this example, we'll use a simple vertex shader which will
|
||||
calculate the color of the vertex based on the position of the camera.
|
||||
For this, the shader needs the following data: The inverted world
|
||||
matrix for transforming the normal, the clip matrix for transforming
|
||||
the position, the camera position and the world position of the object
|
||||
for the calculation of the angle of light, and the color of the light.
|
||||
To be able to tell the shader all this data every frame, we have to
|
||||
derive a class from the IShaderConstantSetCallBack interface and override
|
||||
its only method, namely OnSetConstants(). This method will be called
|
||||
every time the material is set. <br>
|
||||
The method setVertexShaderConstant() of the IMaterialRendererServices
|
||||
interface is used to set the data the shader needs. If the user chose
|
||||
to use a High Level shader language like HLSL instead of Assembler
|
||||
in this example, you have to set the variable name as parameter instead
|
||||
of the register index.</p>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td> <pre>IrrlichtDevice* device = 0;<br>bool UseHighLevelShaders = false;<br><br>class MyShaderCallBack : public video::IShaderConstantSetCallBack<br>{<br>public:
|
||||
<br> virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)<br> {<br> video::IVideoDriver* driver = services->getVideoDriver();<br><br> <font color="#006600">// set inverted world matrix<br> // if we are using highlevel shaders (the user can select this when<br> // starting the program), we must set the constants by name.</font><br> core::matrix4 invWorld = driver->getTransform(video::ETS_WORLD);<br> invWorld.makeInverse();<br><br> if (UseHighLevelShaders)<br> services->setVertexShaderConstant("mInvWorld", &invWorld.M[0], 16);<br> else<br> services->setVertexShaderConstant(&invWorld.M[0], 0, 4);<br><font color="#006600"><br> // set clip matrix<br></font> core::matrix4 worldViewProj;<br> worldViewProj = driver->getTransform(video::ETS_PROJECTION); <br> worldViewProj *= driver->getTransform(video::ETS_VIEW);<br> worldViewProj *= driver->getTransform(video::ETS_WORLD);<br><br> if (UseHighLevelShaders)<br> services->setVertexShaderConstant("mWorldViewProj", &worldViewProj.M[0], 16);<br> else<br> services->setVertexShaderConstant(&worldViewProj.M[0], 4, 4);<br> <br><font color="#006600"> </font><font color="#006600">// set camera position<br></font> core::vector3df pos = device->getSceneManager()-><br> getActiveCamera()->getAbsolutePosition();<br><br> if (UseHighLevelShaders)<br> services->setVertexShaderConstant("mLightPos", reinterpret_cast<f32*>(&pos), 3);<br> else<br> services->setVertexShaderConstant(reinterpret_cast<f32*>(&pos), 8, 1);<br><br><font color="#006600"> </font><font color="#006600">// set light color <br></font> video::SColorf col(0.0f,1.0f,1.0f,0.0f);<br><br> if (UseHighLevelShaders)<br> services->setVertexShaderConstant("mLightColor", reinterpret_cast<f32*>(&col), 4);<br> else<br> services->setVertexShaderConstant(reinterpret_cast<f32*>(&col), 9, 1);<br><br><font color="#006600"> </font><font color="#006600">// set transposed world matrix<br></font> core::matrix4 world = driver->getTransform(video::ETS_WORLD);<br> world = world.getTransposed();<br><br> if (UseHighLevelShaders)<br> services->setVertexShaderConstant("mTransWorld", &world.M[0], 16);<br> else<br> services->setVertexShaderConstant(&world.M[0], 10, 4);<br> }<br>};</pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> The next few lines start up the engine. Just like in most other
|
||||
tutorials before. But in addition, we ask the user if he wants this
|
||||
example to use high level shaders if he selected a driver which is
|
||||
capable of doing so.</p>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td> <pre>int main()<br>{<br><font color="#006600"> // let user select driver type</font><br><br> video::E_DRIVER_TYPE driverType = video::EDT_DIRECTX9;<br><br> printf("Please select the driver you want for this example:\n"\<br> " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\<br> " (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\<br> " (f) NullDevice\n (otherKey) exit\n\n");<br><br> char i;<br> std::cin >> i;<br><br> switch(i)<br> {<br> case 'a': driverType = video::EDT_DIRECT3D9;break;<br> case 'b': driverType = video::EDT_DIRECT3D8;break;<br> case 'c': driverType = video::EDT_OPENGL; break;<br> case 'd': driverType = video::EDT_SOFTWARE; break;<br> case 'e': driverType = video::EDT_BURNINGSVIDEO;break;<br> case 'f': driverType = video::EDT_NULL; break;<br> default: return 1;<br> } <br><br><font color="#006600"> </font> <font color="#006600">// ask the user if we should use high level shaders for this example<br> </font> if (driverType == video::EDT_DIRECT3D9 ||<br> driverType == video::EDT_OPENGL)
|
||||
{<br> printf("<font color="#CC0000">Please press 'y' if you want to use high level shaders.\n</font>");<br> std::cin >> i;<br> if (i == 'y')<br> UseHighLevelShaders = true;<br> }<br><br><font color="#006600"> // create devic</font>e<br><br> device = createDevice(driverType, core::dimension2d<s32>(640, 480));<br><br> if (device == 0)<br> {<br> printf(<font color="#CC0000">"\nWas not able to create driver.\n"\<br> "Please restart and select another driver.\n"</font>);<br> getch();<br> return 1;<br> } <br><br> video::IVideoDriver* driver = device->getVideoDriver();<br> scene::ISceneManager* smgr = device->getSceneManager();<br> gui::IGUIEnvironment* gui = device->getGUIEnvironment();</pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> Now for the more interesting parts. If we are using Direct3D, we
|
||||
want to load vertex and pixel shader programs, if we have<br>
|
||||
OpenGL, we want to use ARB fragment and vertex programs. I wrote the
|
||||
corresponding programs down into the files d3d8.ps, d3d8.vs, d3d9.ps,
|
||||
d3d9.vs, opengl.ps and opengl.vs. We only need the right filenames
|
||||
now. This is done in the following switch. Note, that it is not necessary
|
||||
to write the shaders into text files, like in this example. You can
|
||||
even write the shaders directly as strings into the cpp source file,
|
||||
and use later addShaderMaterial() instead of addShaderMaterialFromFiles().</p>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td> <pre> c8* vsFileName = 0<font color="#006600">; // filename for the vertex shader</font><br> c8* psFileName = 0<font color="#006600">; // filename for the pixel shader</font><br><br> switch(driverType)<br> {<br> case video::EDT_DIRECT3D8:<br> psFileName = "../../media/d3d8.psh";<br> vsFileName = "../../media/d3d8.vsh";<br> break;<br> case video::EDT_DIRECT3D9:<br> if (UseHighLevelShaders)<br> {<br> psFileName = "../../media/d3d9.hlsl";<br> vsFileName = psFileName; <font color="#006600">// both shaders are in the same file</font><br> }<br> else<br> {<br> psFileName = "../../media/d3d9.psh";<br> vsFileName = "../../media/d3d9.vsh";<br> }<br> break;<br> case video::EDT_OPENGL:<br> if (UseHighLevelShaders)<br> {<br> psFileName = "../../media/opengl.frag";<br> vsFileName = "../../media/opengl.vert";<br> }<br> else<br> {<br> psFileName = "../../media/opengl.psh";<br> vsFileName = "../../media/opengl.vsh";<br> }<br> break;<br> }<br></pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> In addition, we check if the hardware and the selected renderer
|
||||
is capable of executing the shaders we want. If not, we simply set
|
||||
the filename string to 0. This is not necessary, but useful in this
|
||||
example: For example, if the hardware is able to execute vertex shaders
|
||||
but not pixel shaders, we create a new material which only uses the
|
||||
vertex shader, and no pixel shader. Otherwise, if we would tell the
|
||||
engine to create this material and the engine sees that the hardware
|
||||
wouldn't be able to fullfill the request completely,<br>
|
||||
it would not create any new material at all. So in this example you
|
||||
would see at least the vertex shader in action, without the pixel
|
||||
shader.</p>
|
||||
</div>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td> <pre> if (!driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) &&<br> !driver->queryFeature(video::EVDF_ARB_FRAGMENT_PROGRAM_1))<br> {<br> device->getLogger()->log("WARNING: Pixel shaders disabled "\<br> "because of missing driver/hardware support.");<br> psFileName = 0;<br> }<br> <br> if (!driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1) &&<br> !driver->queryFeature(video::EVDF_ARB_VERTEX_PROGRAM_1))<br> {<br> device->getLogger()->log("WARNING: Vertex shaders disabled "\<br> "because of missing driver/hardware support.");<br> vsFileName = 0;<br> }</pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> Now lets create the new materials.<br>
|
||||
As you maybe know from previous examples, a material type in the Irrlicht
|
||||
engine is set by simply changing the MaterialType value in the SMaterial
|
||||
struct. And this value is just a simple 32 bit value, like video::EMT_SOLID.
|
||||
So we only need the engine to create a new value for us which we can
|
||||
set there. To do this, we get a pointer to the IGPUProgrammingServices
|
||||
and call addShaderMaterialFromFiles(), which returns such a new 32 bit
|
||||
value. That's all.<br>
|
||||
The parameters to this method are the following: First, the names of
|
||||
the files containing the code of the vertex and the pixel shader.<br>
|
||||
If you would use addShaderMaterial() instead, you would not need file
|
||||
names, then you could write the code of the shader directly as string.
|
||||
The following parameter is a pointer to the IShaderConstantSetCallBack
|
||||
class we wrote at the beginning of this tutorial. If you don't want
|
||||
to set constants, set this to 0. The last paramter tells the engine
|
||||
which material it should use as base material. <br>
|
||||
To demonstrate this, we create two materials with a different base material,
|
||||
one with EMT_SOLID and one with EMT_TRANSPARENT_ADD_COLOR.</p>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><pre> <font color="#006600">// create materials</font><br><br> video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices();<br><br> s32 newMaterialType1 = 0;<br> s32 newMaterialType2 = 0;<br><br> if (gpu)<br> {<br> MyShaderCallBack* mc = new MyShaderCallBack();<br> <font color="#006600">
|
||||
// create the shaders depending on if the user wanted high level<br> // or low level shaders:</font><br><br> if (UseHighLevelShaders)<br> {<br><font color="#006600"> // create material from high level shaders (hlsl or glsl)<br><br></font> newMaterialType1 = gpu->addHighLevelShaderMaterialFromFiles(<br> vsFileName, "vertexMain", video::EVST_VS_1_1,<br> psFileName, "pixelMain", video::EPST_PS_1_1,<br> mc, video::EMT_SOLID);<br><br> newMaterialType2 = gpu->addHighLevelShaderMaterialFromFiles(<br> vsFileName, "vertexMain", video::EVST_VS_1_1,<br> psFileName, "pixelMain", video::EPST_PS_1_1,<br> mc, video::EMT_TRANSPARENT_ADD_COLOR);<br> }<br> else<br> {<br><font color="#009900"> // create material from low level shaders (asm or arb_asm)<br></font><br> newMaterialType1 = gpu->addShaderMaterialFromFiles(vsFileName,<br> psFileName, mc, video::EMT_SOLID);<br><br> newMaterialType2 = gpu->addShaderMaterialFromFiles(vsFileName,<br> psFileName, mc, video::EMT_TRANSPARENT_ADD_COLOR);<br> }<br><br> mc->drop();<br> }<br></pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> Now its time for testing out the materials. We create a test cube
|
||||
and set the material we created. In addition, we add a text scene node
|
||||
to the cube and a rotatation animator, to make it look more interesting
|
||||
and important. </p>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><pre><font color="#006600">
|
||||
// create test scene node 1, with the new created material type 1</font>
|
||||
|
||||
scene::ISceneNode* node = smgr->addCubeSceneNode(50);
|
||||
node->setPosition(core::vector3df(0,0,0));
|
||||
node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
|
||||
node->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType1);
|
||||
|
||||
smgr->addTextSceneNode(gui->getBuiltInFont(),
|
||||
L"PS & VS & EMT_SOLID",
|
||||
video::SColor(255,255,255,255), node);
|
||||
|
||||
scene::ISceneNodeAnimator* anim = smgr->createRotationAnimator(
|
||||
core::vector3df(0,0.3f,0));
|
||||
node->addAnimator(anim);
|
||||
anim->drop();</pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> Same for the second cube, but with the second material we created.</p>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><pre> <font color="#006600">// create test scene node 2, with the new created material type 2</font>
|
||||
|
||||
node = smgr->addCubeSceneNode(50);
|
||||
node->setPosition(core::vector3df(0,-10,50));
|
||||
node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
|
||||
node->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType2);
|
||||
|
||||
smgr->addTextSceneNode(gui->getBuiltInFont(),
|
||||
L"PS & VS & EMT_TRANSPARENT",
|
||||
video::SColor(255,255,255,255), node);
|
||||
|
||||
anim = smgr->createRotationAnimator(core::vector3df(0,0.3f,0));
|
||||
node->addAnimator(anim);
|
||||
anim->drop();</pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
Then we add a third cube without a shader on it, to be able to compare
|
||||
the cubes.<br>
|
||||
<br>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><pre> <font color="#006600">// add a scene node with no shader </font>
|
||||
|
||||
node = smgr->addCubeSceneNode(50);
|
||||
node->setPosition(core::vector3df(0,50,25));
|
||||
node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
|
||||
node->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||
smgr->addTextSceneNode(gui->getBuiltInFont(), L"NO SHADER",
|
||||
video::SColor(255,255,255,255), node);
|
||||
</pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
And last, we add a skybox and a user controlled camera to the scene. For
|
||||
the skybox textures, we disable mipmap generation, because we don't need
|
||||
mipmaps on it.<br>
|
||||
<br>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><pre> <font color="#006600">// add a nice skybox</font><br><br> driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);<br><br> smgr->addSkyBoxSceneNode(<br> driver->getTexture("../../media/irrlicht2_up.jpg"),<br> driver->getTexture("../../media/irrlicht2_dn.jpg"),<br> driver->getTexture("../../media/irrlicht2_lf.jpg"),<br> driver->getTexture("../../media/irrlicht2_rt.jpg"),<br> driver->getTexture("../../media/irrlicht2_ft.jpg"),<br> driver->getTexture("../../media/irrlicht2_bk.jpg"));<br><br> driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);<br><br><font color="#006600"> // add a camera and disable the mouse curso</font>r<br><br> scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);<br> cam->setPosition(core::vector3df(-100,50,100));<br> cam->setTarget(core::vector3df(0,0,0));<br> device->getCursorControl()->setVisible(false);</pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
Now draw everything. That's all.<br>
|
||||
<br>
|
||||
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><pre> int lastFPS = -1;<br><br> while(device->run())<br> if (device->isWindowActive())<br> {<br> driver->beginScene(true, true, video::SColor(255,0,0,0));<br> smgr->drawAll();<br> driver->endScene();<br><br> int fps = driver->getFPS();<br><br> if (lastFPS != fps)<br> {<br> core::stringw str = L"Irrlicht Engine - Vertex and pixel shader example [";<br> str += driver->getName();<br> str += "] FPS:";<br> str += fps;<br> device->setWindowCaption(str.c_str());<br> lastFPS = fps;<br> }<br> }<br><br> device->drop();<br> <br> return 0;<br></pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
Compile and run this, and I hope you have fun with your new little shader
|
||||
writing tool :).<br>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
|
||||
<tr>
|
||||
<td bgcolor="#666699"> <b><font color="#FFFFFF">Shader files</font></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="90" bgcolor="#eeeeff" valign="top"> <div align="left">
|
||||
<div align="left">
|
||||
<p>The files containing the shaders can be found in the media directory
|
||||
of the SDK. However, they look like this:</p>
|
||||
<table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><strong>D3D9.HLSL</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<pre>
|
||||
// part of the Irrlicht Engine Shader example.
|
||||
// These simple Direct3D9 pixel and vertex shaders will be loaded by the shaders
|
||||
// example. Please note that these example shaders don't do anything really useful.
|
||||
// They only demonstrate that shaders can be used in Irrlicht.
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Global variables
|
||||
//-----------------------------------------------------------------------------
|
||||
float4x4 mWorldViewProj; // World * View * Projection transformation
|
||||
float4x4 mInvWorld; // Inverted world matrix
|
||||
float4x4 mTransWorld; // Transposed world matrix
|
||||
float3 mLightPos; // Light position
|
||||
float4 mLightColor; // Light color
|
||||
|
||||
|
||||
// Vertex shader output structure
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
float4 Position : POSITION; // vertex position
|
||||
float4 Diffuse : COLOR0; // vertex diffuse color
|
||||
float2 TexCoord : TEXCOORD0; // tex coords
|
||||
};
|
||||
|
||||
|
||||
VS_OUTPUT vertexMain( in float4 vPosition : POSITION,
|
||||
in float3 vNormal : NORMAL,
|
||||
float2 texCoord : TEXCOORD0 )
|
||||
{
|
||||
VS_OUTPUT Output;
|
||||
|
||||
// transform position to clip space
|
||||
Output.Position = mul(vPosition, mWorldViewProj);
|
||||
|
||||
// transform normal
|
||||
float3 normal = mul(vNormal, mInvWorld);
|
||||
|
||||
// renormalize normal
|
||||
normal = normalize(normal);
|
||||
|
||||
// position in world coodinates
|
||||
float3 worldpos = mul(mTransWorld, vPosition);
|
||||
|
||||
// calculate light vector, vtxpos - lightpos
|
||||
float3 lightVector = worldpos - mLightPos;
|
||||
|
||||
// normalize light vector
|
||||
lightVector = normalize(lightVector);
|
||||
|
||||
// calculate light color
|
||||
float3 tmp = dot(-lightVector, normal);
|
||||
tmp = lit(tmp.x, tmp.y, 1.0);
|
||||
|
||||
tmp = mLightColor * tmp.y;
|
||||
Output.Diffuse = float4(tmp.x, tmp.y, tmp.z, 0);
|
||||
Output.TexCoord = texCoord;
|
||||
|
||||
return Output;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Pixel shader output structure
|
||||
struct PS_OUTPUT
|
||||
{
|
||||
float4 RGBColor : COLOR0; // Pixel color
|
||||
};
|
||||
|
||||
|
||||
sampler2D tex0;
|
||||
|
||||
PS_OUTPUT pixelMain( float2 TexCoord : TEXCOORD0,
|
||||
float4 Position : POSITION,
|
||||
float4 Diffuse : COLOR0 )
|
||||
{
|
||||
PS_OUTPUT Output;
|
||||
|
||||
float4 col = tex2D( tex0, TexCoord ); // sample color map
|
||||
|
||||
// multiply with diffuse and do other senseless operations
|
||||
Output.RGBColor = Diffuse * col;
|
||||
Output.RGBColor *= 4.0;
|
||||
|
||||
return Output;
|
||||
}</pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><strong>D3D9.VSH</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <pre>
|
||||
; part of the Irrlicht Engine Shader example.
|
||||
; This Direct3D9 vertex shader will be loaded by the engine.
|
||||
; Please note that these example shaders don't do anything really useful.
|
||||
; They only demonstrate that shaders can be used in Irrlicht.<br>
|
||||
vs.1.1
|
||||
|
||||
dcl_position v0; ; declare position
|
||||
dcl_normal v1; ; declare normal
|
||||
dcl_color v2; ; declare color
|
||||
dcl_texcoord0 v3; ; declare texture coordinate<br>
|
||||
; transpose and transform position to clip space
|
||||
mul r0, v0.x, c4
|
||||
mad r0, v0.y, c5, r0
|
||||
mad r0, v0.z, c6, r0
|
||||
add oPos, c7, r0
|
||||
|
||||
; transform normal
|
||||
dp3 r1.x, v1, c0
|
||||
dp3 r1.y, v1, c1
|
||||
dp3 r1.z, v1, c2
|
||||
|
||||
; renormalize normal
|
||||
dp3 r1.w, r1, r1
|
||||
rsq r1.w, r1.w
|
||||
mul r1, r1, r1.w
|
||||
|
||||
; calculate light vector
|
||||
m4x4 r6, v0, c10 ; vertex into world position
|
||||
add r2, c8, -r6 ; vtxpos - lightpos
|
||||
|
||||
; normalize light vector
|
||||
dp3 r2.w, r2, r2
|
||||
rsq r2.w, r2.w
|
||||
mul r2, r2, r2.w
|
||||
|
||||
; calculate light color
|
||||
dp3 r3, r1, r2 ; dp3 with negative light vector
|
||||
lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y
|
||||
mul oD0, r5.y, c9 ; ouput diffuse color
|
||||
mov oT0, v3 ; store texture coordinates </pre> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><strong>D3D9.PSH</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <pre>
|
||||
; part of the Irrlicht Engine Shader example.
|
||||
; This simple Direct3D9 pixel shader will be loaded by the engine.
|
||||
; Please note that these example shaders don't do anything really useful.
|
||||
; They only demonstrate that shaders can be used in Irrlicht.<br>
|
||||
ps.1.1
|
||||
|
||||
tex t0 ; sample color map
|
||||
add r0, v0, v0 ; mulitply with color
|
||||
mul t0, t0, r0 ; mulitply with color
|
||||
add r0, t0, t0 ; make it brighter and store result
|
||||
</pre> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><strong>D3D8.VSH</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <pre>
|
||||
; part of the Irrlicht Engine Shader example.
|
||||
; This Direct3D9 vertex shader will be loaded by the engine.
|
||||
; Please note that these example shaders don't do anything really useful.
|
||||
; They only demonstrate that shaders can be used in Irrlicht.<br>
|
||||
vs.1.1
|
||||
|
||||
; transpose and transform position to clip space
|
||||
mul r0, v0.x, c4
|
||||
mad r0, v0.y, c5, r0
|
||||
mad r0, v0.z, c6, r0
|
||||
add oPos, c7, r0
|
||||
|
||||
; transform normal
|
||||
dp3 r1.x, v1, c0
|
||||
dp3 r1.y, v1, c1
|
||||
dp3 r1.z, v1, c2
|
||||
|
||||
; renormalize normal
|
||||
dp3 r1.w, r1, r1
|
||||
rsq r1.w, r1.w
|
||||
mul r1, r1, r1.w
|
||||
|
||||
; calculate light vector
|
||||
m4x4 r6, v0, c10 ; vertex into world position
|
||||
add r2, c8, -r6 ; vtxpos - lightpos
|
||||
|
||||
; normalize light vector
|
||||
dp3 r2.w, r2, r2
|
||||
rsq r2.w, r2.w
|
||||
mul r2, r2, r2.w
|
||||
|
||||
; calculate light color
|
||||
dp3 r3, r1, r2 ; dp3 with negative light vector
|
||||
lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y
|
||||
mul oD0, r5.y, c9 ; ouput diffuse color
|
||||
mov oT0, v3 ; store texture coordinates </pre> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><strong>D3D8.PSH</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <pre>
|
||||
; part of the Irrlicht Engine Shader example.
|
||||
; This simple Direct3D9 pixel shader will be loaded by the engine.
|
||||
; Please note that these example shaders don't do anything really useful.
|
||||
; They only demonstrate that shaders can be used in Irrlicht.<br>
|
||||
ps.1.1
|
||||
|
||||
tex t0 ; sample color map
|
||||
mul_x2 t0, t0, v0 ; mulitply with color
|
||||
add r0, t0, t0 ; make it brighter and store result </pre> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><strong>OPENGL.VSH</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <pre>
|
||||
!!ARBvp1.0
|
||||
# part of the Irrlicht Engine Shader example.
|
||||
# Please note that these example shaders don't do anything really useful.
|
||||
# They only demonstrate that shaders can be used in Irrlicht.<br>
|
||||
#input
|
||||
ATTRIB InPos = vertex.position;
|
||||
ATTRIB InColor = vertex.color;
|
||||
ATTRIB InNormal = vertex.normal;
|
||||
ATTRIB InTexCoord = vertex.texcoord;
|
||||
|
||||
#output
|
||||
OUTPUT OutPos = result.position;
|
||||
OUTPUT OutColor = result.color;
|
||||
OUTPUT OutTexCoord = result.texcoord;
|
||||
|
||||
PARAM MVP[4] = { state.matrix.mvp }; # modelViewProjection matrix.
|
||||
TEMP Temp;
|
||||
TEMP TempColor;
|
||||
TEMP TempNormal;
|
||||
TEMP TempPos;
|
||||
|
||||
#transform position to clip space
|
||||
DP4 Temp.x, MVP[0], InPos;
|
||||
DP4 Temp.y, MVP[1], InPos;
|
||||
DP4 Temp.z, MVP[2], InPos;
|
||||
DP4 Temp.w, MVP[3], InPos;
|
||||
|
||||
#transform normal
|
||||
DP3 TempNormal.x, InNormal.x, program.local[0];
|
||||
DP3 TempNormal.y, InNormal.y, program.local[1];
|
||||
DP3 TempNormal.z, InNormal.z, program.local[2];
|
||||
|
||||
#renormalize normal
|
||||
DP3 TempNormal.w, TempNormal, TempNormal;
|
||||
RSQ TempNormal.w, TempNormal.w;
|
||||
MUL TempNormal, TempNormal, TempNormal.w;
|
||||
|
||||
# calculate light vector
|
||||
DP4 TempPos.x, InPos, program.local[10]; # vertex into world position
|
||||
DP4 TempPos.y, InPos, program.local[11];
|
||||
DP4 TempPos.z, InPos, program.local[12];
|
||||
DP4 TempPos.w, InPos, program.local[13];
|
||||
|
||||
ADD TempPos, program.local[8], -TempPos; # vtxpos - lightpos
|
||||
|
||||
# normalize light vector
|
||||
DP3 TempPos.w, TempPos, TempPos;
|
||||
RSQ TempPos.w, TempPos.w;
|
||||
MUL TempPos, TempPos, TempPos.w;
|
||||
|
||||
# calculate light color
|
||||
DP3 TempColor, TempNormal, TempPos; # dp3 with negative light vector
|
||||
LIT OutColor, TempColor; # clamp to zero if r3 < 0, r5 has diffuce component in r5.y
|
||||
MUL OutColor, TempColor.y, program.local[9]; # ouput diffuse color
|
||||
MOV OutColor.w, 1.0; # we want alpha to be always 1
|
||||
MOV OutTexCoord, InTexCoord; # store texture coordinate
|
||||
MOV OutPos, Temp;
|
||||
|
||||
END</pre> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table width="95%" border="0" cellspacing="4" cellpadding="0" bgcolor="#CCCCCC" align="center">
|
||||
<tr>
|
||||
<td><strong>OPENGL.PSH</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <pre>
|
||||
!!ARBfp1.0
|
||||
# part of the Irrlicht Engine Shader example.
|
||||
# Please note that these example shaders don't do anything really useful.
|
||||
# They only demonstrate that shaders can be used in Irrlicht.<br>
|
||||
#Input
|
||||
ATTRIB inTexCoord = fragment.texcoord; # texture coordinates
|
||||
ATTRIB inColor = fragment.color.primary; # interpolated diffuse color
|
||||
|
||||
#Output
|
||||
OUTPUT outColor = result.color;
|
||||
|
||||
TEMP texelColor;
|
||||
TEMP tmp;
|
||||
TXP texelColor, inTexCoord, texture, 2D;
|
||||
|
||||
ADD tmp, inColor, inColor; # mulitply with color
|
||||
MUL texelColor, texelColor, tmp; # mulitply with color
|
||||
ADD outColor, texelColor, texelColor; # make it brighter and store result
|
||||
|
||||
END </pre> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> </p>
|
||||
</div>
|
||||
</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user