Browse Source

git-svn-id: http://zengl.googlecode.com/svn/branches/0.3.x@1920 6573c10b-8653-0410-9706-d32479e959fb

dr.andru 13 years ago
parent
commit
08a3ccfc27
32 changed files with 1535 additions and 16 deletions
  1. 72 0
      demos/Visual Studio 2010/10 - Tiles/10 - Tiles.rc
  2. 106 0
      demos/Visual Studio 2010/10 - Tiles/10 - Tiles.vcxproj
  3. 40 0
      demos/Visual Studio 2010/10 - Tiles/10 - Tiles.vcxproj.filters
  4. 11 0
      demos/Visual Studio 2010/10 - Tiles/10 - Tiles.vcxproj.user
  5. 103 0
      demos/Visual Studio 2010/10 - Tiles/demo10.cpp
  6. 16 0
      demos/Visual Studio 2010/10 - Tiles/resource.h
  7. 72 0
      demos/Visual Studio 2010/11 - Grid/11 - Grid.rc
  8. 106 0
      demos/Visual Studio 2010/11 - Grid/11 - Grid.vcxproj
  9. 40 0
      demos/Visual Studio 2010/11 - Grid/11 - Grid.vcxproj.filters
  10. 11 0
      demos/Visual Studio 2010/11 - Grid/11 - Grid.vcxproj.user
  11. 114 0
      demos/Visual Studio 2010/11 - Grid/demo11.cpp
  12. 16 0
      demos/Visual Studio 2010/11 - Grid/resource.h
  13. 72 0
      demos/Visual Studio 2010/13 - Particles/13 - Particles.rc
  14. 106 0
      demos/Visual Studio 2010/13 - Particles/13 - Particles.vcxproj
  15. 40 0
      demos/Visual Studio 2010/13 - Particles/13 - Particles.vcxproj.filters
  16. 11 0
      demos/Visual Studio 2010/13 - Particles/13 - Particles.vcxproj.user
  17. 136 0
      demos/Visual Studio 2010/13 - Particles/demo13.cpp
  18. 16 0
      demos/Visual Studio 2010/13 - Particles/resource.h
  19. 72 0
      demos/Visual Studio 2010/15 - Video/15 - Video.rc
  20. 106 0
      demos/Visual Studio 2010/15 - Video/15 - Video.vcxproj
  21. 40 0
      demos/Visual Studio 2010/15 - Video/15 - Video.vcxproj.filters
  22. 11 0
      demos/Visual Studio 2010/15 - Video/15 - Video.vcxproj.user
  23. 113 0
      demos/Visual Studio 2010/15 - Video/demo15.cpp
  24. 16 0
      demos/Visual Studio 2010/15 - Video/resource.h
  25. 24 0
      demos/Visual Studio 2010/demos.sln
  26. 19 7
      headers/zglHeader.h
  27. 2 2
      headers/zglHeader.pas
  28. 4 2
      src/Lazarus/ZenGL-win.lpi
  29. 6 2
      src/ZenGL.pas
  30. BIN
      src/ZenGL.res
  31. 31 0
      src/zgl_export_c.pas
  32. 3 3
      src/zgl_main.pas

+ 72 - 0
demos/Visual Studio 2010/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
+

+ 106 - 0
demos/Visual Studio 2010/10 - Tiles/10 - Tiles.vcxproj

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{75ef39d7-ed53-4ab6-9b54-3f933612418d}</ProjectGuid>
+    <RootNamespace>My10Tiles</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)../../bin/i386-win32\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)tmp/$(ProjectName)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)../../bin/i386-win32\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)tmp/$(ProjectName)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>$(SolutionDir)../../headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)../../headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="demo10.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="resource.h" />
+    <ClInclude Include="..\..\..\headers\zglHeader.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="10 - Tiles.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\bin\data\zengl.ico" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 40 - 0
demos/Visual Studio 2010/10 - Tiles/10 - Tiles.vcxproj.filters

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="demo10.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="resource.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\headers\zglHeader.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="10 - Tiles.rc">
+      <Filter>Resource Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\bin\data\zengl.ico">
+      <Filter>Resource Files</Filter>
+    </None>
+  </ItemGroup>
+</Project>

+ 11 - 0
demos/Visual Studio 2010/10 - Tiles/10 - Tiles.vcxproj.user

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LocalDebuggerWorkingDirectory>..\..\..\bin\i386-win32</LocalDebuggerWorkingDirectory>
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LocalDebuggerWorkingDirectory>..\..\..\bin\i386-win32</LocalDebuggerWorkingDirectory>
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+  </PropertyGroup>
+</Project>

+ 103 - 0
demos/Visual Studio 2010/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 2010/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 2010/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
+

+ 106 - 0
demos/Visual Studio 2010/11 - Grid/11 - Grid.vcxproj

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{e927b330-f955-43d6-a62c-681135268daa}</ProjectGuid>
+    <RootNamespace>My11Grid</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)../../bin/i386-win32\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)tmp/$(ProjectName)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)../../bin/i386-win32\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)tmp/$(ProjectName)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>$(SolutionDir)../../headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)../../headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="demo11.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="resource.h" />
+    <ClInclude Include="..\..\..\headers\zglHeader.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="11 - Grid.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\bin\data\zengl.ico" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 40 - 0
demos/Visual Studio 2010/11 - Grid/11 - Grid.vcxproj.filters

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="demo11.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="resource.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\headers\zglHeader.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="11 - Grid.rc">
+      <Filter>Resource Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\bin\data\zengl.ico">
+      <Filter>Resource Files</Filter>
+    </None>
+  </ItemGroup>
+</Project>

+ 11 - 0
demos/Visual Studio 2010/11 - Grid/11 - Grid.vcxproj.user

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LocalDebuggerWorkingDirectory>..\..\..\bin\i386-win32</LocalDebuggerWorkingDirectory>
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LocalDebuggerWorkingDirectory>..\..\..\bin\i386-win32</LocalDebuggerWorkingDirectory>
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+  </PropertyGroup>
+</Project>

+ 114 - 0
demos/Visual Studio 2010/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 2010/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 2010/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
+

+ 106 - 0
demos/Visual Studio 2010/13 - Particles/13 - Particles.vcxproj

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{3eeec171-29a9-49e4-bc96-6149274cbd94}</ProjectGuid>
+    <RootNamespace>My13Particles</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)../../bin/i386-win32\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)tmp/$(ProjectName)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)../../bin/i386-win32\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)tmp/$(ProjectName)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>$(SolutionDir)../../headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)../../headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="demo13.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="resource.h" />
+    <ClInclude Include="..\..\..\headers\zglHeader.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="13 - Particles.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\bin\data\zengl.ico" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 40 - 0
demos/Visual Studio 2010/13 - Particles/13 - Particles.vcxproj.filters

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="demo13.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="resource.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\headers\zglHeader.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="13 - Particles.rc">
+      <Filter>Resource Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\bin\data\zengl.ico">
+      <Filter>Resource Files</Filter>
+    </None>
+  </ItemGroup>
+</Project>

+ 11 - 0
demos/Visual Studio 2010/13 - Particles/13 - Particles.vcxproj.user

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LocalDebuggerWorkingDirectory>..\..\..\bin\i386-win32</LocalDebuggerWorkingDirectory>
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LocalDebuggerWorkingDirectory>..\..\..\bin\i386-win32</LocalDebuggerWorkingDirectory>
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+  </PropertyGroup>
+</Project>

+ 136 - 0
demos/Visual Studio 2010/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 2010/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 2010/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
+

+ 106 - 0
demos/Visual Studio 2010/15 - Video/15 - Video.vcxproj

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{904db040-5689-4636-8e1b-b4496816b7e1}</ProjectGuid>
+    <RootNamespace>My15Video</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)../../bin/i386-win32\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)tmp/$(ProjectName)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)../../bin/i386-win32\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)tmp/$(ProjectName)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>$(SolutionDir)../../headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)../../headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="demo15.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="resource.h" />
+    <ClInclude Include="..\..\..\headers\zglHeader.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="15 - Video.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\bin\data\zengl.ico" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 40 - 0
demos/Visual Studio 2010/15 - Video/15 - Video.vcxproj.filters

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="demo15.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="resource.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\headers\zglHeader.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="15 - Video.rc">
+      <Filter>Resource Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\..\bin\data\zengl.ico">
+      <Filter>Resource Files</Filter>
+    </None>
+  </ItemGroup>
+</Project>

+ 11 - 0
demos/Visual Studio 2010/15 - Video/15 - Video.vcxproj.user

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LocalDebuggerWorkingDirectory>..\..\..\bin\i386-win32</LocalDebuggerWorkingDirectory>
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LocalDebuggerWorkingDirectory>..\..\..\bin\i386-win32</LocalDebuggerWorkingDirectory>
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+  </PropertyGroup>
+</Project>

+ 113 - 0
demos/Visual Studio 2010/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 2010/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 2010/demos.sln

@@ -19,8 +19,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08 - Sprite Engine", "08 -
 EndProject
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12 - Render into Texture", "12 - Render into Texture\12 - Render into Texture.vcxproj", "{517392CA-D6EB-474F-B6C5-B9E00251006F}"
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12 - Render into Texture", "12 - Render into Texture\12 - Render into Texture.vcxproj", "{517392CA-D6EB-474F-B6C5-B9E00251006F}"
 EndProject
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "10 - Tiles", "10 - Tiles\10 - Tiles.vcxproj", "{75EF39D7-ED53-4AB6-9B54-3F933612418D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "11 - Grid", "11 - Grid\11 - Grid.vcxproj", "{E927B330-F955-43D6-A62C-681135268DAA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "13 - Particles", "13 - Particles\13 - Particles.vcxproj", "{3EEEC171-29A9-49E4-BC96-6149274CBD94}"
+EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14 - Sound", "14 - Sound\14 - Sound.vcxproj", "{2AF57833-0AEE-45CE-8743-AEB1543E6E66}"
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14 - Sound", "14 - Sound\14 - Sound.vcxproj", "{2AF57833-0AEE-45CE-8743-AEB1543E6E66}"
 EndProject
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15 - Video", "15 - Video\15 - Video.vcxproj", "{904DB040-5689-4636-8E1B-B4496816B7E1}"
+EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
 		Debug|Win32 = Debug|Win32
@@ -63,10 +71,26 @@ Global
 		{517392CA-D6EB-474F-B6C5-B9E00251006F}.Debug|Win32.Build.0 = 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.ActiveCfg = Release|Win32
 		{517392CA-D6EB-474F-B6C5-B9E00251006F}.Release|Win32.Build.0 = Release|Win32
 		{517392CA-D6EB-474F-B6C5-B9E00251006F}.Release|Win32.Build.0 = Release|Win32
+		{75EF39D7-ED53-4AB6-9B54-3F933612418D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{75EF39D7-ED53-4AB6-9B54-3F933612418D}.Debug|Win32.Build.0 = Debug|Win32
+		{75EF39D7-ED53-4AB6-9B54-3F933612418D}.Release|Win32.ActiveCfg = Release|Win32
+		{75EF39D7-ED53-4AB6-9B54-3F933612418D}.Release|Win32.Build.0 = Release|Win32
+		{E927B330-F955-43D6-A62C-681135268DAA}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E927B330-F955-43D6-A62C-681135268DAA}.Debug|Win32.Build.0 = Debug|Win32
+		{E927B330-F955-43D6-A62C-681135268DAA}.Release|Win32.ActiveCfg = Release|Win32
+		{E927B330-F955-43D6-A62C-681135268DAA}.Release|Win32.Build.0 = Release|Win32
+		{3EEEC171-29A9-49E4-BC96-6149274CBD94}.Debug|Win32.ActiveCfg = Debug|Win32
+		{3EEEC171-29A9-49E4-BC96-6149274CBD94}.Debug|Win32.Build.0 = Debug|Win32
+		{3EEEC171-29A9-49E4-BC96-6149274CBD94}.Release|Win32.ActiveCfg = Release|Win32
+		{3EEEC171-29A9-49E4-BC96-6149274CBD94}.Release|Win32.Build.0 = Release|Win32
 		{2AF57833-0AEE-45CE-8743-AEB1543E6E66}.Debug|Win32.ActiveCfg = Debug|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}.Debug|Win32.Build.0 = Debug|Win32
 		{2AF57833-0AEE-45CE-8743-AEB1543E6E66}.Release|Win32.ActiveCfg = Release|Win32
 		{2AF57833-0AEE-45CE-8743-AEB1543E6E66}.Release|Win32.ActiveCfg = Release|Win32
 		{2AF57833-0AEE-45CE-8743-AEB1543E6E66}.Release|Win32.Build.0 = Release|Win32
 		{2AF57833-0AEE-45CE-8743-AEB1543E6E66}.Release|Win32.Build.0 = Release|Win32
+		{904DB040-5689-4636-8E1B-B4496816B7E1}.Debug|Win32.ActiveCfg = Debug|Win32
+		{904DB040-5689-4636-8E1B-B4496816B7E1}.Debug|Win32.Build.0 = Debug|Win32
+		{904DB040-5689-4636-8E1B-B4496816B7E1}.Release|Win32.ActiveCfg = Release|Win32
+		{904DB040-5689-4636-8E1B-B4496816B7E1}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE

+ 19 - 7
headers/zglHeader.h

@@ -2,8 +2,8 @@
 /*-----------= ZenGL =------------*/
 /*-----------= ZenGL =------------*/
 /*--------------------------------*/
 /*--------------------------------*/
 /*                                */
 /*                                */
-/* version:  0.3.3                */
-/* date:     2012.09.09           */
+/* version:  0.3.4                */
+/* date:     2012.09.19           */
 /* license:  GNU LGPL version 3   */
 /* license:  GNU LGPL version 3   */
 /* homepage: http://zengl.org     */
 /* homepage: http://zengl.org     */
 /*                                */
 /*                                */
@@ -1148,7 +1148,15 @@ ZGLEXTERN void ( *pengine2d_Set )( zglPPEngine2D PEngine );
 ZGLEXTERN zglPPEngine2D ( *pengine2d_Get )();
 ZGLEXTERN zglPPEngine2D ( *pengine2d_Get )();
 ZGLEXTERN void ( *pengine2d_Draw )();
 ZGLEXTERN void ( *pengine2d_Draw )();
 ZGLEXTERN void ( *pengine2d_Proc )( double dt );
 ZGLEXTERN void ( *pengine2d_Proc )( double dt );
+#ifdef __CPP__
+ZGLEXTERN void ( *__pengine2d_AddEmitter )( zglPEmitter2D Emitter, zglPPEmitter2D Result, float X, float Y );
+static inline void pengine2d_AddEmitter( zglPEmitter2D Emitter, zglPPEmitter2D Result, float X = 0, float Y = 0 )
+{
+  __pengine2d_AddEmitter( Emitter, Result, X, Y );
+}
+#else
 ZGLEXTERN void ( *pengine2d_AddEmitter )( zglPEmitter2D Emitter, zglPPEmitter2D Result, float X, float Y );
 ZGLEXTERN void ( *pengine2d_AddEmitter )( zglPEmitter2D Emitter, zglPPEmitter2D Result, float X, float Y );
+#endif
 ZGLEXTERN void ( *pengine2d_DelEmitter )( int ID );
 ZGLEXTERN void ( *pengine2d_DelEmitter )( int ID );
 ZGLEXTERN void ( *pengine2d_ClearAll )();
 ZGLEXTERN void ( *pengine2d_ClearAll )();
 ZGLEXTERN zglPEmitter2D ( *emitter2d_Add )();
 ZGLEXTERN zglPEmitter2D ( *emitter2d_Add )();
@@ -1792,7 +1800,11 @@ bool zglLoad( const char* LibraryName )
     zglGetAddress( pengine2d_Get, zglLib, "pengine2d_Get" );
     zglGetAddress( pengine2d_Get, zglLib, "pengine2d_Get" );
     zglGetAddress( pengine2d_Draw, zglLib, "pengine2d_Draw" );
     zglGetAddress( pengine2d_Draw, zglLib, "pengine2d_Draw" );
     zglGetAddress( pengine2d_Proc, zglLib, "pengine2d_Proc" );
     zglGetAddress( pengine2d_Proc, zglLib, "pengine2d_Proc" );
+#ifdef __CPP__
+	zglGetAddress( __pengine2d_AddEmitter, zglLib, "pengine2d_AddEmitter" );
+#else
     zglGetAddress( pengine2d_AddEmitter, zglLib, "pengine2d_AddEmitter" );
     zglGetAddress( pengine2d_AddEmitter, zglLib, "pengine2d_AddEmitter" );
+#endif
     zglGetAddress( pengine2d_DelEmitter, zglLib, "pengine2d_DelEmitter" );
     zglGetAddress( pengine2d_DelEmitter, zglLib, "pengine2d_DelEmitter" );
     zglGetAddress( pengine2d_ClearAll, zglLib, "pengine2d_ClearAll" );
     zglGetAddress( pengine2d_ClearAll, zglLib, "pengine2d_ClearAll" );
     zglGetAddress( emitter2d_Add, zglLib, "emitter2d_Add" );
     zglGetAddress( emitter2d_Add, zglLib, "emitter2d_Add" );
@@ -1893,10 +1905,10 @@ bool zglLoad( const char* LibraryName )
     zglGetAddress( col2d_CircleInCircle, zglLib, "col2d_CircleInCircle" );
     zglGetAddress( col2d_CircleInCircle, zglLib, "col2d_CircleInCircle" );
     zglGetAddress( col2d_CircleInRect, zglLib, "col2d_CircleInRect" );
     zglGetAddress( col2d_CircleInRect, zglLib, "col2d_CircleInRect" );
 
 
-    zglGetAddress( file_Open, zglLib, "file_Open" );
-    zglGetAddress( file_MakeDir, zglLib, "file_MakeDir" );
-    zglGetAddress( file_Remove, zglLib, "file_Remove" );
-    zglGetAddress( file_Exists, zglLib, "file_Exists" );
+    zglGetAddress( file_Open, zglLib, "_file_Open" );
+    zglGetAddress( file_MakeDir, zglLib, "_file_MakeDir" );
+    zglGetAddress( file_Remove, zglLib, "_file_Remove" );
+    zglGetAddress( file_Exists, zglLib, "_file_Exists" );
     zglGetAddress( file_Seek, zglLib, "file_Seek" );
     zglGetAddress( file_Seek, zglLib, "file_Seek" );
     zglGetAddress( file_GetPos, zglLib, "file_GetPos" );
     zglGetAddress( file_GetPos, zglLib, "file_GetPos" );
     zglGetAddress( file_Read, zglLib, "file_Read" );
     zglGetAddress( file_Read, zglLib, "file_Read" );
@@ -1908,7 +1920,7 @@ bool zglLoad( const char* LibraryName )
     zglGetAddress( file_GetName, zglLib, "file_GetName" );
     zglGetAddress( file_GetName, zglLib, "file_GetName" );
     zglGetAddress( file_GetExtension, zglLib, "file_GetExtension" );
     zglGetAddress( file_GetExtension, zglLib, "file_GetExtension" );
     zglGetAddress( file_GetDirectory, zglLib, "file_GetDirectory" );
     zglGetAddress( file_GetDirectory, zglLib, "file_GetDirectory" );
-    zglGetAddress( file_SetPath, zglLib, "file_SetPath" );
+    zglGetAddress( file_SetPath, zglLib, "_file_SetPath" );
 
 
     zglGetAddress( file_OpenArchive, zglLib, "_file_OpenArchive" );
     zglGetAddress( file_OpenArchive, zglLib, "_file_OpenArchive" );
     zglGetAddress( file_CloseArchive, zglLib, "file_CloseArchive" );
     zglGetAddress( file_CloseArchive, zglLib, "file_CloseArchive" );

+ 2 - 2
headers/zglHeader.pas

@@ -2,8 +2,8 @@
 {-----------= ZenGL =------------}
 {-----------= ZenGL =------------}
 {--------------------------------}
 {--------------------------------}
 {                                }
 {                                }
-{ version:  0.3.3                }
-{ date:     2012.09.09           }
+{ version:  0.3.4                }
+{ date:     2012.09.19           }
 { license:  GNU LGPL version 3   }
 { license:  GNU LGPL version 3   }
 { homepage: http://zengl.org     }
 { homepage: http://zengl.org     }
 {                                }
 {                                }

+ 4 - 2
src/Lazarus/ZenGL-win.lpi

@@ -16,9 +16,9 @@
     <VersionInfo>
     <VersionInfo>
       <UseVersionInfo Value="True"/>
       <UseVersionInfo Value="True"/>
       <MinorVersionNr Value="3"/>
       <MinorVersionNr Value="3"/>
-      <RevisionNr Value="3"/>
+      <RevisionNr Value="4"/>
       <CharSet Value="04B0"/>
       <CharSet Value="04B0"/>
-      <StringTable CompanyName="Kemka Andrey aka Andru" FileDescription="Cross-platform game development library" InternalName="ZenGL" LegalCopyright="Kemka Andrey aka Andru" OriginalFilename="ZenGL" ProductName="ZenGL" ProductVersion="0.3.3"/>
+      <StringTable CompanyName="Kemka Andrey aka Andru" FileDescription="Cross-platform game development library" InternalName="ZenGL" LegalCopyright="Kemka Andrey aka Andru" OriginalFilename="ZenGL" ProductName="ZenGL" ProductVersion="0.3.4"/>
     </VersionInfo>
     </VersionInfo>
     <BuildModes Count="4">
     <BuildModes Count="4">
       <Item1 Name="Release" Default="True"/>
       <Item1 Name="Release" Default="True"/>
@@ -467,6 +467,8 @@
     </Parsing>
     </Parsing>
     <CodeGeneration>
     <CodeGeneration>
       <SmartLinkUnit Value="True"/>
       <SmartLinkUnit Value="True"/>
+      <TargetCPU Value="i386"/>
+      <TargetOS Value="win32"/>
       <Optimizations>
       <Optimizations>
         <OptimizationLevel Value="3"/>
         <OptimizationLevel Value="3"/>
       </Optimizations>
       </Optimizations>

+ 6 - 2
src/ZenGL.pas

@@ -467,10 +467,14 @@ exports
   {$IFDEF USE_VIDEO}
   {$IFDEF USE_VIDEO}
   ,
   ,
   _video_OpenFile          name prefix + '_video_OpenFile',
   _video_OpenFile          name prefix + '_video_OpenFile',
-  _video_OpenMemory        name prefix + '_video_OpenMemory'
+  _video_OpenMemory        name prefix + '_video_OpenMemory',
   {$ENDIF}
   {$ENDIF}
+  _file_Open               name prefix + '_file_Open',
+  _file_MakeDir            name prefix + '_file_MakeDir',
+  _file_Remove             name prefix + '_file_Remove',
+  _file_Exists             name prefix + '_file_Exists',
+  _file_SetPath            name prefix + '_file_SetPath',
   {$IFDEF USE_ZIP}
   {$IFDEF USE_ZIP}
-  ,
   _file_OpenArchive
   _file_OpenArchive
   {$ENDIF}
   {$ENDIF}
   {$ENDIF}
   {$ENDIF}

BIN
src/ZenGL.res


+ 31 - 0
src/zgl_export_c.pas

@@ -80,6 +80,12 @@ function _video_OpenFile( FileName : PAnsiChar ) : zglPVideoStream;
 function _video_OpenMemory( Memory : zglTMemory; Extension : PAnsiChar ) : zglPVideoStream;
 function _video_OpenMemory( Memory : zglTMemory; Extension : PAnsiChar ) : zglPVideoStream;
 {$ENDIF}
 {$ENDIF}
 
 
+function _file_Open( out FileHandle : zglTFile; const FileName : PAnsiChar; Mode : Byte ) : Boolean;
+function _file_MakeDir( const Directory : PAnsiChar ) : Boolean;
+function _file_Remove( const Name : PAnsiChar ) : Boolean;
+function _file_Exists( const Name : PAnsiChar ) : Boolean;
+procedure _file_SetPath( const Path : PAnsiChar );
+
 {$IFDEF USE_ZIP}
 {$IFDEF USE_ZIP}
 function _file_OpenArchive( FileName : PAnsiChar; Password : PAnsiChar = '' ) : Boolean;
 function _file_OpenArchive( FileName : PAnsiChar; Password : PAnsiChar = '' ) : Boolean;
 {$ENDIF}
 {$ENDIF}
@@ -192,6 +198,31 @@ begin
 end;
 end;
 {$ENDIF}
 {$ENDIF}
 
 
+function _file_Open( out FileHandle : zglTFile; const FileName : PAnsiChar; Mode : Byte ) : Boolean;
+begin
+  Result := file_Open( FileHandle, FileName, Mode );
+end;
+
+function _file_MakeDir( const Directory : PAnsiChar ) : Boolean;
+begin
+  Result := file_MakeDir( Directory );
+end;
+
+function _file_Remove( const Name : PAnsiChar ) : Boolean;
+begin
+  Result := file_Remove( Name );
+end;
+
+function _file_Exists( const Name : PAnsiChar ) : Boolean;
+begin
+  Result := file_Exists( Name );
+end;
+
+procedure _file_SetPath( const Path : PAnsiChar );
+begin
+  file_SetPath( Path );
+end;
+
 {$IFDEF USE_ZIP}
 {$IFDEF USE_ZIP}
 function _file_OpenArchive( FileName : PAnsiChar; Password : PAnsiChar = '' ) : Boolean;
 function _file_OpenArchive( FileName : PAnsiChar; Password : PAnsiChar = '' ) : Boolean;
 begin
 begin

+ 3 - 3
src/zgl_main.pas

@@ -45,11 +45,11 @@ uses
   zgl_types;
   zgl_types;
 
 
 const
 const
-  cs_ZenGL    = 'ZenGL 0.3.3';
-  cs_Date     = '2012.09.09';
+  cs_ZenGL    = 'ZenGL 0.3.4';
+  cs_Date     = '2012.09.19';
   cv_major    = 0;
   cv_major    = 0;
   cv_minor    = 3;
   cv_minor    = 3;
-  cv_revision = 3;
+  cv_revision = 4;
 
 
   // zgl_Reg
   // zgl_Reg
   SYS_APP_INIT           = $000001;
   SYS_APP_INIT           = $000001;