diff options
Diffstat (limited to 'examples/19.MouseAndJoystick')
| -rw-r--r-- | examples/19.MouseAndJoystick/Makefile | 39 | ||||
| -rw-r--r-- | examples/19.MouseAndJoystick/MouseAndJoystick.cbp | 56 | ||||
| -rw-r--r-- | examples/19.MouseAndJoystick/MouseAndJoystick.dev | 59 | ||||
| -rw-r--r-- | examples/19.MouseAndJoystick/MouseAndJoystick.vcproj | 162 | ||||
| -rw-r--r-- | examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj | 231 | ||||
| -rw-r--r-- | examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj | 231 | ||||
| -rw-r--r-- | examples/19.MouseAndJoystick/MouseAndJoystick_vc12.vcxproj | 231 | ||||
| -rw-r--r-- | examples/19.MouseAndJoystick/MouseAndJoystick_vc8.vcproj | 231 | ||||
| -rw-r--r-- | examples/19.MouseAndJoystick/MouseAndJoystick_vc9.vcproj | 230 | ||||
| -rw-r--r-- | examples/19.MouseAndJoystick/main.cpp | 285 | ||||
| -rw-r--r-- | examples/19.MouseAndJoystick/tutorial.html | 205 |
11 files changed, 1960 insertions, 0 deletions
diff --git a/examples/19.MouseAndJoystick/Makefile b/examples/19.MouseAndJoystick/Makefile new file mode 100644 index 0000000..2462ea8 --- /dev/null +++ b/examples/19.MouseAndJoystick/Makefile @@ -0,0 +1,39 @@ +# 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
+Target = 19.MouseAndJoystick
+Sources = main.cpp
+
+# general compiler settings
+CPPFLAGS = -I../../include -I/usr/X11R6/include
+#CXXFLAGS = -O3 -ffast-math
+CXXFLAGS = -g -Wall
+
+#default target is Linux
+all: all_linux
+
+ifeq ($(HOSTTYPE), x86_64)
+LIBSELECT=64
+endif
+
+# target specific settings
+all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor
+all_linux clean_linux: SYSTEM=Linux
+all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
+all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL
+all_win32 clean_win32: SYSTEM=Win32-gcc
+all_win32 clean_win32: SUF=.exe
+# name of the binary - only valid for targets which set SYSTEM
+DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
+
+all_linux all_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 clean clean_linux clean_win32
diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick.cbp b/examples/19.MouseAndJoystick/MouseAndJoystick.cbp new file mode 100644 index 0000000..7400072 --- /dev/null +++ b/examples/19.MouseAndJoystick/MouseAndJoystick.cbp @@ -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 19 MouseAndJoystick" /> + <Option pch_mode="0" /> + <Option compiler="gcc" /> + <Build> + <Target title="Windows"> + <Option platforms="Windows;" /> + <Option output="../../bin/Win32-gcc/MouseAndJoystick" 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/MouseAndJoystick" 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> diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick.dev b/examples/19.MouseAndJoystick/MouseAndJoystick.dev new file mode 100644 index 0000000..cac8418 --- /dev/null +++ b/examples/19.MouseAndJoystick/MouseAndJoystick.dev @@ -0,0 +1,59 @@ +[Project]
+FileName=example.dev
+Name=Irrlicht Example 04 MouseAndJoystick
+UnitCount=1
+Type=1
+Ver=1
+ObjFiles=
+Includes=..\..\include
+Libs=
+PrivateResource=
+ResourceIncludes=
+MakeIncludes=
+Compiler=
+CppCompiler=
+Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_
+IsCpp=1
+Icon=
+ExeOutput=../../bin/Win32-gcc
+ObjectOutput=obj
+OverrideOutput=1
+OverrideOutputName=19.MouseAndJoystick.exe
+HostApplication=
+Folders=
+CommandLine=
+IncludeVersionInfo=0
+SupportXPThemes=0
+CompilerSet=0
+CompilerSettings=0000000000000000000000
+UseCustomMakefile=0
+CustomMakefile=
+
+[Unit1]
+FileName=main.cpp
+CompileCpp=1
+Folder=Projekt1
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[VersionInfo]
+Major=0
+Minor=1
+Release=1
+Build=1
+LanguageID=1033
+CharsetID=1252
+CompanyName=
+FileVersion=
+FileDescription=Irrlicht Engine example compiled using DevCpp and gcc
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=
+AutoIncBuildNr=0
+
diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick.vcproj b/examples/19.MouseAndJoystick/MouseAndJoystick.vcproj new file mode 100644 index 0000000..84d8396 --- /dev/null +++ b/examples/19.MouseAndJoystick/MouseAndJoystick.vcproj @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="19.MouseAndJoystick"
+ ProjectGUID="{FE853A36-E0D1-4AC5-A792-B643E70D2953}"
+ 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/MouseAndJoystick.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\19.MouseAndJoystick.exe"
+ LinkIncremental="0"
+ SuppressStartupBanner="TRUE"
+ AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile=".\Debug/MouseAndJoystick.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Debug/MouseAndJoystick.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/MouseAndJoystick.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe"
+ LinkIncremental="0"
+ SuppressStartupBanner="TRUE"
+ AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Release/MouseAndJoystick.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>
diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj new file mode 100644 index 0000000..16c3a38 --- /dev/null +++ b/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj @@ -0,0 +1,231 @@ +<?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>19.MouseAndJoystick</ProjectName>
+ <ProjectGuid>{FE853A36-E0D1-4AC5-A792-B643E70D2953}</ProjectGuid>
+ <RootNamespace>MouseAndJoystick</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <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/MouseAndJoystick.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\19.MouseAndJoystick.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/MouseAndJoystick.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\19.MouseAndJoystick.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/MouseAndJoystick.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\19.MouseAndJoystick.exe</OutputFile>
+ <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <SubSystem>Console</SubSystem>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TypeLibraryName>.\Release/MouseAndJoystick.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\19.MouseAndJoystick.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>
\ No newline at end of file diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj new file mode 100644 index 0000000..16c3a38 --- /dev/null +++ b/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj @@ -0,0 +1,231 @@ +<?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>19.MouseAndJoystick</ProjectName>
+ <ProjectGuid>{FE853A36-E0D1-4AC5-A792-B643E70D2953}</ProjectGuid>
+ <RootNamespace>MouseAndJoystick</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <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/MouseAndJoystick.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\19.MouseAndJoystick.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/MouseAndJoystick.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\19.MouseAndJoystick.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/MouseAndJoystick.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\19.MouseAndJoystick.exe</OutputFile>
+ <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <SubSystem>Console</SubSystem>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TypeLibraryName>.\Release/MouseAndJoystick.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\19.MouseAndJoystick.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>
\ No newline at end of file diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc12.vcxproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc12.vcxproj new file mode 100644 index 0000000..24dca69 --- /dev/null +++ b/examples/19.MouseAndJoystick/MouseAndJoystick_vc12.vcxproj @@ -0,0 +1,231 @@ +<?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>19.MouseAndJoystick</ProjectName>
+ <ProjectGuid>{FE853A36-E0D1-4AC5-A792-B643E70D2953}</ProjectGuid>
+ <RootNamespace>MouseAndJoystick</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <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/MouseAndJoystick.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\19.MouseAndJoystick.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/MouseAndJoystick.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\19.MouseAndJoystick.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/MouseAndJoystick.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\19.MouseAndJoystick.exe</OutputFile>
+ <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <SubSystem>Console</SubSystem>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TypeLibraryName>.\Release/MouseAndJoystick.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\19.MouseAndJoystick.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>
\ No newline at end of file diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc8.vcproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc8.vcproj new file mode 100644 index 0000000..51b7fac --- /dev/null +++ b/examples/19.MouseAndJoystick/MouseAndJoystick_vc8.vcproj @@ -0,0 +1,231 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="19.MouseAndJoystick_vc8"
+ ProjectGUID="{FE853A36-E0D1-4AC5-A792-B643E70D2953}"
+ RootNamespace="MouseAndJoystick_vc8"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Debug/MouseAndJoystick.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/MouseAndJoystick.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="3079"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe"
+ LinkIncremental="0"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/MouseAndJoystick.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Release/MouseAndJoystick.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/MouseAndJoystick.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="3079"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe"
+ LinkIncremental="0"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
+ ProgramDatabaseFile=".\Release/MouseAndJoystick.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </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>
diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc9.vcproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc9.vcproj new file mode 100644 index 0000000..e121452 --- /dev/null +++ b/examples/19.MouseAndJoystick/MouseAndJoystick_vc9.vcproj @@ -0,0 +1,230 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="19.MouseAndJoystick_vc9"
+ ProjectGUID="{FE853A36-E0D1-4AC5-A792-B643E70D2953}"
+ RootNamespace="MouseAndJoystick_vc9"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Debug/MouseAndJoystick.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/MouseAndJoystick.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="3079"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe"
+ LinkIncremental="0"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/MouseAndJoystick.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Release/MouseAndJoystick.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/MouseAndJoystick.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="3079"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe"
+ LinkIncremental="0"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
+ ProgramDatabaseFile=".\Release/MouseAndJoystick.pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </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>
diff --git a/examples/19.MouseAndJoystick/main.cpp b/examples/19.MouseAndJoystick/main.cpp new file mode 100644 index 0000000..4563278 --- /dev/null +++ b/examples/19.MouseAndJoystick/main.cpp @@ -0,0 +1,285 @@ +/** Example 019 Mouse and Joystick
+
+This tutorial builds on example 04.Movement which showed how to
+handle keyboard events in Irrlicht. Here we'll handle mouse events
+and joystick events, if you have a joystick connected and a device
+that supports joysticks. These are currently Windows, Linux and SDL
+devices.
+*/
+
+#ifdef _MSC_VER
+// We'll define this to stop MSVC complaining about sprintf().
+#define _CRT_SECURE_NO_WARNINGS
+#pragma comment(lib, "Irrlicht.lib")
+#endif
+
+#include <irrlicht.h>
+#include "driverChoice.h"
+
+using namespace irr;
+
+/*
+Just as we did in example 04.Movement, we'll store the latest state of the
+mouse and the first joystick, updating them as we receive events.
+*/
+class MyEventReceiver : public IEventReceiver
+{
+public:
+ // We'll create a struct to record info on the mouse state
+ struct SMouseState
+ {
+ core::position2di Position;
+ bool LeftButtonDown;
+ SMouseState() : LeftButtonDown(false) { }
+ } MouseState;
+
+ // This is the one method that we have to implement
+ virtual bool OnEvent(const SEvent& event)
+ {
+ // Remember the mouse state
+ if (event.EventType == irr::EET_MOUSE_INPUT_EVENT)
+ {
+ switch(event.MouseInput.Event)
+ {
+ case EMIE_LMOUSE_PRESSED_DOWN:
+ MouseState.LeftButtonDown = true;
+ break;
+
+ case EMIE_LMOUSE_LEFT_UP:
+ MouseState.LeftButtonDown = false;
+ break;
+
+ case EMIE_MOUSE_MOVED:
+ MouseState.Position.X = event.MouseInput.X;
+ MouseState.Position.Y = event.MouseInput.Y;
+ break;
+
+ default:
+ // We won't use the wheel
+ break;
+ }
+ }
+
+ // The state of each connected joystick is sent to us
+ // once every run() of the Irrlicht device. Store the
+ // state of the first joystick, ignoring other joysticks.
+ // This is currently only supported on Windows and Linux.
+ if (event.EventType == irr::EET_JOYSTICK_INPUT_EVENT
+ && event.JoystickEvent.Joystick == 0)
+ {
+ JoystickState = event.JoystickEvent;
+ }
+
+ return false;
+ }
+
+ const SEvent::SJoystickEvent & GetJoystickState(void) const
+ {
+ return JoystickState;
+ }
+
+ const SMouseState & GetMouseState(void) const
+ {
+ return MouseState;
+ }
+
+
+ MyEventReceiver()
+ {
+ }
+
+private:
+ SEvent::SJoystickEvent JoystickState;
+};
+
+
+/*
+The event receiver for keeping the pressed keys is ready, the actual responses
+will be made inside the render loop, right before drawing the scene. So lets
+just create an irr::IrrlichtDevice and the scene node we want to move. We also
+create some other additional scene nodes, to show that there are also some
+different possibilities to move and animate scene nodes.
+*/
+int main()
+{
+ // ask user for driver
+ video::E_DRIVER_TYPE driverType=driverChoiceConsole();
+ if (driverType==video::EDT_COUNT)
+ return 1;
+
+ // create device
+ MyEventReceiver receiver;
+
+ IrrlichtDevice* device = createDevice(driverType,
+ core::dimension2d<u32>(640, 480), 16, false, false, false, &receiver);
+
+ if (device == 0)
+ return 1; // could not create selected driver.
+
+
+ core::array<SJoystickInfo> joystickInfo;
+ if(device->activateJoysticks(joystickInfo))
+ {
+ std::cout << "Joystick support is enabled and " << joystickInfo.size() << " joystick(s) are present." << std::endl;
+
+ for(u32 joystick = 0; joystick < joystickInfo.size(); ++joystick)
+ {
+ std::cout << "Joystick " << joystick << ":" << std::endl;
+ std::cout << "\tName: '" << joystickInfo[joystick].Name.c_str() << "'" << std::endl;
+ std::cout << "\tAxes: " << joystickInfo[joystick].Axes << std::endl;
+ std::cout << "\tButtons: " << joystickInfo[joystick].Buttons << std::endl;
+
+ std::cout << "\tHat is: ";
+
+ switch(joystickInfo[joystick].PovHat)
+ {
+ case SJoystickInfo::POV_HAT_PRESENT:
+ std::cout << "present" << std::endl;
+ break;
+
+ case SJoystickInfo::POV_HAT_ABSENT:
+ std::cout << "absent" << std::endl;
+ break;
+
+ case SJoystickInfo::POV_HAT_UNKNOWN:
+ default:
+ std::cout << "unknown" << std::endl;
+ break;
+ }
+ }
+ }
+ else
+ {
+ std::cout << "Joystick support is not enabled." << std::endl;
+ }
+
+ core::stringw tmp = L"Irrlicht Joystick Example (";
+ tmp += joystickInfo.size();
+ tmp += " joysticks)";
+ device->setWindowCaption(tmp.c_str());
+
+ video::IVideoDriver* driver = device->getVideoDriver();
+ scene::ISceneManager* smgr = device->getSceneManager();
+
+ /*
+ We'll create an arrow mesh and move it around either with the joystick axis/hat,
+ or make it follow the mouse pointer. */
+ scene::ISceneNode * node = smgr->addMeshSceneNode(
+ smgr->addArrowMesh( "Arrow",
+ video::SColor(255, 255, 0, 0),
+ video::SColor(255, 0, 255, 0),
+ 16,16,
+ 2.f, 1.3f,
+ 0.1f, 0.6f
+ )
+ );
+ node->setMaterialFlag(video::EMF_LIGHTING, false);
+
+ scene::ICameraSceneNode * camera = smgr->addCameraSceneNode();
+ camera->setPosition(core::vector3df(0, 0, -10));
+
+ // As in example 04, we'll use framerate independent movement.
+ u32 then = device->getTimer()->getTime();
+ const f32 MOVEMENT_SPEED = 5.f;
+
+ while(device->run())
+ {
+ // Work out a frame delta time.
+ const u32 now = device->getTimer()->getTime();
+ const f32 frameDeltaTime = (f32)(now - then) / 1000.f; // Time in seconds
+ then = now;
+
+ bool movedWithJoystick = false;
+ core::vector3df nodePosition = node->getPosition();
+
+ if(joystickInfo.size() > 0)
+ {
+ f32 moveHorizontal = 0.f; // Range is -1.f for full left to +1.f for full right
+ f32 moveVertical = 0.f; // -1.f for full down to +1.f for full up.
+
+ const SEvent::SJoystickEvent & joystickData = receiver.GetJoystickState();
+
+ // We receive the full analog range of the axes, and so have to implement our
+ // own dead zone. This is an empirical value, since some joysticks have more
+ // jitter or creep around the center point than others. We'll use 5% of the
+ // range as the dead zone, but generally you would want to give the user the
+ // option to change this.
+ const f32 DEAD_ZONE = 0.05f;
+
+ moveHorizontal =
+ (f32)joystickData.Axis[SEvent::SJoystickEvent::AXIS_X] / 32767.f;
+ if(fabs(moveHorizontal) < DEAD_ZONE)
+ moveHorizontal = 0.f;
+
+ moveVertical =
+ (f32)joystickData.Axis[SEvent::SJoystickEvent::AXIS_Y] / -32767.f;
+ if(fabs(moveVertical) < DEAD_ZONE)
+ moveVertical = 0.f;
+
+ // POV hat info is only currently supported on Windows, but the value is
+ // guaranteed to be 65535 if it's not supported, so we can check its range.
+ const u16 povDegrees = joystickData.POV / 100;
+ if(povDegrees < 360)
+ {
+ if(povDegrees > 0 && povDegrees < 180)
+ moveHorizontal = 1.f;
+ else if(povDegrees > 180)
+ moveHorizontal = -1.f;
+
+ if(povDegrees > 90 && povDegrees < 270)
+ moveVertical = -1.f;
+ else if(povDegrees > 270 || povDegrees < 90)
+ moveVertical = +1.f;
+ }
+
+ if(!core::equals(moveHorizontal, 0.f) || !core::equals(moveVertical, 0.f))
+ {
+ nodePosition.X += MOVEMENT_SPEED * frameDeltaTime * moveHorizontal;
+ nodePosition.Y += MOVEMENT_SPEED * frameDeltaTime * moveVertical;
+ movedWithJoystick = true;
+ }
+ }
+
+ // If the arrow node isn't being moved with the joystick, then have it follow the mouse cursor.
+ if(!movedWithJoystick)
+ {
+ // Create a ray through the mouse cursor.
+ core::line3df ray = smgr->getSceneCollisionManager()->getRayFromScreenCoordinates(
+ receiver.GetMouseState().Position, camera);
+
+ // And intersect the ray with a plane around the node facing towards the camera.
+ core::plane3df plane(nodePosition, core::vector3df(0, 0, -1));
+ core::vector3df mousePosition;
+ if(plane.getIntersectionWithLine(ray.start, ray.getVector(), mousePosition))
+ {
+ // We now have a mouse position in 3d space; move towards it.
+ core::vector3df toMousePosition(mousePosition - nodePosition);
+ const f32 availableMovement = MOVEMENT_SPEED * frameDeltaTime;
+
+ if(toMousePosition.getLength() <= availableMovement)
+ nodePosition = mousePosition; // Jump to the final position
+ else
+ nodePosition += toMousePosition.normalize() * availableMovement; // Move towards it
+ }
+ }
+
+ node->setPosition(nodePosition);
+
+ // Turn lighting on and off depending on whether the left mouse button is down.
+ node->setMaterialFlag(video::EMF_LIGHTING, receiver.GetMouseState().LeftButtonDown);
+
+ driver->beginScene(true, true, video::SColor(255,113,113,133));
+ smgr->drawAll(); // draw the 3d scene
+ driver->endScene();
+ }
+
+ /*
+ In the end, delete the Irrlicht device.
+ */
+ device->drop();
+
+ return 0;
+}
+
+/*
+**/
diff --git a/examples/19.MouseAndJoystick/tutorial.html b/examples/19.MouseAndJoystick/tutorial.html new file mode 100644 index 0000000..fccc53d --- /dev/null +++ b/examples/19.MouseAndJoystick/tutorial.html @@ -0,0 +1,205 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> +<head> +<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> +<meta http-equiv="X-UA-Compatible" content="IE=9"/> +<meta name="generator" content="Doxygen 1.8.13"/> +<meta name="viewport" content="width=device-width, initial-scale=1"/> +<title>Tutorial 19: Mouse and Joystick</title> +<html xmlns="http://www.w3.org/1999/xhtml"> +<!-- Wanted to avoid copying .css to each folder, so copied default .css from doxyen in here, kicked out most stuff we don't need for examples and modified some a little bit. + Target was having a single html in each example folder which is created from the main.cpp files and needs no files besides some images below media folder. + Feel free to improve :) + --> +<style> +body, table, div, p, dl { + font: 400 14px/22px; +} +body { + background-color: #F0F0F0; + color: black; + margin-left: 5%; + margin-right: 5%; +} +p.reference, p.definition { + font: 400 14px/22px; +} +.title { + font: 400 14px/28px; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} +caption { + font-weight: bold; +} +h3.version { + font-size: 90%; + text-align: center; +} +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} +.contents a:visited { + color: #4665A2; +} +a:hover { + text-decoration: underline; +} +a.el { + font-weight: bold; +} +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} +div.fragment { + padding: 0px; + margin: 4px 8px 4px 2px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} +div.center img { + border: 0px; +} +span.keyword { + color: #008000 +} +span.keywordtype { + color: #604020 +} +span.keywordflow { + color: #e08000 +} +span.comment { + color: #800000 +} +span.preprocessor { + color: #806020 +} +span.stringliteral { + color: #002080 +} +span.charliteral { + color: #008080 +} +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} +address { + font-style: normal; + color: #2A3D61; +} +div.header { + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} +div.headertitle { + padding: 5px 5px 5px 10px; +} +.image { + text-align: center; +} +.caption { + font-weight: bold; +} +div.zoom { + border: 1px solid #90A5CE; +} +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} +</style> +</head> +<div id="top"><!-- do not remove this div, it is closed by doxygen! --> +<!--END TITLEAREA--> +<!-- end header part --> +<!-- Generated by Doxygen 1.8.13 --> +</div><!-- top --> +<div class="header"> + <div class="headertitle"> +<div class="title">Tutorial 19: Mouse and Joystick </div> </div> +</div><!--header--> +<div class="contents"> +<div class="textblock"><div class="image"> +<img src="../../media/019shot.jpg" alt="019shot.jpg"/> +</div> + <p>This tutorial builds on example 04.Movement which showed how to handle keyboard events in Irrlicht. Here we'll handle mouse events and joystick events, if you have a joystick connected and a device that supports joysticks. These are currently Windows, Linux and SDL devices. </p><div class="fragment"><div class="line"><span class="preprocessor">#ifdef _MSC_VER</span></div><div class="line"><span class="comment">// We'll define this to stop MSVC complaining about sprintf().</span></div><div class="line"><span class="preprocessor">#define _CRT_SECURE_NO_WARNINGS</span></div><div class="line"><span class="preprocessor">#pragma comment(lib, "Irrlicht.lib")</span></div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include <irrlicht.h></span></div><div class="line"><span class="preprocessor">#include "driverChoice.h"</span></div><div class="line"></div><div class="line"><span class="keyword">using namespace </span>irr;</div></div><!-- fragment --><p> Just as we did in example 04.Movement, we'll store the latest state of the mouse and the first joystick, updating them as we receive events. </p><div class="fragment"><div class="line"><span class="keyword">class </span>MyEventReceiver : <span class="keyword">public</span> IEventReceiver</div><div class="line">{</div><div class="line"><span class="keyword">public</span>:</div><div class="line"> <span class="comment">// We'll create a struct to record info on the mouse state</span></div><div class="line"> <span class="keyword">struct </span>SMouseState</div><div class="line"> {</div><div class="line"> core::position2di Position;</div><div class="line"> <span class="keywordtype">bool</span> LeftButtonDown;</div><div class="line"> SMouseState() : LeftButtonDown(false) { }</div><div class="line"> } MouseState;</div><div class="line"></div><div class="line"> <span class="comment">// This is the one method that we have to implement</span></div><div class="line"> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> OnEvent(<span class="keyword">const</span> SEvent& event)</div><div class="line"> {</div><div class="line"> <span class="comment">// Remember the mouse state</span></div><div class="line"> <span class="keywordflow">if</span> (event.EventType == irr::EET_MOUSE_INPUT_EVENT)</div><div class="line"> {</div><div class="line"> <span class="keywordflow">switch</span>(event.MouseInput.Event)</div><div class="line"> {</div><div class="line"> <span class="keywordflow">case</span> EMIE_LMOUSE_PRESSED_DOWN:</div><div class="line"> MouseState.LeftButtonDown = <span class="keyword">true</span>;</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"></div><div class="line"> <span class="keywordflow">case</span> EMIE_LMOUSE_LEFT_UP:</div><div class="line"> MouseState.LeftButtonDown = <span class="keyword">false</span>;</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"></div><div class="line"> <span class="keywordflow">case</span> EMIE_MOUSE_MOVED:</div><div class="line"> MouseState.Position.X = <span class="keyword">event</span>.MouseInput.X;</div><div class="line"> MouseState.Position.Y = <span class="keyword">event</span>.MouseInput.Y;</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"></div><div class="line"> <span class="keywordflow">default</span>:</div><div class="line"> <span class="comment">// We won't use the wheel</span></div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="comment">// The state of each connected joystick is sent to us</span></div><div class="line"> <span class="comment">// once every run() of the Irrlicht device. Store the</span></div><div class="line"> <span class="comment">// state of the first joystick, ignoring other joysticks.</span></div><div class="line"> <span class="comment">// This is currently only supported on Windows and Linux.</span></div><div class="line"> <span class="keywordflow">if</span> (event.EventType == irr::EET_JOYSTICK_INPUT_EVENT</div><div class="line"> && event.JoystickEvent.Joystick == 0)</div><div class="line"> {</div><div class="line"> JoystickState = <span class="keyword">event</span>.JoystickEvent;</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="keyword">const</span> SEvent::SJoystickEvent & GetJoystickState(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><span class="keyword"> </span>{</div><div class="line"> <span class="keywordflow">return</span> JoystickState;</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="keyword">const</span> SMouseState & GetMouseState(<span class="keywordtype">void</span>)<span class="keyword"> const</span></div><div class="line"><span class="keyword"> </span>{</div><div class="line"> <span class="keywordflow">return</span> MouseState;</div><div class="line"> }</div><div class="line"></div><div class="line"></div><div class="line"> MyEventReceiver()</div><div class="line"> {</div><div class="line"> }</div><div class="line"></div><div class="line"><span class="keyword">private</span>:</div><div class="line"> SEvent::SJoystickEvent JoystickState;</div><div class="line">};</div></div><!-- fragment --><p> The event receiver for keeping the pressed keys is ready, the actual responses will be made inside the render loop, right before drawing the scene. So lets just create an irr::IrrlichtDevice and the scene node we want to move. We also create some other additional scene nodes, to show that there are also some different possibilities to move and animate scene nodes. </p><div class="fragment"><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line"> <span class="comment">// ask user for driver</span></div><div class="line"> video::E_DRIVER_TYPE driverType=driverChoiceConsole();</div><div class="line"> <span class="keywordflow">if</span> (driverType==video::EDT_COUNT)</div><div class="line"> <span class="keywordflow">return</span> 1;</div><div class="line"></div><div class="line"> <span class="comment">// create device</span></div><div class="line"> MyEventReceiver receiver;</div><div class="line"></div><div class="line"> IrrlichtDevice* device = createDevice(driverType,</div><div class="line"> core::dimension2d<u32>(640, 480), 16, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, &receiver);</div><div class="line"></div><div class="line"> <span class="keywordflow">if</span> (device == 0)</div><div class="line"> <span class="keywordflow">return</span> 1; <span class="comment">// could not create selected driver.</span></div><div class="line"></div><div class="line"></div><div class="line"> core::array<SJoystickInfo> joystickInfo;</div><div class="line"> <span class="keywordflow">if</span>(device->activateJoysticks(joystickInfo))</div><div class="line"> {</div><div class="line"> std::cout << <span class="stringliteral">"Joystick support is enabled and "</span> << joystickInfo.size() << <span class="stringliteral">" joystick(s) are present."</span> << std::endl;</div><div class="line"></div><div class="line"> <span class="keywordflow">for</span>(u32 joystick = 0; joystick < joystickInfo.size(); ++joystick)</div><div class="line"> {</div><div class="line"> std::cout << <span class="stringliteral">"Joystick "</span> << joystick << <span class="stringliteral">":"</span> << std::endl;</div><div class="line"> std::cout << <span class="stringliteral">"\tName: '"</span> << joystickInfo[joystick].Name.c_str() << <span class="stringliteral">"'"</span> << std::endl;</div><div class="line"> std::cout << <span class="stringliteral">"\tAxes: "</span> << joystickInfo[joystick].Axes << std::endl;</div><div class="line"> std::cout << <span class="stringliteral">"\tButtons: "</span> << joystickInfo[joystick].Buttons << std::endl;</div><div class="line"></div><div class="line"> std::cout << <span class="stringliteral">"\tHat is: "</span>;</div><div class="line"></div><div class="line"> <span class="keywordflow">switch</span>(joystickInfo[joystick].PovHat)</div><div class="line"> {</div><div class="line"> <span class="keywordflow">case</span> SJoystickInfo::POV_HAT_PRESENT:</div><div class="line"> std::cout << <span class="stringliteral">"present"</span> << std::endl;</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"></div><div class="line"> <span class="keywordflow">case</span> SJoystickInfo::POV_HAT_ABSENT:</div><div class="line"> std::cout << <span class="stringliteral">"absent"</span> << std::endl;</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"></div><div class="line"> <span class="keywordflow">case</span> SJoystickInfo::POV_HAT_UNKNOWN:</div><div class="line"> <span class="keywordflow">default</span>:</div><div class="line"> std::cout << <span class="stringliteral">"unknown"</span> << std::endl;</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div><div class="line"> }</div><div class="line"> }</div><div class="line"> <span class="keywordflow">else</span></div><div class="line"> {</div><div class="line"> std::cout << <span class="stringliteral">"Joystick support is not enabled."</span> << std::endl;</div><div class="line"> }</div><div class="line"></div><div class="line"> core::stringw tmp = L<span class="stringliteral">"Irrlicht Joystick Example ("</span>;</div><div class="line"> tmp += joystickInfo.size();</div><div class="line"> tmp += <span class="stringliteral">" joysticks)"</span>;</div><div class="line"> device->setWindowCaption(tmp.c_str());</div><div class="line"></div><div class="line"> video::IVideoDriver* driver = device->getVideoDriver();</div><div class="line"> scene::ISceneManager* smgr = device->getSceneManager();</div></div><!-- fragment --><p> We'll create an arrow mesh and move it around either with the joystick axis/hat, or make it follow the mouse pointer.</p><div class="fragment"><div class="line">scene::ISceneNode * node = smgr->addMeshSceneNode(</div><div class="line"> smgr->addArrowMesh( <span class="stringliteral">"Arrow"</span>,</div><div class="line"> video::SColor(255, 255, 0, 0),</div><div class="line"> video::SColor(255, 0, 255, 0),</div><div class="line"> 16,16,</div><div class="line"> 2.f, 1.3f,</div><div class="line"> 0.1f, 0.6f</div><div class="line"> )</div><div class="line"> );</div><div class="line">node->setMaterialFlag(video::EMF_LIGHTING, <span class="keyword">false</span>);</div><div class="line"></div><div class="line">scene::ICameraSceneNode * camera = smgr->addCameraSceneNode();</div><div class="line">camera->setPosition(core::vector3df(0, 0, -10));</div><div class="line"></div><div class="line"><span class="comment">// As in example 04, we'll use framerate independent movement.</span></div><div class="line">u32 then = device->getTimer()->getTime();</div><div class="line"><span class="keyword">const</span> f32 MOVEMENT_SPEED = 5.f;</div><div class="line"></div><div class="line"><span class="keywordflow">while</span>(device->run())</div><div class="line">{</div><div class="line"> <span class="comment">// Work out a frame delta time.</span></div><div class="line"> <span class="keyword">const</span> u32 now = device->getTimer()->getTime();</div><div class="line"> <span class="keyword">const</span> f32 frameDeltaTime = (f32)(now - then) / 1000.f; <span class="comment">// Time in seconds</span></div><div class="line"> then = now;</div><div class="line"></div><div class="line"> <span class="keywordtype">bool</span> movedWithJoystick = <span class="keyword">false</span>;</div><div class="line"> core::vector3df nodePosition = node->getPosition();</div><div class="line"></div><div class="line"> <span class="keywordflow">if</span>(joystickInfo.size() > 0)</div><div class="line"> {</div><div class="line"> f32 moveHorizontal = 0.f; <span class="comment">// Range is -1.f for full left to +1.f for full right</span></div><div class="line"> f32 moveVertical = 0.f; <span class="comment">// -1.f for full down to +1.f for full up.</span></div><div class="line"></div><div class="line"> <span class="keyword">const</span> SEvent::SJoystickEvent & joystickData = receiver.GetJoystickState();</div><div class="line"></div><div class="line"> <span class="comment">// We receive the full analog range of the axes, and so have to implement our</span></div><div class="line"> <span class="comment">// own dead zone. This is an empirical value, since some joysticks have more</span></div><div class="line"> <span class="comment">// jitter or creep around the center point than others. We'll use 5% of the</span></div><div class="line"> <span class="comment">// range as the dead zone, but generally you would want to give the user the</span></div><div class="line"> <span class="comment">// option to change this.</span></div><div class="line"> <span class="keyword">const</span> f32 DEAD_ZONE = 0.05f;</div><div class="line"></div><div class="line"> moveHorizontal =</div><div class="line"> (f32)joystickData.Axis[SEvent::SJoystickEvent::AXIS_X] / 32767.f;</div><div class="line"> <span class="keywordflow">if</span>(fabs(moveHorizontal) < DEAD_ZONE)</div><div class="line"> moveHorizontal = 0.f;</div><div class="line"></div><div class="line"> moveVertical =</div><div class="line"> (f32)joystickData.Axis[SEvent::SJoystickEvent::AXIS_Y] / -32767.f;</div><div class="line"> <span class="keywordflow">if</span>(fabs(moveVertical) < DEAD_ZONE)</div><div class="line"> moveVertical = 0.f;</div><div class="line"></div><div class="line"> <span class="comment">// POV hat info is only currently supported on Windows, but the value is</span></div><div class="line"> <span class="comment">// guaranteed to be 65535 if it's not supported, so we can check its range.</span></div><div class="line"> <span class="keyword">const</span> u16 povDegrees = joystickData.POV / 100;</div><div class="line"> <span class="keywordflow">if</span>(povDegrees < 360)</div><div class="line"> {</div><div class="line"> <span class="keywordflow">if</span>(povDegrees > 0 && povDegrees < 180)</div><div class="line"> moveHorizontal = 1.f;</div><div class="line"> <span class="keywordflow">else</span> <span class="keywordflow">if</span>(povDegrees > 180)</div><div class="line"> moveHorizontal = -1.f;</div><div class="line"></div><div class="line"> <span class="keywordflow">if</span>(povDegrees > 90 && povDegrees < 270)</div><div class="line"> moveVertical = -1.f;</div><div class="line"> <span class="keywordflow">else</span> <span class="keywordflow">if</span>(povDegrees > 270 || povDegrees < 90)</div><div class="line"> moveVertical = +1.f;</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="keywordflow">if</span>(!core::equals(moveHorizontal, 0.f) || !core::equals(moveVertical, 0.f))</div><div class="line"> {</div><div class="line"> nodePosition.X += MOVEMENT_SPEED * frameDeltaTime * moveHorizontal;</div><div class="line"> nodePosition.Y += MOVEMENT_SPEED * frameDeltaTime * moveVertical;</div><div class="line"> movedWithJoystick = <span class="keyword">true</span>;</div><div class="line"> }</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="comment">// If the arrow node isn't being moved with the joystick, then have it follow the mouse cursor.</span></div><div class="line"> <span class="keywordflow">if</span>(!movedWithJoystick)</div><div class="line"> {</div><div class="line"> <span class="comment">// Create a ray through the mouse cursor.</span></div><div class="line"> core::line3df ray = smgr->getSceneCollisionManager()->getRayFromScreenCoordinates(</div><div class="line"> receiver.GetMouseState().Position, camera);</div><div class="line"></div><div class="line"> <span class="comment">// And intersect the ray with a plane around the node facing towards the camera.</span></div><div class="line"> core::plane3df plane(nodePosition, core::vector3df(0, 0, -1));</div><div class="line"> core::vector3df mousePosition;</div><div class="line"> <span class="keywordflow">if</span>(plane.getIntersectionWithLine(ray.start, ray.getVector(), mousePosition))</div><div class="line"> {</div><div class="line"> <span class="comment">// We now have a mouse position in 3d space; move towards it.</span></div><div class="line"> core::vector3df toMousePosition(mousePosition - nodePosition);</div><div class="line"> <span class="keyword">const</span> f32 availableMovement = MOVEMENT_SPEED * frameDeltaTime;</div><div class="line"></div><div class="line"> <span class="keywordflow">if</span>(toMousePosition.getLength() <= availableMovement)</div><div class="line"> nodePosition = mousePosition; <span class="comment">// Jump to the final position</span></div><div class="line"> <span class="keywordflow">else</span></div><div class="line"> nodePosition += toMousePosition.normalize() * availableMovement; <span class="comment">// Move towards it</span></div><div class="line"> }</div><div class="line"> }</div><div class="line"></div><div class="line"> node->setPosition(nodePosition);</div><div class="line"></div><div class="line"> <span class="comment">// Turn lighting on and off depending on whether the left mouse button is down.</span></div><div class="line"> node->setMaterialFlag(video::EMF_LIGHTING, receiver.GetMouseState().LeftButtonDown);</div><div class="line"></div><div class="line"> driver->beginScene(<span class="keyword">true</span>, <span class="keyword">true</span>, video::SColor(255,113,113,133));</div><div class="line"> smgr->drawAll(); <span class="comment">// draw the 3d scene</span></div><div class="line"> driver->endScene();</div><div class="line">}</div></div><!-- fragment --><p> In the end, delete the Irrlicht device. </p><div class="fragment"><div class="line"> device->drop();</div><div class="line"></div><div class="line"> <span class="keywordflow">return</span> 0;</div><div class="line">}</div></div><!-- fragment --> </div></div><!-- contents --> +<!-- HTML footer for doxygen 1.8.13--> +<!-- start footer part --> +<p> </p> +</body> +</html> |
