aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/examples/09.Meshviewer
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/examples/09.Meshviewer')
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/9.Meshviewer.rc84
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/Makefile38
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/MeshViewer.dev59
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.cbp55
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.vcproj163
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc10.vcxproj231
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc11.vcxproj235
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc8.vcproj231
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc9.vcproj230
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/icon.icobin0 -> 2238 bytes
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/main.cpp1042
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/resource.h16
-rw-r--r--src/others/irrlicht-1.8.1/examples/09.Meshviewer/tutorial.html182
13 files changed, 2566 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/9.Meshviewer.rc b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/9.Meshviewer.rc
new file mode 100644
index 0000000..3208583
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/9.Meshviewer.rc
@@ -0,0 +1,84 @@
1// Microsoft Visual C++ generated resource script.
2//
3#include "resource.h"
4
5#define APSTUDIO_READONLY_SYMBOLS
6/////////////////////////////////////////////////////////////////////////////
7//
8// Generated from the TEXTINCLUDE 2 resource.
9//
10#include "afxres.h"
11
12/////////////////////////////////////////////////////////////////////////////
13#undef APSTUDIO_READONLY_SYMBOLS
14
15/////////////////////////////////////////////////////////////////////////////
16// English (U.S.) resources
17
18#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
19#ifdef _WIN32
20LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21#pragma code_page(1252)
22#endif //_WIN32
23
24#ifdef APSTUDIO_INVOKED
25/////////////////////////////////////////////////////////////////////////////
26//
27// TEXTINCLUDE
28//
29
301 TEXTINCLUDE
31BEGIN
32 "resource.h\0"
33END
34
352 TEXTINCLUDE
36BEGIN
37 "#include ""afxres.h""\r\n"
38 "\0"
39END
40
413 TEXTINCLUDE
42BEGIN
43 "\r\n"
44 "\0"
45END
46
47#endif // APSTUDIO_INVOKED
48
49#endif // English (U.S.) resources
50/////////////////////////////////////////////////////////////////////////////
51
52
53/////////////////////////////////////////////////////////////////////////////
54// German (Austria) resources
55
56#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEA)
57#ifdef _WIN32
58LANGUAGE LANG_GERMAN, SUBLANG_GERMAN_AUSTRIAN
59#pragma code_page(1252)
60#endif //_WIN32
61
62/////////////////////////////////////////////////////////////////////////////
63//
64// Icon
65//
66
67// Icon with lowest ID value placed first to ensure application icon
68// remains consistent on all systems.
69IDI_ICON1 ICON "icon.ico"
70#endif // German (Austria) resources
71/////////////////////////////////////////////////////////////////////////////
72
73
74
75#ifndef APSTUDIO_INVOKED
76/////////////////////////////////////////////////////////////////////////////
77//
78// Generated from the TEXTINCLUDE 3 resource.
79//
80
81
82/////////////////////////////////////////////////////////////////////////////
83#endif // not APSTUDIO_INVOKED
84
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Makefile b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Makefile
new file mode 100644
index 0000000..99fe9d0
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Makefile
@@ -0,0 +1,38 @@
1# Makefile for Irrlicht Examples
2# It's usually sufficient to change just the target name and source file list
3# and be sure that CXX is set to a valid compiler
4Target = 09.Meshviewer
5Sources = main.cpp
6
7# general compiler settings
8CPPFLAGS = -I../../include -I/usr/X11R6/include
9CXXFLAGS = -O3 -ffast-math
10#CXXFLAGS = -g -Wall
11
12#default target is Linux
13all: all_linux
14
15ifeq ($(HOSTTYPE), x86_64)
16LIBSELECT=64
17endif
18
19# target specific settings
20all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor
21all_linux clean_linux: SYSTEM=Linux
22all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
23all_win32 clean_win32: SYSTEM=Win32-gcc
24all_win32 clean_win32: SUF=.exe
25# name of the binary - only valid for targets which set SYSTEM
26DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
27
28all_linux all_win32:
29 $(warning Building...)
30 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
31
32clean: clean_linux clean_win32
33 $(warning Cleaning...)
34
35clean_linux clean_win32:
36 @$(RM) $(DESTPATH)
37
38.PHONY: all all_win32 clean clean_linux clean_win32
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/MeshViewer.dev b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/MeshViewer.dev
new file mode 100644
index 0000000..47416a1
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/MeshViewer.dev
@@ -0,0 +1,59 @@
1[Project]
2FileName=example.dev
3Name=Irrlicht Example 09 Mesh Viewer
4UnitCount=1
5Type=1
6Ver=1
7ObjFiles=
8Includes=..\..\include
9Libs=
10PrivateResource=
11ResourceIncludes=
12MakeIncludes=
13Compiler=
14CppCompiler=
15Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_
16IsCpp=1
17Icon=
18ExeOutput=../../bin/Win32-gcc
19ObjectOutput=obj
20OverrideOutput=1
21OverrideOutputName=09.MeshViewer.exe
22HostApplication=
23Folders=
24CommandLine=
25IncludeVersionInfo=0
26SupportXPThemes=0
27CompilerSet=0
28CompilerSettings=0000000000000000000000
29UseCustomMakefile=0
30CustomMakefile=
31
32[Unit1]
33FileName=main.cpp
34CompileCpp=1
35Folder=Projekt1
36Compile=1
37Link=1
38Priority=1000
39OverrideBuildCmd=0
40BuildCmd=
41
42[VersionInfo]
43Major=0
44Minor=1
45Release=1
46Build=1
47LanguageID=1033
48CharsetID=1252
49CompanyName=
50FileVersion=
51FileDescription=Irrlicht Engine example compiled using DevCpp and gcc
52InternalName=
53LegalCopyright=
54LegalTrademarks=
55OriginalFilename=
56ProductName=
57ProductVersion=
58AutoIncBuildNr=0
59
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.cbp b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.cbp
new file mode 100644
index 0000000..4600ffd
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.cbp
@@ -0,0 +1,55 @@
1<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2<CodeBlocks_project_file>
3 <FileVersion major="1" minor="6" />
4 <Project>
5 <Option title="Irrlicht Example 09 Mesh Viewer" />
6 <Option pch_mode="0" />
7 <Option compiler="gcc" />
8 <Build>
9 <Target title="Windows">
10 <Option platforms="Windows;" />
11 <Option output="..\..\bin\Win32-gcc\MeshViewer" prefix_auto="0" extension_auto="1" />
12 <Option type="1" />
13 <Option compiler="gcc" />
14 <Option projectResourceIncludeDirsRelation="1" />
15 <Compiler>
16 <Add option="-g" />
17 </Compiler>
18 <Linker>
19 <Add directory="..\..\lib\Win32-gcc" />
20 </Linker>
21 </Target>
22 <Target title="Linux">
23 <Option output="..\..\bin\Linux\MeshViewer" prefix_auto="0" extension_auto="0" />
24 <Option type="1" />
25 <Option compiler="gcc" />
26 <Compiler>
27 <Add option="-g" />
28 <Add option="-D_IRR_STATIC_LIB_" />
29 </Compiler>
30 <Linker>
31 <Add library="Xxf86vm" />
32 <Add library="Xcursor" />
33 <Add library="GL" />
34 <Add directory="..\..\lib\Linux" />
35 </Linker>
36 </Target>
37 </Build>
38 <VirtualTargets>
39 <Add alias="All" targets="Windows;Linux;" />
40 </VirtualTargets>
41 <Compiler>
42 <Add option="-g" />
43 <Add directory="..\..\include" />
44 </Compiler>
45 <Linker>
46 <Add library="Irrlicht" />
47 </Linker>
48 <Unit filename="main.cpp" />
49 <Extensions>
50 <code_completion />
51 <debugger />
52 <envvars />
53 </Extensions>
54 </Project>
55</CodeBlocks_project_file>
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.vcproj b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.vcproj
new file mode 100644
index 0000000..4077b86
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.vcproj
@@ -0,0 +1,163 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="7.10"
5 Name="09.MeshViewer"
6 ProjectGUID="{EF198BF9-7446-443D-961E-E617E1BD3AFB}"
7 SccProjectName=""
8 SccLocalPath="">
9 <Platforms>
10 <Platform
11 Name="Win32"/>
12 </Platforms>
13 <Configurations>
14 <Configuration
15 Name="Release|Win32"
16 OutputDirectory=".\Release"
17 IntermediateDirectory=".\Release"
18 ConfigurationType="1"
19 UseOfMFC="0"
20 ATLMinimizesCRunTimeLibraryUsage="FALSE"
21 CharacterSet="2">
22 <Tool
23 Name="VCCLCompilerTool"
24 Optimization="2"
25 InlineFunctionExpansion="1"
26 AdditionalIncludeDirectories="..\..\include"
27 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
28 StringPooling="TRUE"
29 RuntimeLibrary="4"
30 EnableFunctionLevelLinking="TRUE"
31 UsePrecompiledHeader="2"
32 PrecompiledHeaderFile=".\Release/Meshviewer.pch"
33 AssemblerListingLocation=".\Release/"
34 ObjectFile=".\Release/"
35 ProgramDataBaseFileName=".\Release/"
36 WarningLevel="3"
37 SuppressStartupBanner="TRUE"
38 CompileAs="0"/>
39 <Tool
40 Name="VCCustomBuildTool"/>
41 <Tool
42 Name="VCLinkerTool"
43 OutputFile="..\..\bin\Win32-VisualStudio\09.MeshViewer.exe"
44 LinkIncremental="0"
45 SuppressStartupBanner="TRUE"
46 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
47 ProgramDatabaseFile=".\Release/MeshViewer.pdb"
48 SubSystem="1"
49 TargetMachine="1"/>
50 <Tool
51 Name="VCMIDLTool"
52 TypeLibraryName=".\Release/Meshviewer.tlb"
53 HeaderFileName=""/>
54 <Tool
55 Name="VCPostBuildEventTool"/>
56 <Tool
57 Name="VCPreBuildEventTool"/>
58 <Tool
59 Name="VCPreLinkEventTool"/>
60 <Tool
61 Name="VCResourceCompilerTool"
62 PreprocessorDefinitions="NDEBUG"
63 Culture="3079"/>
64 <Tool
65 Name="VCWebServiceProxyGeneratorTool"/>
66 <Tool
67 Name="VCXMLDataGeneratorTool"/>
68 <Tool
69 Name="VCWebDeploymentTool"/>
70 <Tool
71 Name="VCManagedWrapperGeneratorTool"/>
72 <Tool
73 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
74 </Configuration>
75 <Configuration
76 Name="Debug|Win32"
77 OutputDirectory=".\Debug"
78 IntermediateDirectory=".\Debug"
79 ConfigurationType="1"
80 UseOfMFC="0"
81 ATLMinimizesCRunTimeLibraryUsage="FALSE"
82 CharacterSet="2">
83 <Tool
84 Name="VCCLCompilerTool"
85 Optimization="0"
86 AdditionalIncludeDirectories="..\..\include"
87 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
88 BasicRuntimeChecks="3"
89 RuntimeLibrary="5"
90 UsePrecompiledHeader="2"
91 PrecompiledHeaderFile=".\Debug/Meshviewer.pch"
92 AssemblerListingLocation=".\Debug/"
93 ObjectFile=".\Debug/"
94 ProgramDataBaseFileName=".\Debug/"
95 WarningLevel="3"
96 SuppressStartupBanner="TRUE"
97 DebugInformationFormat="4"
98 CompileAs="0"/>
99 <Tool
100 Name="VCCustomBuildTool"/>
101 <Tool
102 Name="VCLinkerTool"
103 OutputFile="..\..\bin\Win32-VisualStudio\09.MeshViewer.exe"
104 LinkIncremental="0"
105 SuppressStartupBanner="TRUE"
106 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
107 GenerateDebugInformation="TRUE"
108 ProgramDatabaseFile=".\Debug/MeshViewer.pdb"
109 SubSystem="1"
110 TargetMachine="1"/>
111 <Tool
112 Name="VCMIDLTool"
113 TypeLibraryName=".\Debug/Meshviewer.tlb"
114 HeaderFileName=""/>
115 <Tool
116 Name="VCPostBuildEventTool"/>
117 <Tool
118 Name="VCPreBuildEventTool"/>
119 <Tool
120 Name="VCPreLinkEventTool"/>
121 <Tool
122 Name="VCResourceCompilerTool"
123 PreprocessorDefinitions="_DEBUG"
124 Culture="3079"/>
125 <Tool
126 Name="VCWebServiceProxyGeneratorTool"/>
127 <Tool
128 Name="VCXMLDataGeneratorTool"/>
129 <Tool
130 Name="VCWebDeploymentTool"/>
131 <Tool
132 Name="VCManagedWrapperGeneratorTool"/>
133 <Tool
134 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
135 </Configuration>
136 </Configurations>
137 <References>
138 </References>
139 <Files>
140 <File
141 RelativePath="main.cpp">
142 <FileConfiguration
143 Name="Release|Win32">
144 <Tool
145 Name="VCCLCompilerTool"
146 Optimization="2"
147 AdditionalIncludeDirectories=""
148 PreprocessorDefinitions=""/>
149 </FileConfiguration>
150 <FileConfiguration
151 Name="Debug|Win32">
152 <Tool
153 Name="VCCLCompilerTool"
154 Optimization="0"
155 AdditionalIncludeDirectories=""
156 PreprocessorDefinitions=""
157 BasicRuntimeChecks="3"/>
158 </FileConfiguration>
159 </File>
160 </Files>
161 <Globals>
162 </Globals>
163</VisualStudioProject>
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc10.vcxproj b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc10.vcxproj
new file mode 100644
index 0000000..c9e9e97
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc10.vcxproj
@@ -0,0 +1,231 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|Win32">
13 <Configuration>Release</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|x64">
17 <Configuration>Release</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectName>09.Meshviewer</ProjectName>
23 <ProjectGuid>{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}</ProjectGuid>
24 <RootNamespace>Meshviewer</RootNamespace>
25 </PropertyGroup>
26 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
27 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
28 <ConfigurationType>Application</ConfigurationType>
29 <UseOfMfc>false</UseOfMfc>
30 <CharacterSet>MultiByte</CharacterSet>
31 </PropertyGroup>
32 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
33 <ConfigurationType>Application</ConfigurationType>
34 <UseOfMfc>false</UseOfMfc>
35 <CharacterSet>MultiByte</CharacterSet>
36 </PropertyGroup>
37 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
38 <ConfigurationType>Application</ConfigurationType>
39 <UseOfMfc>false</UseOfMfc>
40 <CharacterSet>MultiByte</CharacterSet>
41 </PropertyGroup>
42 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
43 <ConfigurationType>Application</ConfigurationType>
44 <UseOfMfc>false</UseOfMfc>
45 <CharacterSet>MultiByte</CharacterSet>
46 </PropertyGroup>
47 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
48 <ImportGroup Label="ExtensionSettings">
49 </ImportGroup>
50 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
51 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
52 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
53 </ImportGroup>
54 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
55 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
56 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
57 </ImportGroup>
58 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
59 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
60 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
61 </ImportGroup>
62 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
63 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
64 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
65 </ImportGroup>
66 <PropertyGroup Label="UserMacros" />
67 <PropertyGroup>
68 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
69 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
70 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
71 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
72 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
73 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
74 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
75 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
76 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
77 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
78 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
79 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
80 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
81 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
82 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
83 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
84 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
85 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
86 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
87 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
88 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
89 </PropertyGroup>
90 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
91 <Midl>
92 <TypeLibraryName>.\Release/Meshviewer.tlb</TypeLibraryName>
93 <HeaderFileName>
94 </HeaderFileName>
95 </Midl>
96 <ClCompile>
97 <Optimization>MaxSpeed</Optimization>
98 <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
99 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
100 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
101 <StringPooling>true</StringPooling>
102 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
103 <FunctionLevelLinking>true</FunctionLevelLinking>
104 <PrecompiledHeader>
105 </PrecompiledHeader>
106 <WarningLevel>Level3</WarningLevel>
107 </ClCompile>
108 <ResourceCompile>
109 <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
110 <Culture>0x0c07</Culture>
111 </ResourceCompile>
112 <Link>
113 <OutputFile>..\..\bin\Win32-VisualStudio\09.MeshViewer.exe</OutputFile>
114 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
115 <SubSystem>Console</SubSystem>
116 <DataExecutionPrevention>
117 </DataExecutionPrevention>
118 </Link>
119 </ItemDefinitionGroup>
120 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
121 <Midl>
122 <TypeLibraryName>.\Release/Meshviewer.tlb</TypeLibraryName>
123 <HeaderFileName>
124 </HeaderFileName>
125 </Midl>
126 <ClCompile>
127 <Optimization>MaxSpeed</Optimization>
128 <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
129 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
130 <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
131 <StringPooling>true</StringPooling>
132 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
133 <FunctionLevelLinking>true</FunctionLevelLinking>
134 <PrecompiledHeader>
135 </PrecompiledHeader>
136 <WarningLevel>Level3</WarningLevel>
137 </ClCompile>
138 <ResourceCompile>
139 <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
140 <Culture>0x0c07</Culture>
141 </ResourceCompile>
142 <Link>
143 <OutputFile>..\..\bin\Win64-VisualStudio\09.MeshViewer.exe</OutputFile>
144 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
145 <SubSystem>Console</SubSystem>
146 <DataExecutionPrevention>
147 </DataExecutionPrevention>
148 </Link>
149 </ItemDefinitionGroup>
150 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
151 <Midl>
152 <TypeLibraryName>.\Debug/Meshviewer.tlb</TypeLibraryName>
153 <HeaderFileName>
154 </HeaderFileName>
155 </Midl>
156 <ClCompile>
157 <Optimization>Disabled</Optimization>
158 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
159 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
160 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
161 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
162 <PrecompiledHeader>
163 </PrecompiledHeader>
164 <WarningLevel>Level3</WarningLevel>
165 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
166 </ClCompile>
167 <ResourceCompile>
168 <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
169 <Culture>0x0c07</Culture>
170 </ResourceCompile>
171 <Link>
172 <OutputFile>..\..\bin\Win32-VisualStudio\09.MeshViewer.exe</OutputFile>
173 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
174 <GenerateDebugInformation>true</GenerateDebugInformation>
175 <SubSystem>Console</SubSystem>
176 <DataExecutionPrevention>
177 </DataExecutionPrevention>
178 </Link>
179 </ItemDefinitionGroup>
180 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
181 <Midl>
182 <TypeLibraryName>.\Debug/Meshviewer.tlb</TypeLibraryName>
183 <HeaderFileName>
184 </HeaderFileName>
185 </Midl>
186 <ClCompile>
187 <Optimization>Disabled</Optimization>
188 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
189 <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
190 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
191 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
192 <PrecompiledHeader>
193 </PrecompiledHeader>
194 <WarningLevel>Level3</WarningLevel>
195 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
196 </ClCompile>
197 <ResourceCompile>
198 <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
199 <Culture>0x0c07</Culture>
200 </ResourceCompile>
201 <Link>
202 <OutputFile>..\..\bin\Win64-VisualStudio\09.MeshViewer.exe</OutputFile>
203 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
204 <GenerateDebugInformation>true</GenerateDebugInformation>
205 <SubSystem>Console</SubSystem>
206 <DataExecutionPrevention>
207 </DataExecutionPrevention>
208 </Link>
209 </ItemDefinitionGroup>
210 <ItemGroup>
211 <ClCompile Include="main.cpp">
212 <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
213 <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
214 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
215 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
216 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
217 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
218 <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
219 <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
220 <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
221 <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
222 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
223 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
224 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
225 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
226 </ClCompile>
227 </ItemGroup>
228 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
229 <ImportGroup Label="ExtensionTargets">
230 </ImportGroup>
231</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc11.vcxproj b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc11.vcxproj
new file mode 100644
index 0000000..24ffe1e
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc11.vcxproj
@@ -0,0 +1,235 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|Win32">
13 <Configuration>Release</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|x64">
17 <Configuration>Release</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectName>09.Meshviewer</ProjectName>
23 <ProjectGuid>{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}</ProjectGuid>
24 <RootNamespace>Meshviewer</RootNamespace>
25 </PropertyGroup>
26 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
27 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
28 <ConfigurationType>Application</ConfigurationType>
29 <UseOfMfc>false</UseOfMfc>
30 <CharacterSet>MultiByte</CharacterSet>
31 <PlatformToolset>v110</PlatformToolset>
32 </PropertyGroup>
33 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
34 <ConfigurationType>Application</ConfigurationType>
35 <UseOfMfc>false</UseOfMfc>
36 <CharacterSet>MultiByte</CharacterSet>
37 <PlatformToolset>v110</PlatformToolset>
38 </PropertyGroup>
39 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
40 <ConfigurationType>Application</ConfigurationType>
41 <UseOfMfc>false</UseOfMfc>
42 <CharacterSet>MultiByte</CharacterSet>
43 <PlatformToolset>v110</PlatformToolset>
44 </PropertyGroup>
45 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
46 <ConfigurationType>Application</ConfigurationType>
47 <UseOfMfc>false</UseOfMfc>
48 <CharacterSet>MultiByte</CharacterSet>
49 <PlatformToolset>v110</PlatformToolset>
50 </PropertyGroup>
51 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
52 <ImportGroup Label="ExtensionSettings">
53 </ImportGroup>
54 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
55 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
56 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
57 </ImportGroup>
58 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
59 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
60 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
61 </ImportGroup>
62 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
63 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
64 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
65 </ImportGroup>
66 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
67 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
69 </ImportGroup>
70 <PropertyGroup Label="UserMacros" />
71 <PropertyGroup>
72 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
73 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
74 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
75 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
76 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
77 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
78 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
79 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
80 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
81 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
82 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
83 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
84 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
85 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
86 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
87 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
88 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
89 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
90 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
91 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
92 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
93 </PropertyGroup>
94 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
95 <Midl>
96 <TypeLibraryName>.\Release/Meshviewer.tlb</TypeLibraryName>
97 <HeaderFileName>
98 </HeaderFileName>
99 </Midl>
100 <ClCompile>
101 <Optimization>MaxSpeed</Optimization>
102 <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
103 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
104 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
105 <StringPooling>true</StringPooling>
106 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
107 <FunctionLevelLinking>true</FunctionLevelLinking>
108 <PrecompiledHeader>
109 </PrecompiledHeader>
110 <WarningLevel>Level3</WarningLevel>
111 </ClCompile>
112 <ResourceCompile>
113 <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
114 <Culture>0x0c07</Culture>
115 </ResourceCompile>
116 <Link>
117 <OutputFile>..\..\bin\Win32-VisualStudio\09.MeshViewer.exe</OutputFile>
118 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
119 <SubSystem>Console</SubSystem>
120 <DataExecutionPrevention>
121 </DataExecutionPrevention>
122 </Link>
123 </ItemDefinitionGroup>
124 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
125 <Midl>
126 <TypeLibraryName>.\Release/Meshviewer.tlb</TypeLibraryName>
127 <HeaderFileName>
128 </HeaderFileName>
129 </Midl>
130 <ClCompile>
131 <Optimization>MaxSpeed</Optimization>
132 <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
133 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
134 <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
135 <StringPooling>true</StringPooling>
136 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
137 <FunctionLevelLinking>true</FunctionLevelLinking>
138 <PrecompiledHeader>
139 </PrecompiledHeader>
140 <WarningLevel>Level3</WarningLevel>
141 </ClCompile>
142 <ResourceCompile>
143 <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
144 <Culture>0x0c07</Culture>
145 </ResourceCompile>
146 <Link>
147 <OutputFile>..\..\bin\Win64-VisualStudio\09.MeshViewer.exe</OutputFile>
148 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
149 <SubSystem>Console</SubSystem>
150 <DataExecutionPrevention>
151 </DataExecutionPrevention>
152 </Link>
153 </ItemDefinitionGroup>
154 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
155 <Midl>
156 <TypeLibraryName>.\Debug/Meshviewer.tlb</TypeLibraryName>
157 <HeaderFileName>
158 </HeaderFileName>
159 </Midl>
160 <ClCompile>
161 <Optimization>Disabled</Optimization>
162 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
163 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
164 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
165 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
166 <PrecompiledHeader>
167 </PrecompiledHeader>
168 <WarningLevel>Level3</WarningLevel>
169 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
170 </ClCompile>
171 <ResourceCompile>
172 <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
173 <Culture>0x0c07</Culture>
174 </ResourceCompile>
175 <Link>
176 <OutputFile>..\..\bin\Win32-VisualStudio\09.MeshViewer.exe</OutputFile>
177 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
178 <GenerateDebugInformation>true</GenerateDebugInformation>
179 <SubSystem>Console</SubSystem>
180 <DataExecutionPrevention>
181 </DataExecutionPrevention>
182 </Link>
183 </ItemDefinitionGroup>
184 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
185 <Midl>
186 <TypeLibraryName>.\Debug/Meshviewer.tlb</TypeLibraryName>
187 <HeaderFileName>
188 </HeaderFileName>
189 </Midl>
190 <ClCompile>
191 <Optimization>Disabled</Optimization>
192 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
193 <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
194 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
195 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
196 <PrecompiledHeader>
197 </PrecompiledHeader>
198 <WarningLevel>Level3</WarningLevel>
199 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
200 </ClCompile>
201 <ResourceCompile>
202 <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
203 <Culture>0x0c07</Culture>
204 </ResourceCompile>
205 <Link>
206 <OutputFile>..\..\bin\Win64-VisualStudio\09.MeshViewer.exe</OutputFile>
207 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
208 <GenerateDebugInformation>true</GenerateDebugInformation>
209 <SubSystem>Console</SubSystem>
210 <DataExecutionPrevention>
211 </DataExecutionPrevention>
212 </Link>
213 </ItemDefinitionGroup>
214 <ItemGroup>
215 <ClCompile Include="main.cpp">
216 <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
217 <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
218 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
219 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
220 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
221 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
222 <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
223 <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
224 <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
225 <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
226 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
227 <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
228 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
229 <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
230 </ClCompile>
231 </ItemGroup>
232 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
233 <ImportGroup Label="ExtensionTargets">
234 </ImportGroup>
235</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc8.vcproj b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc8.vcproj
new file mode 100644
index 0000000..0346771
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc8.vcproj
@@ -0,0 +1,231 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="09.Meshviewer_vc8"
6 ProjectGUID="{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}"
7 RootNamespace="Meshviewer_vc8"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Release|Win32"
19 OutputDirectory=".\Release"
20 IntermediateDirectory=".\Release"
21 ConfigurationType="1"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 UseOfMFC="0"
24 ATLMinimizesCRunTimeLibraryUsage="false"
25 CharacterSet="2"
26 >
27 <Tool
28 Name="VCPreBuildEventTool"
29 />
30 <Tool
31 Name="VCCustomBuildTool"
32 />
33 <Tool
34 Name="VCXMLDataGeneratorTool"
35 />
36 <Tool
37 Name="VCWebServiceProxyGeneratorTool"
38 />
39 <Tool
40 Name="VCMIDLTool"
41 TypeLibraryName=".\Release/Meshviewer.tlb"
42 HeaderFileName=""
43 />
44 <Tool
45 Name="VCCLCompilerTool"
46 Optimization="2"
47 InlineFunctionExpansion="1"
48 AdditionalIncludeDirectories="..\..\include"
49 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
50 StringPooling="true"
51 RuntimeLibrary="0"
52 EnableFunctionLevelLinking="true"
53 UsePrecompiledHeader="0"
54 PrecompiledHeaderFile=".\Release/Meshviewer.pch"
55 AssemblerListingLocation=".\Release/"
56 ObjectFile=".\Release/"
57 ProgramDataBaseFileName=".\Release/"
58 WarningLevel="3"
59 SuppressStartupBanner="true"
60 CompileAs="0"
61 />
62 <Tool
63 Name="VCManagedResourceCompilerTool"
64 />
65 <Tool
66 Name="VCResourceCompilerTool"
67 PreprocessorDefinitions="NDEBUG"
68 Culture="3079"
69 />
70 <Tool
71 Name="VCPreLinkEventTool"
72 />
73 <Tool
74 Name="VCLinkerTool"
75 OutputFile="..\..\bin\Win32-VisualStudio\09.MeshViewer.exe"
76 LinkIncremental="0"
77 SuppressStartupBanner="true"
78 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
79 ProgramDatabaseFile=".\Release/MeshViewer.pdb"
80 SubSystem="1"
81 TargetMachine="1"
82 />
83 <Tool
84 Name="VCALinkTool"
85 />
86 <Tool
87 Name="VCManifestTool"
88 />
89 <Tool
90 Name="VCXDCMakeTool"
91 />
92 <Tool
93 Name="VCBscMakeTool"
94 />
95 <Tool
96 Name="VCFxCopTool"
97 />
98 <Tool
99 Name="VCAppVerifierTool"
100 />
101 <Tool
102 Name="VCWebDeploymentTool"
103 />
104 <Tool
105 Name="VCPostBuildEventTool"
106 />
107 </Configuration>
108 <Configuration
109 Name="Debug|Win32"
110 OutputDirectory=".\Debug"
111 IntermediateDirectory=".\Debug"
112 ConfigurationType="1"
113 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
114 UseOfMFC="0"
115 ATLMinimizesCRunTimeLibraryUsage="false"
116 CharacterSet="2"
117 >
118 <Tool
119 Name="VCPreBuildEventTool"
120 />
121 <Tool
122 Name="VCCustomBuildTool"
123 />
124 <Tool
125 Name="VCXMLDataGeneratorTool"
126 />
127 <Tool
128 Name="VCWebServiceProxyGeneratorTool"
129 />
130 <Tool
131 Name="VCMIDLTool"
132 TypeLibraryName=".\Debug/Meshviewer.tlb"
133 HeaderFileName=""
134 />
135 <Tool
136 Name="VCCLCompilerTool"
137 Optimization="0"
138 AdditionalIncludeDirectories="..\..\include"
139 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
140 BasicRuntimeChecks="3"
141 RuntimeLibrary="1"
142 UsePrecompiledHeader="0"
143 PrecompiledHeaderFile=".\Debug/Meshviewer.pch"
144 AssemblerListingLocation=".\Debug/"
145 ObjectFile=".\Debug/"
146 ProgramDataBaseFileName=".\Debug/"
147 WarningLevel="3"
148 SuppressStartupBanner="true"
149 DebugInformationFormat="4"
150 CompileAs="0"
151 />
152 <Tool
153 Name="VCManagedResourceCompilerTool"
154 />
155 <Tool
156 Name="VCResourceCompilerTool"
157 PreprocessorDefinitions="_DEBUG"
158 Culture="3079"
159 />
160 <Tool
161 Name="VCPreLinkEventTool"
162 />
163 <Tool
164 Name="VCLinkerTool"
165 OutputFile="..\..\bin\Win32-VisualStudio\09.MeshViewer.exe"
166 LinkIncremental="0"
167 SuppressStartupBanner="true"
168 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
169 GenerateDebugInformation="true"
170 ProgramDatabaseFile=".\Debug/MeshViewer.pdb"
171 SubSystem="1"
172 TargetMachine="1"
173 />
174 <Tool
175 Name="VCALinkTool"
176 />
177 <Tool
178 Name="VCManifestTool"
179 />
180 <Tool
181 Name="VCXDCMakeTool"
182 />
183 <Tool
184 Name="VCBscMakeTool"
185 />
186 <Tool
187 Name="VCFxCopTool"
188 />
189 <Tool
190 Name="VCAppVerifierTool"
191 />
192 <Tool
193 Name="VCWebDeploymentTool"
194 />
195 <Tool
196 Name="VCPostBuildEventTool"
197 />
198 </Configuration>
199 </Configurations>
200 <References>
201 </References>
202 <Files>
203 <File
204 RelativePath="main.cpp"
205 >
206 <FileConfiguration
207 Name="Release|Win32"
208 >
209 <Tool
210 Name="VCCLCompilerTool"
211 Optimization="2"
212 AdditionalIncludeDirectories=""
213 PreprocessorDefinitions=""
214 />
215 </FileConfiguration>
216 <FileConfiguration
217 Name="Debug|Win32"
218 >
219 <Tool
220 Name="VCCLCompilerTool"
221 Optimization="0"
222 AdditionalIncludeDirectories=""
223 PreprocessorDefinitions=""
224 BasicRuntimeChecks="3"
225 />
226 </FileConfiguration>
227 </File>
228 </Files>
229 <Globals>
230 </Globals>
231</VisualStudioProject>
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc9.vcproj b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc9.vcproj
new file mode 100644
index 0000000..f6a8038
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc9.vcproj
@@ -0,0 +1,230 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="9,00"
5 Name="09.Meshviewer_vc9"
6 ProjectGUID="{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}"
7 RootNamespace="Meshviewer_vc9"
8 TargetFrameworkVersion="131072"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Release|Win32"
20 OutputDirectory=".\Release"
21 IntermediateDirectory=".\Release"
22 ConfigurationType="1"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 UseOfMFC="0"
25 ATLMinimizesCRunTimeLibraryUsage="false"
26 CharacterSet="2"
27 >
28 <Tool
29 Name="VCPreBuildEventTool"
30 />
31 <Tool
32 Name="VCCustomBuildTool"
33 />
34 <Tool
35 Name="VCXMLDataGeneratorTool"
36 />
37 <Tool
38 Name="VCWebServiceProxyGeneratorTool"
39 />
40 <Tool
41 Name="VCMIDLTool"
42 TypeLibraryName=".\Release/Meshviewer.tlb"
43 HeaderFileName=""
44 />
45 <Tool
46 Name="VCCLCompilerTool"
47 Optimization="2"
48 InlineFunctionExpansion="1"
49 AdditionalIncludeDirectories="..\..\include"
50 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
51 StringPooling="true"
52 RuntimeLibrary="0"
53 EnableFunctionLevelLinking="true"
54 UsePrecompiledHeader="0"
55 PrecompiledHeaderFile=".\Release/Meshviewer.pch"
56 AssemblerListingLocation=".\Release/"
57 ObjectFile=".\Release/"
58 ProgramDataBaseFileName=".\Release/"
59 WarningLevel="3"
60 SuppressStartupBanner="true"
61 CompileAs="0"
62 />
63 <Tool
64 Name="VCManagedResourceCompilerTool"
65 />
66 <Tool
67 Name="VCResourceCompilerTool"
68 PreprocessorDefinitions="NDEBUG"
69 Culture="3079"
70 />
71 <Tool
72 Name="VCPreLinkEventTool"
73 />
74 <Tool
75 Name="VCLinkerTool"
76 OutputFile="..\..\bin\Win32-VisualStudio\09.MeshViewer.exe"
77 LinkIncremental="0"
78 SuppressStartupBanner="true"
79 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
80 ProgramDatabaseFile=".\Release/MeshViewer.pdb"
81 SubSystem="1"
82 RandomizedBaseAddress="1"
83 DataExecutionPrevention="0"
84 TargetMachine="1"
85 />
86 <Tool
87 Name="VCALinkTool"
88 />
89 <Tool
90 Name="VCManifestTool"
91 />
92 <Tool
93 Name="VCXDCMakeTool"
94 />
95 <Tool
96 Name="VCBscMakeTool"
97 />
98 <Tool
99 Name="VCFxCopTool"
100 />
101 <Tool
102 Name="VCAppVerifierTool"
103 />
104 <Tool
105 Name="VCPostBuildEventTool"
106 />
107 </Configuration>
108 <Configuration
109 Name="Debug|Win32"
110 OutputDirectory=".\Debug"
111 IntermediateDirectory=".\Debug"
112 ConfigurationType="1"
113 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
114 UseOfMFC="0"
115 ATLMinimizesCRunTimeLibraryUsage="false"
116 CharacterSet="2"
117 >
118 <Tool
119 Name="VCPreBuildEventTool"
120 />
121 <Tool
122 Name="VCCustomBuildTool"
123 />
124 <Tool
125 Name="VCXMLDataGeneratorTool"
126 />
127 <Tool
128 Name="VCWebServiceProxyGeneratorTool"
129 />
130 <Tool
131 Name="VCMIDLTool"
132 TypeLibraryName=".\Debug/Meshviewer.tlb"
133 HeaderFileName=""
134 />
135 <Tool
136 Name="VCCLCompilerTool"
137 Optimization="0"
138 AdditionalIncludeDirectories="..\..\include"
139 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
140 BasicRuntimeChecks="3"
141 RuntimeLibrary="1"
142 UsePrecompiledHeader="0"
143 PrecompiledHeaderFile=".\Debug/Meshviewer.pch"
144 AssemblerListingLocation=".\Debug/"
145 ObjectFile=".\Debug/"
146 ProgramDataBaseFileName=".\Debug/"
147 WarningLevel="3"
148 SuppressStartupBanner="true"
149 DebugInformationFormat="4"
150 CompileAs="0"
151 />
152 <Tool
153 Name="VCManagedResourceCompilerTool"
154 />
155 <Tool
156 Name="VCResourceCompilerTool"
157 PreprocessorDefinitions="_DEBUG"
158 Culture="3079"
159 />
160 <Tool
161 Name="VCPreLinkEventTool"
162 />
163 <Tool
164 Name="VCLinkerTool"
165 OutputFile="..\..\bin\Win32-VisualStudio\09.MeshViewer.exe"
166 LinkIncremental="0"
167 SuppressStartupBanner="true"
168 AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
169 GenerateDebugInformation="true"
170 ProgramDatabaseFile=".\Debug/MeshViewer.pdb"
171 SubSystem="1"
172 RandomizedBaseAddress="1"
173 DataExecutionPrevention="0"
174 TargetMachine="1"
175 />
176 <Tool
177 Name="VCALinkTool"
178 />
179 <Tool
180 Name="VCManifestTool"
181 />
182 <Tool
183 Name="VCXDCMakeTool"
184 />
185 <Tool
186 Name="VCBscMakeTool"
187 />
188 <Tool
189 Name="VCFxCopTool"
190 />
191 <Tool
192 Name="VCAppVerifierTool"
193 />
194 <Tool
195 Name="VCPostBuildEventTool"
196 />
197 </Configuration>
198 </Configurations>
199 <References>
200 </References>
201 <Files>
202 <File
203 RelativePath="main.cpp"
204 >
205 <FileConfiguration
206 Name="Release|Win32"
207 >
208 <Tool
209 Name="VCCLCompilerTool"
210 Optimization="2"
211 AdditionalIncludeDirectories=""
212 PreprocessorDefinitions=""
213 />
214 </FileConfiguration>
215 <FileConfiguration
216 Name="Debug|Win32"
217 >
218 <Tool
219 Name="VCCLCompilerTool"
220 Optimization="0"
221 AdditionalIncludeDirectories=""
222 PreprocessorDefinitions=""
223 BasicRuntimeChecks="3"
224 />
225 </FileConfiguration>
226 </File>
227 </Files>
228 <Globals>
229 </Globals>
230</VisualStudioProject>
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/icon.ico b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/icon.ico
new file mode 100644
index 0000000..49f8eab
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/icon.ico
Binary files differ
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/main.cpp b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/main.cpp
new file mode 100644
index 0000000..b9dc550
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/main.cpp
@@ -0,0 +1,1042 @@
1/** Example 009 Mesh Viewer
2
3This tutorial show how to create a more complex application with the engine.
4We construct a simple mesh viewer using the user interface API and the
5scene management of Irrlicht. The tutorial show how to create and use Buttons,
6Windows, Toolbars, Menus, ComboBoxes, Tabcontrols, Editboxes, Images,
7MessageBoxes, SkyBoxes, and how to parse XML files with the integrated XML
8reader of the engine.
9
10We start like in most other tutorials: Include all necessary header files, add
11a comment to let the engine be linked with the right .lib file in Visual
12Studio, and declare some global variables. We also add two 'using namespace'
13statements, so we do not need to write the whole names of all classes. In this
14tutorial, we use a lot stuff from the gui namespace.
15*/
16#include <irrlicht.h>
17#include "driverChoice.h"
18
19using namespace irr;
20using namespace gui;
21
22#ifdef _MSC_VER
23#pragma comment(lib, "Irrlicht.lib")
24#endif
25
26
27/*
28Some global variables used later on
29*/
30IrrlichtDevice *Device = 0;
31core::stringc StartUpModelFile;
32core::stringw MessageText;
33core::stringw Caption;
34scene::ISceneNode* Model = 0;
35scene::ISceneNode* SkyBox = 0;
36bool Octree=false;
37bool UseLight=false;
38
39scene::ICameraSceneNode* Camera[2] = {0, 0};
40
41// Values used to identify individual GUI elements
42enum
43{
44 GUI_ID_DIALOG_ROOT_WINDOW = 0x10000,
45
46 GUI_ID_X_SCALE,
47 GUI_ID_Y_SCALE,
48 GUI_ID_Z_SCALE,
49
50 GUI_ID_OPEN_MODEL,
51 GUI_ID_SET_MODEL_ARCHIVE,
52 GUI_ID_LOAD_AS_OCTREE,
53
54 GUI_ID_SKY_BOX_VISIBLE,
55 GUI_ID_TOGGLE_DEBUG_INFO,
56
57 GUI_ID_DEBUG_OFF,
58 GUI_ID_DEBUG_BOUNDING_BOX,
59 GUI_ID_DEBUG_NORMALS,
60 GUI_ID_DEBUG_SKELETON,
61 GUI_ID_DEBUG_WIRE_OVERLAY,
62 GUI_ID_DEBUG_HALF_TRANSPARENT,
63 GUI_ID_DEBUG_BUFFERS_BOUNDING_BOXES,
64 GUI_ID_DEBUG_ALL,
65
66 GUI_ID_MODEL_MATERIAL_SOLID,
67 GUI_ID_MODEL_MATERIAL_TRANSPARENT,
68 GUI_ID_MODEL_MATERIAL_REFLECTION,
69
70 GUI_ID_CAMERA_MAYA,
71 GUI_ID_CAMERA_FIRST_PERSON,
72
73 GUI_ID_POSITION_TEXT,
74
75 GUI_ID_ABOUT,
76 GUI_ID_QUIT,
77
78 GUI_ID_TEXTUREFILTER,
79 GUI_ID_SKIN_TRANSPARENCY,
80 GUI_ID_SKIN_ANIMATION_FPS,
81
82 GUI_ID_BUTTON_SET_SCALE,
83 GUI_ID_BUTTON_SCALE_MUL10,
84 GUI_ID_BUTTON_SCALE_DIV10,
85 GUI_ID_BUTTON_OPEN_MODEL,
86 GUI_ID_BUTTON_SHOW_ABOUT,
87 GUI_ID_BUTTON_SHOW_TOOLBOX,
88 GUI_ID_BUTTON_SELECT_ARCHIVE,
89
90 GUI_ID_ANIMATION_INFO,
91
92 // And some magic numbers
93 MAX_FRAMERATE = 80,
94 DEFAULT_FRAMERATE = 30
95};
96
97
98/*
99Toggle between various cameras
100*/
101void setActiveCamera(scene::ICameraSceneNode* newActive)
102{
103 if (0 == Device)
104 return;
105
106 scene::ICameraSceneNode * active = Device->getSceneManager()->getActiveCamera();
107 active->setInputReceiverEnabled(false);
108
109 newActive->setInputReceiverEnabled(true);
110 Device->getSceneManager()->setActiveCamera(newActive);
111}
112
113/*
114 Set the skin transparency by changing the alpha values of all skin-colors
115*/
116void setSkinTransparency(s32 alpha, irr::gui::IGUISkin * skin)
117{
118 for (s32 i=0; i<irr::gui::EGDC_COUNT ; ++i)
119 {
120 video::SColor col = skin->getColor((EGUI_DEFAULT_COLOR)i);
121 col.setAlpha(alpha);
122 skin->setColor((EGUI_DEFAULT_COLOR)i, col);
123 }
124}
125
126/*
127 Update the display of the model scaling
128*/
129void updateScaleInfo(scene::ISceneNode* model)
130{
131 IGUIElement* toolboxWnd = Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(GUI_ID_DIALOG_ROOT_WINDOW, true);
132 if (!toolboxWnd)
133 return;
134 if (!model)
135 {
136 toolboxWnd->getElementFromId(GUI_ID_X_SCALE, true)->setText( L"-" );
137 toolboxWnd->getElementFromId(GUI_ID_Y_SCALE, true)->setText( L"-" );
138 toolboxWnd->getElementFromId(GUI_ID_Z_SCALE, true)->setText( L"-" );
139 }
140 else
141 {
142 core::vector3df scale = model->getScale();
143 toolboxWnd->getElementFromId(GUI_ID_X_SCALE, true)->setText( core::stringw(scale.X).c_str() );
144 toolboxWnd->getElementFromId(GUI_ID_Y_SCALE, true)->setText( core::stringw(scale.Y).c_str() );
145 toolboxWnd->getElementFromId(GUI_ID_Z_SCALE, true)->setText( core::stringw(scale.Z).c_str() );
146 }
147}
148
149/*
150Function showAboutText() displays a messagebox with a caption and
151a message text. The texts will be stored in the MessageText and Caption
152variables at startup.
153*/
154void showAboutText()
155{
156 // create modal message box with the text
157 // loaded from the xml file.
158 Device->getGUIEnvironment()->addMessageBox(
159 Caption.c_str(), MessageText.c_str());
160}
161
162
163/*
164Function loadModel() loads a model and displays it using an
165addAnimatedMeshSceneNode and the scene manager. Nothing difficult. It also
166displays a short message box, if the model could not be loaded.
167*/
168void loadModel(const c8* fn)
169{
170 // modify the name if it a .pk3 file
171
172 io::path filename(fn);
173
174 io::path extension;
175 core::getFileNameExtension(extension, filename);
176 extension.make_lower();
177
178 // if a texture is loaded apply it to the current model..
179 if (extension == ".jpg" || extension == ".pcx" ||
180 extension == ".png" || extension == ".ppm" ||
181 extension == ".pgm" || extension == ".pbm" ||
182 extension == ".psd" || extension == ".tga" ||
183 extension == ".bmp" || extension == ".wal" ||
184 extension == ".rgb" || extension == ".rgba")
185 {
186 video::ITexture * texture =
187 Device->getVideoDriver()->getTexture( filename );
188 if ( texture && Model )
189 {
190 // always reload texture
191 Device->getVideoDriver()->removeTexture(texture);
192 texture = Device->getVideoDriver()->getTexture( filename );
193
194 Model->setMaterialTexture(0, texture);
195 }
196 return;
197 }
198 // if a archive is loaded add it to the FileArchive..
199 else if (extension == ".pk3" || extension == ".zip" || extension == ".pak" || extension == ".npk")
200 {
201 Device->getFileSystem()->addFileArchive(filename.c_str());
202 return;
203 }
204
205 // load a model into the engine
206
207 if (Model)
208 Model->remove();
209
210 Model = 0;
211
212 if (extension==".irr")
213 {
214 core::array<scene::ISceneNode*> outNodes;
215 Device->getSceneManager()->loadScene(filename);
216 Device->getSceneManager()->getSceneNodesFromType(scene::ESNT_ANIMATED_MESH, outNodes);
217 if (outNodes.size())
218 Model = outNodes[0];
219 return;
220 }
221
222 scene::IAnimatedMesh* m = Device->getSceneManager()->getMesh( filename.c_str() );
223
224 if (!m)
225 {
226 // model could not be loaded
227
228 if (StartUpModelFile != filename)
229 Device->getGUIEnvironment()->addMessageBox(
230 Caption.c_str(), L"The model could not be loaded. " \
231 L"Maybe it is not a supported file format.");
232 return;
233 }
234
235 // set default material properties
236
237 if (Octree)
238 Model = Device->getSceneManager()->addOctreeSceneNode(m->getMesh(0));
239 else
240 {
241 scene::IAnimatedMeshSceneNode* animModel = Device->getSceneManager()->addAnimatedMeshSceneNode(m);
242 animModel->setAnimationSpeed(30);
243 Model = animModel;
244 }
245 Model->setMaterialFlag(video::EMF_LIGHTING, UseLight);
246 Model->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, UseLight);
247// Model->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false);
248 Model->setDebugDataVisible(scene::EDS_OFF);
249
250 // we need to uncheck the menu entries. would be cool to fake a menu event, but
251 // that's not so simple. so we do it brute force
252 gui::IGUIContextMenu* menu = (gui::IGUIContextMenu*)Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(GUI_ID_TOGGLE_DEBUG_INFO, true);
253 if (menu)
254 for(int item = 1; item < 6; ++item)
255 menu->setItemChecked(item, false);
256 updateScaleInfo(Model);
257}
258
259
260/*
261Function createToolBox() creates a toolbox window. In this simple mesh
262viewer, this toolbox only contains a tab control with three edit boxes for
263changing the scale of the displayed model.
264*/
265void createToolBox()
266{
267 // remove tool box if already there
268 IGUIEnvironment* env = Device->getGUIEnvironment();
269 IGUIElement* root = env->getRootGUIElement();
270 IGUIElement* e = root->getElementFromId(GUI_ID_DIALOG_ROOT_WINDOW, true);
271 if (e)
272 e->remove();
273
274 // create the toolbox window
275 IGUIWindow* wnd = env->addWindow(core::rect<s32>(600,45,800,480),
276 false, L"Toolset", 0, GUI_ID_DIALOG_ROOT_WINDOW);
277
278 // create tab control and tabs
279 IGUITabControl* tab = env->addTabControl(
280 core::rect<s32>(2,20,800-602,480-7), wnd, true, true);
281
282 IGUITab* t1 = tab->addTab(L"Config");
283
284 // add some edit boxes and a button to tab one
285 env->addStaticText(L"Scale:",
286 core::rect<s32>(10,20,60,45), false, false, t1);
287 env->addStaticText(L"X:", core::rect<s32>(22,48,40,66), false, false, t1);
288 env->addEditBox(L"1.0", core::rect<s32>(40,46,130,66), true, t1, GUI_ID_X_SCALE);
289 env->addStaticText(L"Y:", core::rect<s32>(22,82,40,96), false, false, t1);
290 env->addEditBox(L"1.0", core::rect<s32>(40,76,130,96), true, t1, GUI_ID_Y_SCALE);
291 env->addStaticText(L"Z:", core::rect<s32>(22,108,40,126), false, false, t1);
292 env->addEditBox(L"1.0", core::rect<s32>(40,106,130,126), true, t1, GUI_ID_Z_SCALE);
293
294 env->addButton(core::rect<s32>(10,134,85,165), t1, GUI_ID_BUTTON_SET_SCALE, L"Set");
295
296 // quick scale buttons
297 env->addButton(core::rect<s32>(65,20,95,40), t1, GUI_ID_BUTTON_SCALE_MUL10, L"* 10");
298 env->addButton(core::rect<s32>(100,20,130,40), t1, GUI_ID_BUTTON_SCALE_DIV10, L"* 0.1");
299
300 updateScaleInfo(Model);
301
302 // add transparency control
303 env->addStaticText(L"GUI Transparency Control:",
304 core::rect<s32>(10,200,150,225), true, false, t1);
305 IGUIScrollBar* scrollbar = env->addScrollBar(true,
306 core::rect<s32>(10,225,150,240), t1, GUI_ID_SKIN_TRANSPARENCY);
307 scrollbar->setMax(255);
308 scrollbar->setPos(255);
309
310 // add framerate control
311 env->addStaticText(L":", core::rect<s32>(10,240,150,265), true, false, t1);
312 env->addStaticText(L"Framerate:",
313 core::rect<s32>(12,240,75,265), false, false, t1);
314 // current frame info
315 env->addStaticText(L"", core::rect<s32>(75,240,200,265), false, false, t1,
316 GUI_ID_ANIMATION_INFO);
317 scrollbar = env->addScrollBar(true,
318 core::rect<s32>(10,265,150,280), t1, GUI_ID_SKIN_ANIMATION_FPS);
319 scrollbar->setMax(MAX_FRAMERATE);
320 scrollbar->setMin(-MAX_FRAMERATE);
321 scrollbar->setPos(DEFAULT_FRAMERATE);
322 scrollbar->setSmallStep(1);
323}
324
325/*
326Function updateToolBox() is called each frame to update dynamic information in
327the toolbox.
328*/
329void updateToolBox()
330{
331 IGUIEnvironment* env = Device->getGUIEnvironment();
332 IGUIElement* root = env->getRootGUIElement();
333 IGUIElement* dlg = root->getElementFromId(GUI_ID_DIALOG_ROOT_WINDOW, true);
334 if (!dlg )
335 return;
336
337 // update the info we have about the animation of the model
338 IGUIStaticText * aniInfo = (IGUIStaticText *)(dlg->getElementFromId(GUI_ID_ANIMATION_INFO, true));
339 if (aniInfo)
340 {
341 if ( Model && scene::ESNT_ANIMATED_MESH == Model->getType() )
342 {
343 scene::IAnimatedMeshSceneNode* animatedModel = (scene::IAnimatedMeshSceneNode*)Model;
344
345 core::stringw str( (s32)core::round_(animatedModel->getAnimationSpeed()) );
346 str += L" Frame: ";
347 str += core::stringw((s32)animatedModel->getFrameNr());
348 aniInfo->setText(str.c_str());
349 }
350 else
351 aniInfo->setText(L"");
352 }
353}
354
355void onKillFocus()
356{
357 // Avoid that the FPS-camera continues moving when the user presses alt-tab while
358 // moving the camera.
359 const core::list<scene::ISceneNodeAnimator*>& animators = Camera[1]->getAnimators();
360 core::list<irr::scene::ISceneNodeAnimator*>::ConstIterator iter = animators.begin();
361 while ( iter != animators.end() )
362 {
363 if ( (*iter)->getType() == scene::ESNAT_CAMERA_FPS )
364 {
365 // we send a key-down event for all keys used by this animator
366 scene::ISceneNodeAnimatorCameraFPS * fpsAnimator = static_cast<scene::ISceneNodeAnimatorCameraFPS*>(*iter);
367 const core::array<SKeyMap>& keyMap = fpsAnimator->getKeyMap();
368 for ( irr::u32 i=0; i< keyMap.size(); ++i )
369 {
370 irr::SEvent event;
371 event.EventType = EET_KEY_INPUT_EVENT;
372 event.KeyInput.Key = keyMap[i].KeyCode;
373 event.KeyInput.PressedDown = false;
374 fpsAnimator->OnEvent(event);
375 }
376 }
377 ++iter;
378 }
379}
380
381/*
382Function hasModalDialog() checks if we currently have a modal dialog open.
383*/
384bool hasModalDialog()
385{
386 if ( !Device )
387 return false;
388 IGUIEnvironment* env = Device->getGUIEnvironment();
389 IGUIElement * focused = env->getFocus();
390 while ( focused )
391 {
392 if ( focused->isVisible() && focused->hasType(EGUIET_MODAL_SCREEN) )
393 return true;
394 focused = focused->getParent();
395 }
396 return false;
397}
398
399/*
400To get all the events sent by the GUI Elements, we need to create an event
401receiver. This one is really simple. If an event occurs, it checks the id of
402the caller and the event type, and starts an action based on these values. For
403example, if a menu item with id GUI_ID_OPEN_MODEL was selected, it opens a file-open-dialog.
404*/
405class MyEventReceiver : public IEventReceiver
406{
407public:
408 virtual bool OnEvent(const SEvent& event)
409 {
410 // Escape swaps Camera Input
411 if (event.EventType == EET_KEY_INPUT_EVENT &&
412 event.KeyInput.PressedDown == false)
413 {
414 if ( OnKeyUp(event.KeyInput.Key) )
415 return true;
416 }
417
418 if (event.EventType == EET_GUI_EVENT)
419 {
420 s32 id = event.GUIEvent.Caller->getID();
421 IGUIEnvironment* env = Device->getGUIEnvironment();
422
423 switch(event.GUIEvent.EventType)
424 {
425 case EGET_MENU_ITEM_SELECTED:
426 // a menu item was clicked
427 OnMenuItemSelected( (IGUIContextMenu*)event.GUIEvent.Caller );
428 break;
429
430 case EGET_FILE_SELECTED:
431 {
432 // load the model file, selected in the file open dialog
433 IGUIFileOpenDialog* dialog =
434 (IGUIFileOpenDialog*)event.GUIEvent.Caller;
435 loadModel(core::stringc(dialog->getFileName()).c_str());
436 }
437 break;
438
439 case EGET_SCROLL_BAR_CHANGED:
440
441 // control skin transparency
442 if (id == GUI_ID_SKIN_TRANSPARENCY)
443 {
444 const s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos();
445 setSkinTransparency(pos, env->getSkin());
446 }
447 // control animation speed
448 else if (id == GUI_ID_SKIN_ANIMATION_FPS)
449 {
450 const s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos();
451 if (scene::ESNT_ANIMATED_MESH == Model->getType())
452 ((scene::IAnimatedMeshSceneNode*)Model)->setAnimationSpeed((f32)pos);
453 }
454 break;
455
456 case EGET_COMBO_BOX_CHANGED:
457
458 // control anti-aliasing/filtering
459 if (id == GUI_ID_TEXTUREFILTER)
460 {
461 OnTextureFilterSelected( (IGUIComboBox*)event.GUIEvent.Caller );
462 }
463 break;
464
465 case EGET_BUTTON_CLICKED:
466
467 switch(id)
468 {
469 case GUI_ID_BUTTON_SET_SCALE:
470 {
471 // set scale
472 gui::IGUIElement* root = env->getRootGUIElement();
473 core::vector3df scale;
474 core::stringc s;
475
476 s = root->getElementFromId(GUI_ID_X_SCALE, true)->getText();
477 scale.X = (f32)atof(s.c_str());
478 s = root->getElementFromId(GUI_ID_Y_SCALE, true)->getText();
479 scale.Y = (f32)atof(s.c_str());
480 s = root->getElementFromId(GUI_ID_Z_SCALE, true)->getText();
481 scale.Z = (f32)atof(s.c_str());
482
483 if (Model)
484 Model->setScale(scale);
485 updateScaleInfo(Model);
486 }
487 break;
488 case GUI_ID_BUTTON_SCALE_MUL10:
489 if (Model)
490 Model->setScale(Model->getScale()*10.f);
491 updateScaleInfo(Model);
492 break;
493 case GUI_ID_BUTTON_SCALE_DIV10:
494 if (Model)
495 Model->setScale(Model->getScale()*0.1f);
496 updateScaleInfo(Model);
497 break;
498 case GUI_ID_BUTTON_OPEN_MODEL:
499 env->addFileOpenDialog(L"Please select a model file to open");
500 break;
501 case GUI_ID_BUTTON_SHOW_ABOUT:
502 showAboutText();
503 break;
504 case GUI_ID_BUTTON_SHOW_TOOLBOX:
505 createToolBox();
506 break;
507 case GUI_ID_BUTTON_SELECT_ARCHIVE:
508 env->addFileOpenDialog(L"Please select your game archive/directory");
509 break;
510 }
511
512 break;
513 default:
514 break;
515 }
516 }
517
518 return false;
519 }
520
521
522 /*
523 Handle key-up events
524 */
525 bool OnKeyUp(irr::EKEY_CODE keyCode)
526 {
527 // Don't handle keys if we have a modal dialog open as it would lead
528 // to unexpected application behaviour for the user.
529 if ( hasModalDialog() )
530 return false;
531
532 if (keyCode == irr::KEY_ESCAPE)
533 {
534 if (Device)
535 {
536 scene::ICameraSceneNode * camera =
537 Device->getSceneManager()->getActiveCamera();
538 if (camera)
539 {
540 camera->setInputReceiverEnabled( !camera->isInputReceiverEnabled() );
541 }
542 return true;
543 }
544 }
545 else if (keyCode == irr::KEY_F1)
546 {
547 if (Device)
548 {
549 IGUIElement* elem = Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(GUI_ID_POSITION_TEXT);
550 if (elem)
551 elem->setVisible(!elem->isVisible());
552 }
553 }
554 else if (keyCode == irr::KEY_KEY_M)
555 {
556 if (Device)
557 Device->minimizeWindow();
558 }
559 else if (keyCode == irr::KEY_KEY_L)
560 {
561 UseLight=!UseLight;
562 if (Model)
563 {
564 Model->setMaterialFlag(video::EMF_LIGHTING, UseLight);
565 Model->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, UseLight);
566 }
567 }
568 return false;
569 }
570
571
572 /*
573 Handle "menu item clicked" events.
574 */
575 void OnMenuItemSelected( IGUIContextMenu* menu )
576 {
577 s32 id = menu->getItemCommandId(menu->getSelectedItem());
578 IGUIEnvironment* env = Device->getGUIEnvironment();
579
580 switch(id)
581 {
582 case GUI_ID_OPEN_MODEL: // FilOnButtonSetScalinge -> Open Model
583 env->addFileOpenDialog(L"Please select a model file to open");
584 break;
585 case GUI_ID_SET_MODEL_ARCHIVE: // File -> Set Model Archive
586 env->addFileOpenDialog(L"Please select your game archive/directory");
587 break;
588 case GUI_ID_LOAD_AS_OCTREE: // File -> LoadAsOctree
589 Octree = !Octree;
590 menu->setItemChecked(menu->getSelectedItem(), Octree);
591 break;
592 case GUI_ID_QUIT: // File -> Quit
593 Device->closeDevice();
594 break;
595 case GUI_ID_SKY_BOX_VISIBLE: // View -> Skybox
596 menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
597 SkyBox->setVisible(!SkyBox->isVisible());
598 break;
599 case GUI_ID_DEBUG_OFF: // View -> Debug Information
600 menu->setItemChecked(menu->getSelectedItem()+1, false);
601 menu->setItemChecked(menu->getSelectedItem()+2, false);
602 menu->setItemChecked(menu->getSelectedItem()+3, false);
603 menu->setItemChecked(menu->getSelectedItem()+4, false);
604 menu->setItemChecked(menu->getSelectedItem()+5, false);
605 menu->setItemChecked(menu->getSelectedItem()+6, false);
606 if (Model)
607 Model->setDebugDataVisible(scene::EDS_OFF);
608 break;
609 case GUI_ID_DEBUG_BOUNDING_BOX: // View -> Debug Information
610 menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
611 if (Model)
612 Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_BBOX));
613 break;
614 case GUI_ID_DEBUG_NORMALS: // View -> Debug Information
615 menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
616 if (Model)
617 Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_NORMALS));
618 break;
619 case GUI_ID_DEBUG_SKELETON: // View -> Debug Information
620 menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
621 if (Model)
622 Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_SKELETON));
623 break;
624 case GUI_ID_DEBUG_WIRE_OVERLAY: // View -> Debug Information
625 menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
626 if (Model)
627 Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_MESH_WIRE_OVERLAY));
628 break;
629 case GUI_ID_DEBUG_HALF_TRANSPARENT: // View -> Debug Information
630 menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
631 if (Model)
632 Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_HALF_TRANSPARENCY));
633 break;
634 case GUI_ID_DEBUG_BUFFERS_BOUNDING_BOXES: // View -> Debug Information
635 menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
636 if (Model)
637 Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_BBOX_BUFFERS));
638 break;
639 case GUI_ID_DEBUG_ALL: // View -> Debug Information
640 menu->setItemChecked(menu->getSelectedItem()-1, true);
641 menu->setItemChecked(menu->getSelectedItem()-2, true);
642 menu->setItemChecked(menu->getSelectedItem()-3, true);
643 menu->setItemChecked(menu->getSelectedItem()-4, true);
644 menu->setItemChecked(menu->getSelectedItem()-5, true);
645 menu->setItemChecked(menu->getSelectedItem()-6, true);
646 if (Model)
647 Model->setDebugDataVisible(scene::EDS_FULL);
648 break;
649 case GUI_ID_ABOUT: // Help->About
650 showAboutText();
651 break;
652 case GUI_ID_MODEL_MATERIAL_SOLID: // View -> Material -> Solid
653 if (Model)
654 Model->setMaterialType(video::EMT_SOLID);
655 break;
656 case GUI_ID_MODEL_MATERIAL_TRANSPARENT: // View -> Material -> Transparent
657 if (Model)
658 Model->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
659 break;
660 case GUI_ID_MODEL_MATERIAL_REFLECTION: // View -> Material -> Reflection
661 if (Model)
662 Model->setMaterialType(video::EMT_SPHERE_MAP);
663 break;
664
665 case GUI_ID_CAMERA_MAYA:
666 setActiveCamera(Camera[0]);
667 break;
668 case GUI_ID_CAMERA_FIRST_PERSON:
669 setActiveCamera(Camera[1]);
670 break;
671 }
672 }
673
674 /*
675 Handle the event that one of the texture-filters was selected in the corresponding combobox.
676 */
677 void OnTextureFilterSelected( IGUIComboBox* combo )
678 {
679 s32 pos = combo->getSelected();
680 switch (pos)
681 {
682 case 0:
683 if (Model)
684 {
685 Model->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
686 Model->setMaterialFlag(video::EMF_TRILINEAR_FILTER, false);
687 Model->setMaterialFlag(video::EMF_ANISOTROPIC_FILTER, false);
688 }
689 break;
690 case 1:
691 if (Model)
692 {
693 Model->setMaterialFlag(video::EMF_BILINEAR_FILTER, true);
694 Model->setMaterialFlag(video::EMF_TRILINEAR_FILTER, false);
695 }
696 break;
697 case 2:
698 if (Model)
699 {
700 Model->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
701 Model->setMaterialFlag(video::EMF_TRILINEAR_FILTER, true);
702 }
703 break;
704 case 3:
705 if (Model)
706 {
707 Model->setMaterialFlag(video::EMF_ANISOTROPIC_FILTER, true);
708 }
709 break;
710 case 4:
711 if (Model)
712 {
713 Model->setMaterialFlag(video::EMF_ANISOTROPIC_FILTER, false);
714 }
715 break;
716 }
717 }
718};
719
720
721/*
722Most of the hard work is done. We only need to create the Irrlicht Engine
723device and all the buttons, menus and toolbars. We start up the engine as
724usual, using createDevice(). To make our application catch events, we set our
725eventreceiver as parameter. As you can see, there is also a call to
726IrrlichtDevice::setResizeable(). This makes the render window resizeable, which
727is quite useful for a mesh viewer.
728*/
729int main(int argc, char* argv[])
730{
731 // ask user for driver
732 video::E_DRIVER_TYPE driverType=driverChoiceConsole();
733 if (driverType==video::EDT_COUNT)
734 return 1;
735
736 // create device and exit if creation failed
737 MyEventReceiver receiver;
738 Device = createDevice(driverType, core::dimension2d<u32>(800, 600),
739 16, false, false, false, &receiver);
740
741 if (Device == 0)
742 return 1; // could not create selected driver.
743
744 Device->setResizable(true);
745
746 Device->setWindowCaption(L"Irrlicht Engine - Loading...");
747
748 video::IVideoDriver* driver = Device->getVideoDriver();
749 IGUIEnvironment* env = Device->getGUIEnvironment();
750 scene::ISceneManager* smgr = Device->getSceneManager();
751 smgr->getParameters()->setAttribute(scene::COLLADA_CREATE_SCENE_INSTANCES, true);
752
753 driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
754
755 smgr->addLightSceneNode(0, core::vector3df(200,200,200),
756 video::SColorf(1.0f,1.0f,1.0f),2000);
757 smgr->setAmbientLight(video::SColorf(0.3f,0.3f,0.3f));
758 // add our media directory as "search path"
759 Device->getFileSystem()->addFileArchive("../../media/");
760
761 /*
762 The next step is to read the configuration file. It is stored in the xml
763 format and looks a little bit like this:
764
765 @verbatim
766 <?xml version="1.0"?>
767 <config>
768 <startUpModel file="some filename" />
769 <messageText caption="Irrlicht Engine Mesh Viewer">
770 Hello!
771 </messageText>
772 </config>
773 @endverbatim
774
775 We need the data stored in there to be written into the global variables
776 StartUpModelFile, MessageText and Caption. This is now done using the
777 Irrlicht Engine integrated XML parser:
778 */
779
780 // read configuration from xml file
781
782 io::IXMLReader* xml = Device->getFileSystem()->createXMLReader( L"config.xml");
783
784 while(xml && xml->read())
785 {
786 switch(xml->getNodeType())
787 {
788 case io::EXN_TEXT:
789 // in this xml file, the only text which occurs is the
790 // messageText
791 MessageText = xml->getNodeData();
792 break;
793 case io::EXN_ELEMENT:
794 {
795 if (core::stringw("startUpModel") == xml->getNodeName())
796 StartUpModelFile = xml->getAttributeValue(L"file");
797 else
798 if (core::stringw("messageText") == xml->getNodeName())
799 Caption = xml->getAttributeValue(L"caption");
800 }
801 break;
802 default:
803 break;
804 }
805 }
806
807 if (xml)
808 xml->drop(); // don't forget to delete the xml reader
809
810 if (argc > 1)
811 StartUpModelFile = argv[1];
812
813 /*
814 That wasn't difficult. Now we'll set a nicer font and create the Menu.
815 It is possible to create submenus for every menu item. The call
816 menu->addItem(L"File", -1, true, true); for example adds a new menu
817 Item with the name "File" and the id -1. The following parameter says
818 that the menu item should be enabled, and the last one says, that there
819 should be a submenu. The submenu can now be accessed with
820 menu->getSubMenu(0), because the "File" entry is the menu item with
821 index 0.
822 */
823
824 // set a nicer font
825
826 IGUISkin* skin = env->getSkin();
827 IGUIFont* font = env->getFont("fonthaettenschweiler.bmp");
828 if (font)
829 skin->setFont(font);
830
831 // create menu
832 gui::IGUIContextMenu* menu = env->addMenu();
833 menu->addItem(L"File", -1, true, true);
834 menu->addItem(L"View", -1, true, true);
835 menu->addItem(L"Camera", -1, true, true);
836 menu->addItem(L"Help", -1, true, true);
837
838 gui::IGUIContextMenu* submenu;
839 submenu = menu->getSubMenu(0);
840 submenu->addItem(L"Open Model File & Texture...", GUI_ID_OPEN_MODEL);
841 submenu->addItem(L"Set Model Archive...", GUI_ID_SET_MODEL_ARCHIVE);
842 submenu->addItem(L"Load as Octree", GUI_ID_LOAD_AS_OCTREE);
843 submenu->addSeparator();
844 submenu->addItem(L"Quit", GUI_ID_QUIT);
845
846 submenu = menu->getSubMenu(1);
847 submenu->addItem(L"sky box visible", GUI_ID_SKY_BOX_VISIBLE, true, false, true);
848 submenu->addItem(L"toggle model debug information", GUI_ID_TOGGLE_DEBUG_INFO, true, true);
849 submenu->addItem(L"model material", -1, true, true );
850
851 submenu = submenu->getSubMenu(1);
852 submenu->addItem(L"Off", GUI_ID_DEBUG_OFF);
853 submenu->addItem(L"Bounding Box", GUI_ID_DEBUG_BOUNDING_BOX);
854 submenu->addItem(L"Normals", GUI_ID_DEBUG_NORMALS);
855 submenu->addItem(L"Skeleton", GUI_ID_DEBUG_SKELETON);
856 submenu->addItem(L"Wire overlay", GUI_ID_DEBUG_WIRE_OVERLAY);
857 submenu->addItem(L"Half-Transparent", GUI_ID_DEBUG_HALF_TRANSPARENT);
858 submenu->addItem(L"Buffers bounding boxes", GUI_ID_DEBUG_BUFFERS_BOUNDING_BOXES);
859 submenu->addItem(L"All", GUI_ID_DEBUG_ALL);
860
861 submenu = menu->getSubMenu(1)->getSubMenu(2);
862 submenu->addItem(L"Solid", GUI_ID_MODEL_MATERIAL_SOLID);
863 submenu->addItem(L"Transparent", GUI_ID_MODEL_MATERIAL_TRANSPARENT);
864 submenu->addItem(L"Reflection", GUI_ID_MODEL_MATERIAL_REFLECTION);
865
866 submenu = menu->getSubMenu(2);
867 submenu->addItem(L"Maya Style", GUI_ID_CAMERA_MAYA);
868 submenu->addItem(L"First Person", GUI_ID_CAMERA_FIRST_PERSON);
869
870 submenu = menu->getSubMenu(3);
871 submenu->addItem(L"About", GUI_ID_ABOUT);
872
873 /*
874 Below the menu we want a toolbar, onto which we can place colored
875 buttons and important looking stuff like a senseless combobox.
876 */
877
878 // create toolbar
879
880 gui::IGUIToolBar* bar = env->addToolBar();
881
882 video::ITexture* image = driver->getTexture("open.png");
883 bar->addButton(GUI_ID_BUTTON_OPEN_MODEL, 0, L"Open a model",image, 0, false, true);
884
885 image = driver->getTexture("tools.png");
886 bar->addButton(GUI_ID_BUTTON_SHOW_TOOLBOX, 0, L"Open Toolset",image, 0, false, true);
887
888 image = driver->getTexture("zip.png");
889 bar->addButton(GUI_ID_BUTTON_SELECT_ARCHIVE, 0, L"Set Model Archive",image, 0, false, true);
890
891 image = driver->getTexture("help.png");
892 bar->addButton(GUI_ID_BUTTON_SHOW_ABOUT, 0, L"Open Help", image, 0, false, true);
893
894 // create a combobox for texture filters
895
896 gui::IGUIComboBox* box = env->addComboBox(core::rect<s32>(250,4,350,23), bar, GUI_ID_TEXTUREFILTER);
897 box->addItem(L"No filtering");
898 box->addItem(L"Bilinear");
899 box->addItem(L"Trilinear");
900 box->addItem(L"Anisotropic");
901 box->addItem(L"Isotropic");
902
903 /*
904 To make the editor look a little bit better, we disable transparent gui
905 elements, and add an Irrlicht Engine logo. In addition, a text showing
906 the current frames per second value is created and the window caption is
907 changed.
908 */
909
910 // disable alpha
911
912 for (s32 i=0; i<gui::EGDC_COUNT ; ++i)
913 {
914 video::SColor col = env->getSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i);
915 col.setAlpha(255);
916 env->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col);
917 }
918
919 // add a tabcontrol
920
921 createToolBox();
922
923 // create fps text
924
925 IGUIStaticText* fpstext = env->addStaticText(L"",
926 core::rect<s32>(400,4,570,23), true, false, bar);
927
928 IGUIStaticText* postext = env->addStaticText(L"",
929 core::rect<s32>(10,50,470,80),false, false, 0, GUI_ID_POSITION_TEXT);
930 postext->setVisible(false);
931
932 // set window caption
933
934 Caption += " - [";
935 Caption += driver->getName();
936 Caption += "]";
937 Device->setWindowCaption(Caption.c_str());
938
939 /*
940 That's nearly the whole application. We simply show the about message
941 box at start up, and load the first model. To make everything look
942 better, a skybox is created and a user controlled camera, to make the
943 application a little bit more interactive. Finally, everything is drawn
944 in a standard drawing loop.
945 */
946
947 // show about message box and load default model
948 if (argc==1)
949 showAboutText();
950 loadModel(StartUpModelFile.c_str());
951
952 // add skybox
953
954 SkyBox = smgr->addSkyBoxSceneNode(
955 driver->getTexture("irrlicht2_up.jpg"),
956 driver->getTexture("irrlicht2_dn.jpg"),
957 driver->getTexture("irrlicht2_lf.jpg"),
958 driver->getTexture("irrlicht2_rt.jpg"),
959 driver->getTexture("irrlicht2_ft.jpg"),
960 driver->getTexture("irrlicht2_bk.jpg"));
961
962 // add a camera scene node
963 Camera[0] = smgr->addCameraSceneNodeMaya();
964 Camera[0]->setFarValue(20000.f);
965 // Maya cameras reposition themselves relative to their target, so target the location
966 // where the mesh scene node is placed.
967 Camera[0]->setTarget(core::vector3df(0,30,0));
968
969 Camera[1] = smgr->addCameraSceneNodeFPS();
970 Camera[1]->setFarValue(20000.f);
971 Camera[1]->setPosition(core::vector3df(0,0,-70));
972 Camera[1]->setTarget(core::vector3df(0,30,0));
973
974 setActiveCamera(Camera[0]);
975
976 // load the irrlicht engine logo
977 IGUIImage *img =
978 env->addImage(driver->getTexture("irrlichtlogo2.png"),
979 core::position2d<s32>(10, driver->getScreenSize().Height - 128));
980
981 // lock the logo's edges to the bottom left corner of the screen
982 img->setAlignment(EGUIA_UPPERLEFT, EGUIA_UPPERLEFT,
983 EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT);
984
985 // remember state so we notice when the window does lose the focus
986 bool hasFocus = Device->isWindowFocused();
987
988 // draw everything
989
990 while(Device->run() && driver)
991 {
992 // Catch focus changes (workaround until Irrlicht has events for this)
993 bool focused = Device->isWindowFocused();
994 if ( hasFocus && !focused )
995 onKillFocus();
996 hasFocus = focused;
997
998 if (Device->isWindowActive())
999 {
1000 driver->beginScene(true, true, video::SColor(150,50,50,50));
1001
1002 smgr->drawAll();
1003 env->drawAll();
1004
1005 driver->endScene();
1006
1007 // update information about current frame-rate
1008 core::stringw str(L"FPS: ");
1009 str.append(core::stringw(driver->getFPS()));
1010 str += L" Tris: ";
1011 str.append(core::stringw(driver->getPrimitiveCountDrawn()));
1012 fpstext->setText(str.c_str());
1013
1014 // update information about the active camera
1015 scene::ICameraSceneNode* cam = Device->getSceneManager()->getActiveCamera();
1016 str = L"Pos: ";
1017 str.append(core::stringw(cam->getPosition().X));
1018 str += L" ";
1019 str.append(core::stringw(cam->getPosition().Y));
1020 str += L" ";
1021 str.append(core::stringw(cam->getPosition().Z));
1022 str += L" Tgt: ";
1023 str.append(core::stringw(cam->getTarget().X));
1024 str += L" ";
1025 str.append(core::stringw(cam->getTarget().Y));
1026 str += L" ";
1027 str.append(core::stringw(cam->getTarget().Z));
1028 postext->setText(str.c_str());
1029
1030 // update the tool dialog
1031 updateToolBox();
1032 }
1033 else
1034 Device->yield();
1035 }
1036
1037 Device->drop();
1038 return 0;
1039}
1040
1041/*
1042**/
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/resource.h b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/resource.h
new file mode 100644
index 0000000..a8e8616
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/resource.h
@@ -0,0 +1,16 @@
1//{{NO_DEPENDENCIES}}
2// Microsoft Visual C++ generated include file.
3// Used by 9.Meshviewer.rc
4//
5#define IDI_ICON1 101
6
7// Next default values for new objects
8//
9#ifdef APSTUDIO_INVOKED
10#ifndef APSTUDIO_READONLY_SYMBOLS
11#define _APS_NEXT_RESOURCE_VALUE 102
12#define _APS_NEXT_COMMAND_VALUE 40001
13#define _APS_NEXT_CONTROL_VALUE 1001
14#define _APS_NEXT_SYMED_VALUE 101
15#endif
16#endif
diff --git a/src/others/irrlicht-1.8.1/examples/09.Meshviewer/tutorial.html b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/tutorial.html
new file mode 100644
index 0000000..d296b6c
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/09.Meshviewer/tutorial.html
@@ -0,0 +1,182 @@
1<html>
2<head>
3<title>Irrlicht Engine Tutorial</title>
4<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5</head>
6
7<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
8<br>
9<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
10 <tr>
11 <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>
12 <td bgcolor="#666699" width="100%">
13<div align="center">
14 <div align="left"><b><font color="#FFFFFF">Tutorial 9. Mesh Viewer</font></b></div>
15 </div>
16 </td>
17 </tr>
18 <tr bgcolor="#eeeeff">
19 <td height="90" colspan="2">
20 <div align="left">
21 <p> This tutorial shows how to create a more complex application with
22 the engine. We construct a simple mesh viewer using the user interface
23 API and the scenemanagement of Irrlicht.<br>
24 The tutorial shows how to create and use Buttons, Windows, Toolbars,
25 Menus, ComboBoxes, Tabcontrols, Editboxes, Images, MessageBoxes, SkyBoxes,
26 and how to parse XML files with the integrated XML reader of the engine.</p>
27 <p>The program which is described here will look like this:</p>
28 <p align="center"><img src="../../media/009shot.jpg" width="260" height="203"><br>
29 </p>
30 </div>
31 </td>
32 </tr>
33</table>
34<br>
35<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
36 <tr>
37 <td bgcolor="#666699"> <b><font color="#FFFFFF">Lets start!</font></b></td>
38 </tr>
39 <tr>
40 <td height="90" bgcolor="#eeeeff" valign="top"> <div align="left">
41 <div align="left">
42 <p>We start like in most other tutorials: Include all nesessary header
43 files, add a comment to let the engine be linked with the right .lib
44 file in Visual Studio, and deklare some global variables. We also
45 add two 'using namespece' statements, so we do not need to write the
46 whole names of all classes. In this tutorial, we use a lot stuff from
47 the gui namespace.</p>
48 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
49 <tr>
50 <td> <pre>#include &lt;irrlicht.h&gt;<br>#include &lt;iostream&gt;<br><br>using namespace irr;<br>using namespace gui;<br><br>#pragma comment(lib, &quot;Irrlicht.lib&quot;)<br><br>IrrlichtDevice *Device = 0;<br>core::stringc StartUpModelFile;<br>core::stringw MessageText;<br>core::stringw Caption;<br>scene::IAnimatedMeshSceneNode* Model = 0;<br>scene::ISceneNode* SkyBox = 0;<br></pre></td>
51 </tr>
52 </table>
53 <p> The three following functions do several stuff used by the mesh
54 viewer. The first function showAboutText() simply displays a messagebox
55 with a caption and a message text. The texts will be stored in the
56 MessageText and Caption variables at startup.</p>
57 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
58 <tr>
59 <td> <pre>void showAboutText()<br>{<br><font color="#006600"> // create modal message box with the text<br> // loaded from the xml file</font><font color="#00CC00">.</font><br> Device-&gt;getGUIEnvironment()-&gt;addMessageBox(<br> Caption.c_str(), MessageText.c_str());<br>}</pre></td>
60 </tr>
61 </table>
62 <p> The second function loadModel() loads a model and displays it using
63 an addAnimatedMeshSceneNode and the scene manager. Nothing difficult.
64 It also displays a short message box, if the model could not be loaded.
65 </p>
66 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
67 <tr>
68 <td> <pre>void loadModel(const c8* filename)<br>{<br> <font color="#006600">// load a model into the engine</font><br> if (Model)<br> Model-&gt;remove();<br> Model = 0;<br><br> scene::IAnimatedMesh* m = Device-&gt;getSceneManager()-&gt;getMesh(filename);<br> if (!m) <br> {<br> <font color="#006600">// model could not be loaded</font><br> if (StartUpModelFile != filename)<br> Device-&gt;getGUIEnvironment()-&gt;addMessageBox(<br> Caption.c_str(), L&quot;The model could not be loaded. &quot; \<br> L&quot;Maybe it is not a supported file format.&quot;);<br> return;<br> }<br><br><font color="#006600"> // set default material properties</font><br> Model = Device-&gt;getSceneManager()-&gt;addAnimatedMeshSceneNode(m);<br> Model-&gt;setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);<br> Model-&gt;setMaterialFlag(video::EMF_LIGHTING, false);<br> Model-&gt;setDebugDataVisible(true);<br>}</pre></td>
69 </tr>
70 </table>
71 <p> Finally, the third function creates a toolbox window. In this simple
72 mesh viewer, this toolbox only contains a tab control with three edit
73 boxes for changing the scale of the displayed model.</p>
74 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
75 <tr>
76 <td> <pre>void createToolBox()<br>{<br> <font color="#006600">// remove tool box if already there</font><br> IGUIEnvironment* env = Device-&gt;getGUIEnvironment();<br> IGUIElement* root = env-&gt;getRootGUIElement();<br> IGUIElement* e = root-&gt;getElementFromId(5000, true);<br> if (e) e-&gt;remove();<br><br> <font color="#006600">// create the toolbox window</font><br> IGUIWindow* wnd = env-&gt;addWindow(core::rect&lt;s32&gt;(450,25,640,480),<br> false, L&quot;Toolset&quot;, 0, 5000);<br><br> <font color="#006600">// create tab control and tabs</font><br> IGUITabControl* tab = env-&gt;addTabControl(<br> core::rect&lt;s32&gt;(2,20,640-452,480-7), wnd, true, true);<br> IGUITab* t1 = tab-&gt;addTab(L&quot;Scale&quot;);<br> IGUITab* t2 = tab-&gt;addTab(L&quot;Empty Tab&quot;);<br><br> <font color="#006600">// add some edit boxes and a button to tab one</font><br> env-&gt;addEditBox(L&quot;1.0&quot;, core::rect&lt;s32&gt;(40,50,130,70), true, t1, 901);<br> env-&gt;addEditBox(L&quot;1.0&quot;, core::rect&lt;s32&gt;(40,80,130,100), true, t1, 902);<br> env-&gt;addEditBox(L&quot;1.0&quot;, core::rect&lt;s32&gt;(40,110,130,130), true, t1, 903);<br> env-&gt;addButton(core::rect&lt;s32&gt;(10,150,100,190), t1, 1101, L&quot;set&quot;);<br><br> // bring irrlicht engine logo to front, because it<br> // now may be below the newly created toolbox<br> root-&gt;bringToFront(root-&gt;getElementFromId(666, true));<br>}</pre></td>
77 </tr>
78 </table>
79 <p> To get all the events sent by the GUI Elements, we need to create
80 an event receiver. This one is really simple. If an event occurs,
81 it checks the id of the caller and the event type, and starts an action
82 based on these values. For example, if a menu item with id 100 was
83 selected, if opens a file-open-dialog. </p>
84 </div>
85 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
86 <tr>
87 <td> <pre><font size="2">class MyEventReceiver : public IEventReceiver<br>{<br>public:<br> virtual bool OnEvent(const SEvent&amp; event)<br> {<br> if (event.EventType == EET_GUI_EVENT)<br> {<br> s32 id = event.GUIEvent.Caller-&gt;getID();<br> IGUIEnvironment* env = Device-&gt;getGUIEnvironment();<br> switch(event.GUIEvent.EventType)<br> {<br> case EGET_MENU_ITEM_SELECTED:<br> {<br> <font color="#006600"> // a menu item was clicked</font><br> IGUIContextMenu* menu = (IGUIContextMenu*)event.GUIEvent.Caller;<br> s32 id = menu-&gt;getItemCommandId(menu-&gt;getSelectedItem());<br> <br> switch(id)<br> {<br> case 100<font color="#006600">: // File -&gt; Open Mode</font>l<br> env-&gt;addFileOpenDialog(L&quot;Please select a model file to open&quot;);<br> break;<br> case 200<font color="#006600">: // File -&gt; Quit</font><br> Device-&gt;closeDevice();<br> break;<br> case 300<font color="#006600">: // View -&gt; Skybox</font><br> SkyBox-&gt;setVisible(!SkyBox-&gt;isVisible());<br> break;<br> case 400<font color="#006600">: // View -&gt; Debug Informatio</font>n<br> if (Model)<br> Model-&gt;setDebugDataVisible(!Model-&gt;isDebugDataVisible());<br> break;<br> case 500<font color="#006600">: // Help-&gt;About</font><br> showAboutText();<br> break;<br> case 610<font color="#006600">: // View -&gt; Material -&gt; Soli</font>d<br> if (Model)<br> Model-&gt;setMaterialType(video::EMT_SOLID);<br> break;<br> case 620<font color="#006600">: // View -&gt; Material -&gt; Transparen</font>t<br> if (Model)<br> Model-&gt;setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);<br> break;<br> case 630<font color="#006600">: // View -&gt; Material -&gt; Reflectio</font>n<br> if (Model)<br> Model-&gt;setMaterialType(video::EMT_SPHERE_MAP);<br> break;<br> }<br> break;<br> }<br> case EGET_FILE_SELECTED:<br> {<br> <font color="#006600"> // load the model file, selected in the file open dialo</font>g<br> IGUIFileOpenDialog* dialog = <br> (IGUIFileOpenDialog*)event.GUIEvent.Caller;<br> loadModel(core::stringc(dialog-&gt;getFilename()).c_str());<br> }<br> case EGET_BUTTON_CLICKED:<br> switch(id)<br> {<br> case 1101:<br> {<br> <font color="#006600"> // set scal</font>e<br> gui::IGUIElement* root = env-&gt;getRootGUIElement();<br> core::vector3df scale;<br> core::stringc s;<br> s = root-&gt;getElementFromId(901, true)-&gt;getText();<br> scale.X = (f32)atof(s.c_str());<br> s = root-&gt;getElementFromId(902, true)-&gt;getText();<br> scale.Y = (f32)atof(s.c_str());<br> s = root-&gt;getElementFromId(903, true)-&gt;getText();<br> scale.Z = (f32)atof(s.c_str());<br> if (Model)<br> Model-&gt;setScale(scale);<br> }<br> break;<br> case 1102:<br> env-&gt;addFileOpenDialog(L&quot;Please select a model file to open&quot;);<br> break;<br> case 1103:<br> showAboutText();<br> break;<br> case 1104:<br> createToolBox();<br> break;<br> }<br> break;<br> }<br> }<br> return false;<br> }<br>};</font></pre></td>
88 </tr>
89 </table>
90 <p> Most of the hard work is done. We only need to create the Irrlicht
91 Engine device and all the buttons, menus and toolbars. We start up the
92 engine as usual, using createDevice(). To make our application catch
93 events, we set our eventreceiver as parameter. The #ifdef WIN32 preprocessor
94 commands are not necesarry, but I included them to make the tutorial
95 use DirectX on Windows and OpenGL on all other platforms like Linux.
96 As you can see, there is also a unusual call to IrrlichtDevice::setResizeAble().
97 This makes the render window resizeable, which is quite useful for a
98 mesh viewer. </p>
99 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
100 <tr>
101 <td><pre>int main()<br>{<br> // ask user for driver
102<br> video::E_DRIVER_TYPE driverType;
103<br> printf(&quot;Please select the driver you want for this example:\n&quot;\<br> &quot; (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n&quot;\<br> &quot; (d) Software Renderer\n (e) Apfelbaum Software Renderer\n&quot;\<br> &quot; (f) NullDevice\n (otherKey) exit\n\n&quot;);<br><br> char key;<br> std::cin &gt;&gt; key;<br><br> switch(key)<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> }
104<br> // create device and exit if creation failed
105<br> MyEventReceiver receiver;<br> Device = createDevice(driverType, core::dimension2d&lt;s32&gt;(640, 480),<br> 16, false, false, false, &amp;receiver);
106<br> if (Device == 0)<br> return 1; // could not create selected driver.<br><br> Device-&gt;setResizable(true);<br> Device-&gt;setWindowCaption(L&quot;Irrlicht Engine - Loading...&quot;);<br><br> video::IVideoDriver* driver = Device-&gt;getVideoDriver();<br> IGUIEnvironment* env = Device-&gt;getGUIEnvironment();<br> scene::ISceneManager* smgr = Device-&gt;getSceneManager();<br></pre></td>
107 </tr>
108 </table>
109 <p> The next step is to read the configuration file. It is stored in the
110 xml format and looks a little bit like this:<br>
111 <br>
112 <font face="Courier New, Courier, mono">&lt;?xml version=&quot;1.0&quot;?&gt;<br>
113 &lt;config&gt;<br>
114 &lt;startUpModel file=&quot;some filename&quot; /&gt;<br>
115 &lt;messageText caption=&quot;Irrlicht Engine Mesh Viewer&quot;&gt;<br>
116 Hello!<br>
117 &lt;/messageText&gt;<br>
118 &lt;/config&gt;</font><br>
119 <br>
120 We need the data stored in there to be written into the global variables
121 StartUpModelFile, MessageText and Caption. This is now done using the
122 Irrlicht Engine integrated XML parser: </p>
123 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
124 <tr>
125 <td><pre> <font color="#006600">// read configuration from xml file</font><br> io::IXMLReader* xml =<br> Device-&gt;getFileSystem()-&gt;createXMLReader(&quot;../../media/config.xml&quot;);<br> while(xml &amp;&amp; xml-&gt;read())<br> {<br> switch(xml-&gt;getNodeType())<br> {<br> case io::EXN_TEXT:<br> <font color="#006600">// in this xml file, the only text which occurs is the messageText</font><br> MessageText = xml-&gt;getNodeData();<br> break;<br> case io::EXN_ELEMENT:<br> {<br> if (core::stringw(&quot;startUpModel&quot;) == xml-&gt;getNodeName())<br> StartUpModelFile = xml-&gt;getAttributeValue(L&quot;file&quot;);<br> else<br> if (core::stringw(&quot;messageText&quot;) == xml-&gt;getNodeName())<br> Caption = xml-&gt;getAttributeValue(L&quot;caption&quot;);<br> }<br> break;<br> }<br> }<br> if (xml)<br> xml-&gt;drop(); <font color="#006600">// don't forget to delete the xml reader </font><br>
126</pre></td>
127 </tr>
128 </table>
129 <p> That wasn't difficult. Now we'll set a nicer font and create the Menu.
130 It is possible to create submenus for every menu item. The call menu-&gt;addItem(L&quot;File&quot;,
131 -1, true, true); for example adds a new menu Item with the name &quot;File&quot;
132 and the id -1. The following parameter says that the menu item should
133 be enabled, and the last one says, that there should be a submenu. The
134 submenu can now be accessed with menu-&gt;getSubMenu(0), because the
135 &quot;File&quot; entry is the menu item with index 0. </p>
136 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
137 <tr>
138 <td><pre> <font color="#006600">// set a nicer font</font><br> IGUISkin* skin = env-&gt;getSkin();<br> IGUIFont* font = env-&gt;getFont(&quot;../../media/fonthaettenschweiler.bmp&quot;);<br> if (font)<br> skin-&gt;setFont(font);<br><br><font color="#006600"> // create menu</font><br> gui::IGUIContextMenu* menu = env-&gt;addMenu();<br> menu-&gt;addItem(L&quot;File&quot;, -1, true, true);<br> menu-&gt;addItem(L&quot;View&quot;, -1, true, true);<br> menu-&gt;addItem(L&quot;Help&quot;, -1, true, true);<br><br> gui::IGUIContextMenu* submenu;<br> submenu = menu-&gt;getSubMenu(0);<br> submenu-&gt;addItem(L&quot;Open Model File...&quot;, 100);<br> submenu-&gt;addSeparator();<br> submenu-&gt;addItem(L&quot;Quit&quot;, 200);<br><br> submenu = menu-&gt;getSubMenu(1);<br> submenu-&gt;addItem(L&quot;toggle sky box visibility&quot;, 300);<br> submenu-&gt;addItem(L&quot;toggle model debug information&quot;, 400);<br> submenu-&gt;addItem(L&quot;model material&quot;, -1, true, true );<br><br> submenu = submenu-&gt;getSubMenu(2);<br> submenu-&gt;addItem(L&quot;Solid&quot;, 610);<br> submenu-&gt;addItem(L&quot;Transparent&quot;, 620);<br> submenu-&gt;addItem(L&quot;Reflection&quot;, 630);<br><br> submenu = menu-&gt;getSubMenu(2);<br> submenu-&gt;addItem(L&quot;About&quot;, 500);
139</pre></td>
140 </tr>
141 </table>
142 <br>
143 We want a toolbar, onto which we can place colored buttons and important
144 looking stuff like a senseless combobox.<br>
145 <br>
146 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
147 <tr>
148 <td><pre><font color="#006600"> // create toolbar</font><br> gui::IGUIToolBar* bar = env-&gt;addToolBar();<br> bar-&gt;addButton(1102, 0, driver-&gt;getTexture(&quot;../../media/open.bmp&quot;));<br> bar-&gt;addButton(1103, 0, driver-&gt;getTexture(&quot;../../media/help.bmp&quot;));<br> bar-&gt;addButton(1104, 0, driver-&gt;getTexture(&quot;../../media/tools.bmp&quot;));<br><br><font color="#006600"> // create a combobox with some senseless texts</font><br> gui::IGUIComboBox* box = env-&gt;addComboBox(core::rect&lt;s32&gt;(100,5,200,25), bar);<br> box-&gt;addItem(L&quot;Bilinear&quot;);<br> box-&gt;addItem(L&quot;Trilinear&quot;);<br> box-&gt;addItem(L&quot;Anisotropic&quot;);<br> box-&gt;addItem(L&quot;Isotropic&quot;);<br> box-&gt;addItem(L&quot;Psychedelic&quot;);<br> box-&gt;addItem(L&quot;No filtering&quot;);</pre></td>
149 </tr>
150 </table>
151 <br>
152 To make the editor look a little bit better, we disable transparent gui
153 elements, and add a Irrlicht Engine logo. In addition, a text, which will
154 show the current frame per second value is created, and the window caption
155 changed.<br>
156 <br>
157 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
158 <tr>
159 <td><pre> <font color="#006600">// disable alpha</font><br> for (s32 i=0; i&lt;gui::EGDC_COUNT ; ++i)<br> {<br> video::SColor col = env-&gt;getSkin()-&gt;getColor((gui::EGUI_DEFAULT_COLOR)i);<br> col.setAlpha(255);<br> env-&gt;getSkin()-&gt;setColor((gui::EGUI_DEFAULT_COLOR)i, col);<br> }<br><br><font color="#006600"> // add a tabcontrol</font><br> createToolBox();<br><br> <font color="#006600">// add the irrlicht engine logo</font><br> IGUIImage* img = env-&gt;addImage(core::rect&lt;s32&gt;(22,429,108,460), 0, 666);<br> img-&gt;setImage(driver-&gt;getTexture(&quot;../../media/irrlichtlogoaligned.jpg&quot;));<br><br> <font color="#006600">// create fps text </font><br> IGUIStaticText* fpstext =<br> env-&gt;addStaticText(L&quot;&quot;, core::rect&lt;s32&gt;(210,26,270,41), true);<br><br> <font color="#006600">// set window caption</font><br> Caption += &quot; - [&quot;;<br> Caption += driver-&gt;getName();<br> Caption += &quot;]&quot;;<br> Device-&gt;setWindowCaption(Caption.c_str());</pre></td>
160 </tr>
161 </table>
162 <br>
163 That's nearly the whole application. We simply show the about message
164 box at start up, and load the first model. To make everything look better,
165 a skybox is created and a user controled camera, to make the application
166 a little bit more interactive. Finally, everything is drawed in a standard
167 drawing loop.<br>
168 <br>
169 <table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
170 <tr>
171 <td><pre> <font color="#006600">// show about message box and load default model</font><br> showAboutText();<br> loadModel(StartUpModelFile.c_str());<br><font color="#006600"><br> // add skybox</font> <br> SkyBox = smgr-&gt;addSkyBoxSceneNode(<br> driver-&gt;getTexture(&quot;../../media/irrlicht2_up.bmp&quot;),<br> driver-&gt;getTexture(&quot;../../media/irrlicht2_dn.bmp&quot;),<br> driver-&gt;getTexture(&quot;../../media/irrlicht2_lf.bmp&quot;),<br> driver-&gt;getTexture(&quot;../../media/irrlicht2_rt.bmp&quot;),<br> driver-&gt;getTexture(&quot;../../media/irrlicht2_ft.bmp&quot;),<br> driver-&gt;getTexture(&quot;../../media/irrlicht2_bk.bmp&quot;));<br><br><font color="#006600"> // add a camera scene node </font><br> smgr-&gt;addCameraSceneNodeMaya();<br> <br> <font color="#006600">// draw everything</font><br> while(Device-&gt;run() &amp;&amp; driver)<br> if (Device-&gt;isWindowActive())<br> {<br> driver-&gt;beginScene(true, true, video::SColor(150,50,50,50));<br> smgr-&gt;drawAll();<br> env-&gt;drawAll();<br> <br> driver-&gt;endScene();<br><br> core::stringw str = L&quot;FPS: &quot;;<br> str += driver-&gt;getFPS();<br> fpstext-&gt;setText(str.c_str());<br> }<br> Device-&gt;drop();<br> return 0;<br>}<br></pre></td>
172 </tr>
173 </table>
174 <br>
175 Compile and run this, and you have a fully functional 3d Mesh viewer.<br>
176 </div>
177 </td>
178 </tr>
179</table>
180<p>&nbsp;</p>
181 </body>
182</html>