Browse Source

added more demos for Visual Studio 2008

git-svn-id: http://zengl.googlecode.com/svn/branches/0.3.x@1924 6573c10b-8653-0410-9706-d32479e959fb
dr.andru 13 years ago
parent
commit
111dd01b60

+ 72 - 0
demos/Visual Studio 2008/10 - Tiles/10 - Tiles.rc

@@ -0,0 +1,72 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Russian resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+#ifdef _WIN32
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+MAINICON                ICON                    "..\\..\\..\\bin\\data\\zengl.ico"
+#endif    // Russian resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+

+ 214 - 0
demos/Visual Studio 2008/10 - Tiles/10 - Tiles.vcproj

@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9,00"
+	Name="10 - Tiles"
+	ProjectGUID="{4266480A-452F-4AFF-A005-F2C0B15F7D1D}"
+	RootNamespace="My10Tiles"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)../../bin/i386-win32"
+			IntermediateDirectory="$(SolutionDir)tmp/$(ProjectName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)../../headers&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)../../bin/i386-win32"
+			IntermediateDirectory="$(SolutionDir)tmp/$(ProjectName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)../../headers&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\demo10.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\resource.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\headers\zglHeader.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+			<File
+				RelativePath=".\10 - Tiles.rc"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\bin\data\zengl.ico"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

+ 65 - 0
demos/Visual Studio 2008/10 - Tiles/10 - Tiles.vcproj.user

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="9,00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(TargetPath)"
+				WorkingDirectory="$(SolutionDir)../../bin/i386-win32"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(TargetPath)"
+				WorkingDirectory="$(SolutionDir)../../bin/i386-win32"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor=""
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>

+ 103 - 0
demos/Visual Studio 2008/10 - Tiles/demo10.cpp

@@ -0,0 +1,103 @@
+#define ZGL_IMPORT
+
+#include <memory.h>
+#include <math.h>
+#include "zglHeader.h"
+
+zglPFont	fntMain;
+zglTTiles2D	map;
+zglPTexture	texTiles;
+
+char resource[256];
+
+char* GetResource( char* FileName )
+{
+	sprintf_s( resource, "../data/%s", FileName );
+	return resource;
+}
+
+void Init()
+{
+	fntMain = font_LoadFromFile( GetResource( "font.zfi" ) );
+
+	texTiles = tex_LoadFromFile( GetResource( "tiles.png" ) );
+	tex_SetFrameSize( &texTiles, 32, 32 );
+
+	// RU: Инициализация тайлов размером 32x32. Параметр Count указывает на количество тайлов по X и Y. Массив Tiles содержит кадры для каждого тайла.
+	// EN: Initialization of tiles with size 32x32. Parameter Count set amount of tiles on X and Y. Array Tiles contains frames for every tile.
+	map.Size.W  = 32;
+	map.Size.H  = 32;
+	map.Count.X = 25;
+	map.Count.Y = 19;
+	map.Tiles = (int**)malloc( sizeof( int* ) * map.Count.X );
+	// RU: Заполняем карту "травой", 19 кадр.
+	// EN: Fill the map by "grass", 19 frame.
+	for ( int i = 0; i < map.Count.X; i++ )
+	{
+		map.Tiles[ i ] = (int*)malloc( sizeof( int ) * map.Count.Y );
+		for ( int j = 0; j < map.Count.Y; j++ )
+			map.Tiles[ i ][ j ] = 19;
+	}
+
+	// RU: Загружаем карту из бинарного файла.
+	// EN: Load map from binary file.
+	zglTFile f;
+	file_Open( &f, GetResource( "ground.map" ), FOM_OPENR );
+	for ( int i = 0; i < map.Count.X; i++ )
+		file_Read( f, &map.Tiles[ i ][ 0 ], map.Count.Y * sizeof( int ) );
+	file_Close( &f );
+}
+
+void Draw()
+{
+	// RU: Рендерим тайлы в координатах 0,0.
+	// EN: Render tiles in coordinates 0,0.
+	tiles2d_Draw( texTiles, 0, 0, &map );
+
+	char text[64];
+	sprintf_s( text, "FPS: %i", zgl_Get( RENDER_FPS ) );
+	text_Draw( fntMain, 0, 0, text );
+
+	text_Draw( fntMain, 180, 30, "This is a tarrible example of tile map, but main idea should be clear :)" );
+}
+
+void Timer()
+{
+	if ( key_Press( K_ESCAPE ) ) zgl_Exit();
+
+	key_ClearState();
+}
+
+void Quit()
+{
+	for ( int i = 0; i < map.Count.X; i++ )
+		free( map.Tiles[ i ] );
+	free( map.Tiles );
+}
+
+int CALLBACK WinMain (
+	__in HINSTANCE hInstance,
+	__in_opt HINSTANCE hPrevInstance,
+	__in_opt LPSTR lpCmdLine,
+	__in int nShowCmd
+	)
+{
+	if ( !zglLoad( libZenGL ) ) return 0;
+
+	timer_Add( (void*)&Timer, 16 );
+
+	zgl_Reg( SYS_LOAD, (void*)&Init );
+	zgl_Reg( SYS_DRAW, (void*)&Draw );
+	zgl_Reg( SYS_EXIT, (void*)&Quit );
+
+	wnd_SetCaption( "10 - Tiles" );
+
+	wnd_ShowCursor( TRUE );
+
+	scr_SetOptions( 800, 600, REFRESH_MAXIMUM, FALSE, FALSE );
+
+	zgl_Init();
+
+	zglFree();
+	return 0;
+}

+ 16 - 0
demos/Visual Studio 2008/10 - Tiles/resource.h

@@ -0,0 +1,16 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by 10 - Tiles.rc
+//
+#define MAINICON                        101
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        102
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1001
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif

+ 72 - 0
demos/Visual Studio 2008/11 - Grid/11 - Grid.rc

@@ -0,0 +1,72 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Russian resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+#ifdef _WIN32
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+MAINICON                ICON                    "..\\..\\..\\bin\\data\\zengl.ico"
+#endif    // Russian resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+

+ 214 - 0
demos/Visual Studio 2008/11 - Grid/11 - Grid.vcproj

@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9,00"
+	Name="11 - Grid"
+	ProjectGUID="{782BB7D4-B070-4732-A92C-8968E1945D47}"
+	RootNamespace="My11Grid"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)../../bin/i386-win32"
+			IntermediateDirectory="$(SolutionDir)tmp/$(ProjectName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)../../headers&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)../../bin/i386-win32"
+			IntermediateDirectory="$(SolutionDir)tmp/$(ProjectName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)../../headers&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\demo11.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\resource.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\headers\zglHeader.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+			<File
+				RelativePath=".\11 - Grid.rc"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\bin\data\zengl.ico"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

+ 65 - 0
demos/Visual Studio 2008/11 - Grid/11 - Grid.vcproj.user

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="9,00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(TargetPath)"
+				WorkingDirectory="$(SolutionDir)../../bin/i386-win32"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(TargetPath)"
+				WorkingDirectory="$(SolutionDir)../../bin/i386-win32"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor=""
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>

+ 114 - 0
demos/Visual Studio 2008/11 - Grid/demo11.cpp

@@ -0,0 +1,114 @@
+#define ZGL_IMPORT
+
+#include <memory.h>
+#include <math.h>
+#include "zglHeader.h"
+
+zglPFont	fntMain;
+zglPTexture	texBack;
+zglTGrid2D	grid;
+float		wave;
+
+char resource[256];
+
+char* GetResource( char* FileName )
+{
+	sprintf_s( resource, "../data/%s", FileName );
+	return resource;
+}
+
+void Init()
+{
+	texBack = tex_LoadFromFile( GetResource( "back04.jpg" ) );
+
+	fntMain = font_LoadFromFile( GetResource( "font.zfi" ) );
+
+	// RU: Инициализация сетки размером 21x16. Основная идея - каждый узел сетки это смещение относительно её верхнего левого угла.
+	// EN: Initialization of grid with size 21x16. Main idea - every node of grid is an offset from the top left corner.
+	grid.Cols = 21;
+	grid.Rows = 16;
+	grid.Grid = (zglTPoint2D**)malloc( grid.Cols * sizeof( zglTPoint2D* ) );
+	for ( int i = 0; i < grid.Cols; i++ )
+	{
+		grid.Grid[ i ] = (zglTPoint2D*)malloc( grid.Rows * sizeof( zglTPoint2D ) );
+		for ( int j = 0; j < grid.Rows; j++ )
+		{
+			grid.Grid[ i ][ j ].X = i * 40.f;
+			grid.Grid[ i ][ j ].Y = j * 40.f;
+		}
+	}
+}
+
+void Draw()
+{
+	// RU: Рендерим сетку в координатах 0,0.
+	// EN: Render grid in coordinates 0,0.
+	sgrid2d_Draw( texBack, 0, 0, &grid );
+
+	char text[64];
+	sprintf_s( text, "FPS: %i", zgl_Get( RENDER_FPS ) );
+	text_Draw( fntMain, 0, 0, text );
+}
+
+void Timer()
+{
+	wave = wave + ( rand() % 1000 ) / 10000.f;
+	float cwave = cos( wave );
+	float swave = sin( wave );
+
+	// RU: Симуляция простого эффекта под водой.
+	// EN: Simulation of simple underwater effect.
+	for ( int i = 1; i < grid.Cols - 1; i++ )
+		for ( int j = 1; j < grid.Rows - 1; j++ )
+		{
+			if ( ( i % 2 == 0 ) && ( j % 2 == 0 ) )
+			{
+				grid.Grid[ i ][ j ].X = i * 40.f + cwave;
+				grid.Grid[ i ][ j ].Y = j * 40.f + swave;
+			}
+			else
+			{
+				grid.Grid[ i ][ j ].X = i * 40.f - cwave;
+				grid.Grid[ i ][ j ].Y = j * 40.f - swave;
+			}
+		}
+
+	if ( key_Press( K_ESCAPE ) ) zgl_Exit();
+	key_ClearState();
+}
+
+void Quit()
+{
+	for ( int i = 0; i < grid.Cols; i++ )
+		free( grid.Grid[ i ] );
+	free( grid.Grid );
+}
+
+int CALLBACK WinMain (
+	__in HINSTANCE hInstance,
+	__in_opt HINSTANCE hPrevInstance,
+	__in_opt LPSTR lpCmdLine,
+	__in int nShowCmd
+	)
+{
+	if ( !zglLoad( libZenGL ) ) return 0;
+
+	srand( 0xDeaDBeeF );
+
+	timer_Add( (void*)&Timer, 16 );
+
+	zgl_Reg( SYS_LOAD, (void*)&Init );
+	zgl_Reg( SYS_DRAW, (void*)&Draw );
+	zgl_Reg( SYS_EXIT, (void*)&Quit );
+
+	wnd_SetCaption( "11 - Grid" );
+
+	wnd_ShowCursor( TRUE );
+
+	scr_SetOptions( 800, 600, REFRESH_MAXIMUM, FALSE, FALSE );
+
+	zgl_Init();
+
+	zglFree();
+	return 0;
+}

+ 16 - 0
demos/Visual Studio 2008/11 - Grid/resource.h

@@ -0,0 +1,16 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by 11 - Grid.rc
+//
+#define MAINICON                        101
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        102
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1001
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif

+ 72 - 0
demos/Visual Studio 2008/13 - Particles/13 - Particles.rc

@@ -0,0 +1,72 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Russian resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+#ifdef _WIN32
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+MAINICON                ICON                    "..\\..\\..\\bin\\data\\zengl.ico"
+#endif    // Russian resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+

+ 214 - 0
demos/Visual Studio 2008/13 - Particles/13 - Particles.vcproj

@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9,00"
+	Name="13 - Particles"
+	ProjectGUID="{52F38722-A19C-43DF-BB3F-4D24273B54F5}"
+	RootNamespace="My13Particles"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)../../bin/i386-win32"
+			IntermediateDirectory="$(SolutionDir)tmp/$(ProjectName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)../../headers&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)../../bin/i386-win32"
+			IntermediateDirectory="$(SolutionDir)tmp/$(ProjectName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)../../headers&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\demo13.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\resource.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\headers\zglHeader.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+			<File
+				RelativePath=".\13 - Particles.rc"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\bin\data\zengl.ico"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

+ 65 - 0
demos/Visual Studio 2008/13 - Particles/13 - Particles.vcproj.user

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="9,00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(TargetPath)"
+				WorkingDirectory="$(SolutionDir)../../bin/i386-win32"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(TargetPath)"
+				WorkingDirectory="$(SolutionDir)../../bin/i386-win32"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor=""
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>

+ 136 - 0
demos/Visual Studio 2008/13 - Particles/demo13.cpp

@@ -0,0 +1,136 @@
+#define ZGL_IMPORT
+
+#include <memory.h>
+#include <math.h>
+#include "zglHeader.h"
+
+zglPFont		fntMain;
+zglPTexture		texBack;
+bool			debug;
+zglTPEngine2D	particles;
+zglPEmitter2D	emitterFire[3];
+zglPEmitter2D	emitterDiamond;
+zglPEmitter2D	emitterRain;
+
+char resource[256];
+
+char* GetResource( char* FileName )
+{
+	sprintf_s( resource, "../data/%s", FileName );
+	return resource;
+}
+
+void Init()
+{
+	texBack = tex_LoadFromFile( GetResource( "back02.png" ) );
+
+	fntMain = font_LoadFromFile( GetResource( "font.zfi" ) );
+
+	// EN: Load three types of fire emitters.
+	// RU: Загрузка трёх разных видов эмиттеров огня.
+	emitterFire[ 0 ] = emitter2d_LoadFromFile( GetResource( "emitter_fire00.zei" ) );
+	emitterFire[ 1 ] = emitter2d_LoadFromFile( GetResource( "emitter_fire01.zei" ) );
+	emitterFire[ 2 ] = emitter2d_LoadFromFile( GetResource( "emitter_fire02.zei" ) );
+
+	// EN: Set own particels engine.
+	// RU: Установка собственного движка эмиттеров.
+	pengine2d_Set( &particles );
+
+	// EN: Add 6 fire emitters to particles engine. Second parameter of function returns pointer to instance of new emitter, which can be processed manually.
+	//     This instance will be  NULL after the death, so check everything.
+	// RU: Добавляем в движок 6 эмиттеров огня. Второй параметр функции позволяет получить указатель на конкретный экземпляр эмиттера, который можно будет обрабатывать вручную.
+	//     Данный экземпляр после смерти будет содержать NULL, поэтому используйте проверку.
+	pengine2d_AddEmitter( emitterFire[ 0 ], NULL, 642, 190 );
+	pengine2d_AddEmitter( emitterFire[ 0 ], NULL, 40, 368 );
+	pengine2d_AddEmitter( emitterFire[ 0 ], NULL, 246, 368 );
+	pengine2d_AddEmitter( emitterFire[ 1 ], NULL, 532, 244 );
+	pengine2d_AddEmitter( emitterFire[ 1 ], NULL, 318, 422 );
+	pengine2d_AddEmitter( emitterFire[ 1 ], NULL, 583, 420 );
+	pengine2d_AddEmitter( emitterFire[ 2 ], NULL, 740, 525 );
+
+	emitterDiamond = emitter2d_LoadFromFile( GetResource( "emitter_diamond.zei" ) );
+	pengine2d_AddEmitter( emitterDiamond, NULL );
+
+	emitterRain = emitter2d_LoadFromFile( GetResource( "emitter_rain.zei" ) );
+	pengine2d_AddEmitter( emitterRain, NULL );
+}
+
+void Draw()
+{
+	batch2d_Begin();
+
+	ssprite2d_Draw( texBack, 0, 0, 800, 600, 0 );
+
+	// EN: Rendering of all emitters in current particles engine.
+	// RU: Рендеринг всех эмиттеров в текущем движке частиц.
+	pengine2d_Draw();
+
+	if ( debug )
+		for ( int i = 0; i < particles.Count.Emitters; i++ )
+			pr2d_Rect( particles.List[ i ]->BBox.MinX, particles.List[ i ]->BBox.MinY,
+						particles.List[ i ]->BBox.MaxX - particles.List[ i ]->BBox.MinX,
+						particles.List[ i ]->BBox.MaxY - particles.List[ i ]->BBox.MinY, 0xFF0000, 255 );
+
+	char text[64];
+	sprintf_s( text, "FPS: %i", zgl_Get( RENDER_FPS ) );
+	text_Draw( fntMain, 0, 0, text );
+
+	sprintf_s( text, "Particles: %i", particles.Count.Particles );
+	text_Draw( fntMain, 0, 20, text );
+
+	sprintf_s( text, "Debug(F1): %s", debug ? "TRUE" : "FALSE" );
+	text_Draw( fntMain, 0, 40, text );
+
+	batch2d_End();
+}
+
+void Timer()
+{
+	if ( key_Press( K_ESCAPE ) ) zgl_Exit();
+	if ( key_Press( K_F1 ) ) debug = !debug;
+
+	key_ClearState();
+}
+
+void Update( double dt )
+{
+	// EN: Process all emitters in current particles engine.
+	// RU: Обработка всех эмиттеров в текущем движке частиц.
+	pengine2d_Proc( dt );
+}
+
+void Quit()
+{
+	// RU: Очищаем память от созданных эмиттеров.
+	// EN: Free allocated memory for emitters.
+	pengine2d_Set( &particles );
+	pengine2d_ClearAll();
+}
+
+int CALLBACK WinMain (
+	__in HINSTANCE hInstance,
+	__in_opt HINSTANCE hPrevInstance,
+	__in_opt LPSTR lpCmdLine,
+	__in int nShowCmd
+	)
+{
+	if ( !zglLoad( libZenGL ) ) return 0;
+
+	timer_Add( (void*)&Timer, 16 );
+
+	zgl_Reg( SYS_LOAD, (void*)&Init );
+	zgl_Reg( SYS_DRAW, (void*)&Draw );
+	zgl_Reg( SYS_UPDATE, (void*)&Update );
+	zgl_Reg( SYS_EXIT, (void*)&Quit );
+
+	wnd_SetCaption( "13 - Particles" );
+
+	wnd_ShowCursor( TRUE );
+
+	scr_SetOptions( 800, 600, REFRESH_MAXIMUM, FALSE, FALSE );
+
+	zgl_Init();
+
+	zglFree();
+	return 0;
+}

+ 16 - 0
demos/Visual Studio 2008/13 - Particles/resource.h

@@ -0,0 +1,16 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by 13 - Particles.rc
+//
+#define MAINICON                        101
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        102
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1001
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif

+ 72 - 0
demos/Visual Studio 2008/15 - Video/15 - Video.rc

@@ -0,0 +1,72 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Russian resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+#ifdef _WIN32
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+MAINICON                ICON                    "..\\..\\..\\bin\\data\\zengl.ico"
+#endif    // Russian resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+

+ 214 - 0
demos/Visual Studio 2008/15 - Video/15 - Video.vcproj

@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9,00"
+	Name="15 - Video"
+	ProjectGUID="{8D26A9F9-B50C-4C47-ABA7-6302A2A85445}"
+	RootNamespace="My15Video"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)../../bin/i386-win32"
+			IntermediateDirectory="$(SolutionDir)tmp/$(ProjectName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)../../headers&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)../../bin/i386-win32"
+			IntermediateDirectory="$(SolutionDir)tmp/$(ProjectName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)../../headers&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\demo15.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\resource.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\headers\zglHeader.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+			<File
+				RelativePath=".\15 - Video.rc"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\bin\data\zengl.ico"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

+ 65 - 0
demos/Visual Studio 2008/15 - Video/15 - Video.vcproj.user

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="9,00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			>
+			<DebugSettings
+				Command="$(TargetPath)"
+				WorkingDirectory="$(SolutionDir)../../bin/i386-win32"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor="0"
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			>
+			<DebugSettings
+				Command="$(TargetPath)"
+				WorkingDirectory="$(SolutionDir)../../bin/i386-win32"
+				CommandArguments=""
+				Attach="false"
+				DebuggerType="3"
+				Remote="1"
+				RemoteMachine=""
+				RemoteCommand=""
+				HttpUrl=""
+				PDBPath=""
+				SQLDebugging=""
+				Environment=""
+				EnvironmentMerge="true"
+				DebuggerFlavor=""
+				MPIRunCommand=""
+				MPIRunArguments=""
+				MPIRunWorkingDirectory=""
+				ApplicationCommand=""
+				ApplicationArguments=""
+				ShimCommand=""
+				MPIAcceptMode=""
+				MPIAcceptFilter=""
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>

+ 113 - 0
demos/Visual Studio 2008/15 - Video/demo15.cpp

@@ -0,0 +1,113 @@
+#define ZGL_IMPORT
+
+#include <memory.h>
+#include <math.h>
+#include "zglHeader.h"
+
+#define SCREEN_WIDTH  800
+#define SCREEN_HEIGHT 600
+
+zglPFont		fntMain;
+zglPVideoStream	video;
+bool			videoSeek;
+
+char resource[256];
+
+char* GetResource( char* FileName )
+{
+	sprintf_s( resource, "../data/%s", FileName );
+	return resource;
+}
+
+void Init()
+{
+	fntMain = font_LoadFromFile( GetResource( "font.zfi" ) );
+
+	// EN: Open the video file.
+	// RU: Открыть видео файл.
+	video = video_OpenFile( GetResource( "video.ogv" ) );
+}
+
+void Draw()
+{
+	if ( video )
+	{
+		// EN: Rendering the current video frame in the center of screen using parameters of it from video.Info.
+		// RU: Рендеринг текущего кадра видео в центре экрана используя параметры из video.Info.
+		ssprite2d_Draw( video->Texture, ( 800 - video->Info.Width ) / 2.f, ( 600 - video->Info.Height ) / 2.f, video->Info.Width, video->Info.Height, 0 );
+
+		// EN: Rendering of progress bar.
+		// RU: Рендеринг полосы прогресса.
+		pr2d_Rect( 0, 600 - 100, 800, 20, 0x00FF00, 255 );
+		pr2d_Rect( 0, 600 - 100, ( 800.f / (float)video->Info.Duration ) * (float)video->Time, 20, 0x00FF00, 155, PR2D_FILL );
+
+		char text[64];
+		sprintf_s( text, "FPS: %i", zgl_Get( RENDER_FPS ) );
+		text_Draw( fntMain, 0, 0, text );
+
+		sprintf_s( text, "Frame: %i", video->Frame );
+		text_Draw( fntMain, 0, 20, text );
+
+		sprintf_s( text, "Duration: %3.2f", video->Info.Duration / 1000.f );
+		text_Draw( fntMain, 100, 0, text );
+
+		sprintf_s( text, "Frames: %i", video->Info.Frames );
+		text_Draw( fntMain, 100, 20, text );
+
+		sprintf_s( text, "Time: %3.2f", video->Time / 1000.f );
+		text_Draw( fntMain, 230, 0, text );
+	}
+}
+
+void Timer()
+{
+	if ( key_Press( K_ESCAPE ) ) zgl_Exit();
+
+	// EN: If left mouse button is down on progress bar, then seek the video.
+	// RU: Если зажата левая кнопка мыши над полосой прогресса - перемещаться по видео.
+	if ( mouse_Down( M_BLEFT ) && ( mouse_Y() > 500 ) && ( mouse_Y() < 520 ) )
+	{
+		videoSeek = TRUE;
+		video_Seek( &video, ( mouse_X() / 800.f ) * video->Info.Duration );
+	}
+	else
+		videoSeek = FALSE;
+
+	key_ClearState();
+	mouse_ClearState();
+}
+
+void Update( double dt )
+{
+	if ( !videoSeek )
+		video_Update( &video, dt, TRUE );
+}
+
+int CALLBACK WinMain (
+	__in HINSTANCE hInstance,
+	__in_opt HINSTANCE hPrevInstance,
+	__in_opt LPSTR lpCmdLine,
+	__in int nShowCmd
+	)
+{
+	if ( !zglLoad( libZenGL ) ) return 0;
+
+	srand( 0xDeaDBeeF );
+
+	timer_Add( (void*)&Timer, 16 );
+
+	zgl_Reg( SYS_LOAD, (void*)&Init );
+	zgl_Reg( SYS_DRAW, (void*)&Draw );
+	zgl_Reg( SYS_UPDATE, (void*)&Update );
+
+	wnd_SetCaption( "15 - Video" );
+
+	wnd_ShowCursor( TRUE );
+
+	scr_SetOptions( 800, 600, REFRESH_MAXIMUM, FALSE, FALSE );
+
+	zgl_Init();
+
+	zglFree();
+	return 0;
+}

+ 16 - 0
demos/Visual Studio 2008/15 - Video/resource.h

@@ -0,0 +1,16 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by 15 - Video.rc
+//
+#define MAINICON                        101
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        102
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1001
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif

+ 24 - 0
demos/Visual Studio 2008/demos.sln

@@ -17,10 +17,18 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07 - Sprites", "07 - Sprite
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08 - Sprite Engine", "08 - Sprite Engine\08 - Sprite Engine.vcproj", "{901DE1AC-ED60-49B1-BF75-B4C090F491EE}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "10 - Tiles", "10 - Tiles\10 - Tiles.vcproj", "{4266480A-452F-4AFF-A005-F2C0B15F7D1D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "11 - Grid", "11 - Grid\11 - Grid.vcproj", "{782BB7D4-B070-4732-A92C-8968E1945D47}"
+EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12 - Render into Texture", "12 - Render into Texture\12 - Render into Texture.vcproj", "{517392CA-D6EB-474F-B6C5-B9E00251006F}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "13 - Particles", "13 - Particles\13 - Particles.vcproj", "{52F38722-A19C-43DF-BB3F-4D24273B54F5}"
+EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14 - Sound", "14 - Sound\14 - Sound.vcproj", "{2AF57833-0AEE-45CE-8743-AEB1543E6E66}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15 - Video", "15 - Video\15 - Video.vcproj", "{8D26A9F9-B50C-4C47-ABA7-6302A2A85445}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -59,14 +67,30 @@ Global
 		{901DE1AC-ED60-49B1-BF75-B4C090F491EE}.Debug|Win32.Build.0 = Debug|Win32
 		{901DE1AC-ED60-49B1-BF75-B4C090F491EE}.Release|Win32.ActiveCfg = Release|Win32
 		{901DE1AC-ED60-49B1-BF75-B4C090F491EE}.Release|Win32.Build.0 = Release|Win32
+		{4266480A-452F-4AFF-A005-F2C0B15F7D1D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4266480A-452F-4AFF-A005-F2C0B15F7D1D}.Debug|Win32.Build.0 = Debug|Win32
+		{4266480A-452F-4AFF-A005-F2C0B15F7D1D}.Release|Win32.ActiveCfg = Release|Win32
+		{4266480A-452F-4AFF-A005-F2C0B15F7D1D}.Release|Win32.Build.0 = Release|Win32
+		{782BB7D4-B070-4732-A92C-8968E1945D47}.Debug|Win32.ActiveCfg = Debug|Win32
+		{782BB7D4-B070-4732-A92C-8968E1945D47}.Debug|Win32.Build.0 = Debug|Win32
+		{782BB7D4-B070-4732-A92C-8968E1945D47}.Release|Win32.ActiveCfg = Release|Win32
+		{782BB7D4-B070-4732-A92C-8968E1945D47}.Release|Win32.Build.0 = Release|Win32
 		{517392CA-D6EB-474F-B6C5-B9E00251006F}.Debug|Win32.ActiveCfg = Debug|Win32
 		{517392CA-D6EB-474F-B6C5-B9E00251006F}.Debug|Win32.Build.0 = Debug|Win32
 		{517392CA-D6EB-474F-B6C5-B9E00251006F}.Release|Win32.ActiveCfg = Release|Win32
 		{517392CA-D6EB-474F-B6C5-B9E00251006F}.Release|Win32.Build.0 = Release|Win32
+		{52F38722-A19C-43DF-BB3F-4D24273B54F5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{52F38722-A19C-43DF-BB3F-4D24273B54F5}.Debug|Win32.Build.0 = Debug|Win32
+		{52F38722-A19C-43DF-BB3F-4D24273B54F5}.Release|Win32.ActiveCfg = Release|Win32
+		{52F38722-A19C-43DF-BB3F-4D24273B54F5}.Release|Win32.Build.0 = Release|Win32
 		{2AF57833-0AEE-45CE-8743-AEB1543E6E66}.Debug|Win32.ActiveCfg = Debug|Win32
 		{2AF57833-0AEE-45CE-8743-AEB1543E6E66}.Debug|Win32.Build.0 = Debug|Win32
 		{2AF57833-0AEE-45CE-8743-AEB1543E6E66}.Release|Win32.ActiveCfg = Release|Win32
 		{2AF57833-0AEE-45CE-8743-AEB1543E6E66}.Release|Win32.Build.0 = Release|Win32
+		{8D26A9F9-B50C-4C47-ABA7-6302A2A85445}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8D26A9F9-B50C-4C47-ABA7-6302A2A85445}.Debug|Win32.Build.0 = Debug|Win32
+		{8D26A9F9-B50C-4C47-ABA7-6302A2A85445}.Release|Win32.ActiveCfg = Release|Win32
+		{8D26A9F9-B50C-4C47-ABA7-6302A2A85445}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE