agate-svn-commit Mailing List for AgateLib (Page 18)
Status: Alpha
Brought to you by:
kanato
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
(86) |
May
(77) |
Jun
|
Jul
(1) |
Aug
(31) |
Sep
(12) |
Oct
(31) |
Nov
(53) |
Dec
(39) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(53) |
Feb
(14) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(7) |
Dec
(13) |
| 2011 |
Jan
(17) |
Feb
(5) |
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
(21) |
Dec
|
| 2012 |
Jan
(6) |
Feb
(14) |
Mar
(5) |
Apr
(4) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
(1) |
Feb
(8) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
(5) |
Nov
(9) |
Dec
(5) |
| 2014 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(3) |
May
|
Jun
(5) |
Jul
(33) |
Aug
(69) |
Sep
(35) |
Oct
(4) |
Nov
(1) |
Dec
|
|
From: <ka...@us...> - 2009-11-23 23:02:17
|
Revision: 1112
http://agate.svn.sourceforge.net/agate/?rev=1112&view=rev
Author: kanato
Date: 2009-11-23 23:02:00 +0000 (Mon, 23 Nov 2009)
Log Message:
-----------
Merge in shaders branch.
Modified Paths:
--------------
trunk/AgateLib/AgateLib.csproj
trunk/AgateLib/AgateSetup.cs
trunk/AgateLib/Core.cs
trunk/AgateLib/DisplayLib/Display.cs
trunk/AgateLib/DisplayLib/DisplayCapsInfo.cs
trunk/AgateLib/DisplayLib/DisplayWindow.cs
trunk/AgateLib/DisplayLib/PrimitiveType.cs
trunk/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs
trunk/AgateLib/Drivers/AgateSandBoxLoader.cs
trunk/AgateLib/Drivers/Registrar.cs
trunk/AgateLib/Geometry/Matrix4x4.cs
trunk/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs
trunk/AgateLib/ImplementationBase/DisplayImpl.cs
trunk/AgateLib/InternalResources/Data.cs
trunk/AgateLib/Meshes/Loaders/OBJFileRepresentation.cs
trunk/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs
trunk/AgateLib/Meshes/Loaders/Obj/Parser.cs
trunk/AgateLib/Meshes/Loaders/Obj/TokenTypes.cs
trunk/AgateLib-Windows.sln
trunk/AgateLib.sln
trunk/Drivers/AgateDrawing/AgateDrawing.csproj
trunk/Drivers/AgateDrawing/Drawing_Display.cs
trunk/Drivers/AgateDrawing/Drawing_DisplayWindow.cs
trunk/Drivers/AgateDrawing/Drawing_FontSurface.cs
trunk/Drivers/AgateDrawing/Drawing_IRenderTarget.cs
trunk/Drivers/AgateDrawing/Drawing_Reporter.cs
trunk/Drivers/AgateDrawing/Drawing_Surface.cs
trunk/Drivers/AgateFMOD/AgateFMOD.csproj
trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj
trunk/Drivers/AgateOTK/AL_Audio.cs
trunk/Drivers/AgateOTK/AgateOTK.csproj
trunk/Drivers/AgateOTK/ArbShader.cs
trunk/Drivers/AgateOTK/ArbShaderCompiler.cs
trunk/Drivers/AgateOTK/GLDrawBuffer.cs
trunk/Drivers/AgateOTK/GLState.cs
trunk/Drivers/AgateOTK/GL_Display.cs
trunk/Drivers/AgateOTK/GL_DisplayControl.cs
trunk/Drivers/AgateOTK/GL_GameWindow.cs
trunk/Drivers/AgateOTK/GL_IRenderTarget.cs
trunk/Drivers/AgateOTK/GL_IndexBuffer.cs
trunk/Drivers/AgateOTK/GL_Surface.cs
trunk/Drivers/AgateOTK/GL_VertexBuffer.cs
trunk/Drivers/AgateOTK/GlslShader.cs
trunk/Drivers/AgateOTK/GlslShaderCompiler.cs
trunk/Drivers/AgateOTK/OpenTK.dll
trunk/Drivers/AgateOTK/OpenTK.dll.config
trunk/Drivers/AgateOTK/OpenTK.xml
trunk/Drivers/AgateOTK/Otk_Reporter.cs
trunk/Drivers/AgateSDL/AgateSDL.csproj
trunk/Drivers/AgateSDX/AgateSDX.csproj
trunk/Drivers/AgateSDX/D3DDevice.cs
trunk/Drivers/AgateSDX/HlslEffect.cs
trunk/Drivers/AgateSDX/SDX_Display.cs
trunk/TODO.txt
trunk/Tests/Shaders/Hlsl.cs
trunk/Tests/Shaders/LightingTest/LightingTest.cs
trunk/Tests/Tests.csproj
trunk/Tests/frmLauncher.Designer.cs
trunk/Tests/frmLauncher.cs
trunk/Tools/FontCreator/CreateFont.Designer.cs
trunk/Tools/FontCreator/FontCreator.csproj
trunk/Tools/NotebookLib/NotebookLib/NotebookLib.csproj
trunk/Tools/PackedSpriteCreator/PackedSpriteCreator.csproj
trunk/Tools/ResourceEditor/ResourceEditor.csproj
Added Paths:
-----------
trunk/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs
trunk/AgateLib/DisplayLib/Shaders/AgateShader.cs
trunk/AgateLib/DisplayLib/Shaders/Basic2DShader.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/
trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateInternalShader.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/Basic2DImpl.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderProgram.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs
trunk/AgateLib/DisplayLib/Shaders/Lighting2D.cs
trunk/AgateLib/DisplayLib/Shaders/Lighting3D.cs
trunk/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs
trunk/AgateLib/Platform.cs
trunk/AgateLib/PlatformType.cs
trunk/Drivers/AgateDrawing/DrawingBasic2DShader.cs
trunk/Drivers/AgateOTK/GeoHelper.cs
trunk/Drivers/AgateOTK/OpenTK.Compatibility.dll
trunk/Drivers/AgateOTK/OpenTK.Compatibility.dll.config
trunk/Drivers/AgateOTK/OpenTK.Compatibility.xml
trunk/Drivers/AgateOTK/Shaders/
trunk/Drivers/AgateOTK/Shaders/FixedFunction/
trunk/Drivers/AgateOTK/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
trunk/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs
trunk/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting2D.cs
trunk/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs
trunk/Drivers/AgateOTK/Shaders/ShaderFactory.cs
trunk/Drivers/AgateSDX/GeoHelper.cs
trunk/Drivers/AgateSDX/Shaders/
trunk/Drivers/AgateSDX/Shaders/FixedFunction/
trunk/Drivers/AgateSDX/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
trunk/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs
trunk/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs
trunk/Drivers/AgateSDX/Shaders/ShaderFactory.cs
trunk/Tests/CoreTests/PlatformDetection/
trunk/Tests/CoreTests/PlatformDetection/PlatformDetection.Designer.cs
trunk/Tests/CoreTests/PlatformDetection/PlatformDetection.cs
trunk/Tests/CoreTests/PlatformDetection/PlatformDetection.resx
trunk/Tests/CoreTests/PlatformDetection/PlatformDetector.cs
trunk/Tests/DisplayTests/ClipRect.cs
trunk/Tests/Shaders/CoordinateSystem.cs
trunk/Tests/Shaders/Lighting3DTest.cs
Removed Paths:
-------------
trunk/AgateLib/DisplayLib/Light.cs
trunk/AgateLib/DisplayLib/LightManager.cs
trunk/AgateLib/DisplayLib/Shaders/Effect.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateInternalShader.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/Basic2DImpl.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderProgram.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs
trunk/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs
trunk/AgateLib/DisplayLib/Shaders/ShaderCompiler.cs
trunk/AgateLib/DisplayLib/Shaders/ShaderLanguage.cs
trunk/AgateLib/DisplayLib/Shaders/ShaderProgram.cs
trunk/AgateLib/DisplayLib/Shaders/Technique.cs
trunk/AgateLib/DisplayLib/Shaders/UniformState.cs
trunk/Drivers/AgateOTK/OpenTK.Utilities.dll
trunk/Drivers/AgateOTK/OpenTK.Utilities.dll.config
trunk/Drivers/AgateOTK/OpenTK.Utilities.xml
trunk/Drivers/AgateOTK/Shaders/FixedFunction/
trunk/Drivers/AgateOTK/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
trunk/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs
trunk/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting2D.cs
trunk/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs
trunk/Drivers/AgateOTK/Shaders/ShaderFactory.cs
trunk/Drivers/AgateSDX/Shaders/FixedFunction/
trunk/Drivers/AgateSDX/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
trunk/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs
trunk/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs
trunk/Drivers/AgateSDX/Shaders/ShaderFactory.cs
trunk/Tests/CoreTests/PlatformDetection/PlatformDetection.Designer.cs
trunk/Tests/CoreTests/PlatformDetection/PlatformDetection.cs
trunk/Tests/CoreTests/PlatformDetection/PlatformDetection.resx
trunk/Tests/CoreTests/PlatformDetection/PlatformDetector.cs
trunk/Tests/DisplayTests/Ortho.cs
Property Changed:
----------------
trunk/
trunk/AgateLib/
trunk/AgateLib/AgateFileProvider.cs
trunk/AgateLib/AgateSetup.cs
trunk/AgateLib/AudioLib/
trunk/AgateLib/AudioLib/Audio.cs
trunk/AgateLib/BitmapFont/FontMetrics.cs
trunk/AgateLib/BitmapFont/GlyphMetrics.cs
trunk/AgateLib/Core.cs
trunk/AgateLib/DisplayLib/
trunk/AgateLib/DisplayLib/Display.cs
trunk/AgateLib/DisplayLib/StringTransformer.cs
trunk/AgateLib/Drivers/AgateDriverReporter.cs
trunk/AgateLib/Drivers/IDesktopDriver.cs
trunk/AgateLib/ImplementationBase/
trunk/AgateLib/ImplementationBase/AudioImpl.cs
trunk/AgateLib/InputLib/
trunk/AgateLib/Meshes/Loaders/OBJFileRepresentation.cs
trunk/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs
trunk/AgateLib/Meshes/Loaders/Obj/TokenTypes.cs
trunk/AgateLib/Resources/AgateResourceCollection.cs
trunk/AgateLib/Resources/AgateResourceLoader.cs
trunk/AgateLib/Resources/BitmapFontResource.cs
trunk/AgateLib/Sprites/Sprite.cs
trunk/AgateLib/Sprites/SpriteFrame.cs
trunk/AgateLib/Timing.cs
trunk/AgateLib/Utility/Platform.cs
trunk/Drivers/
trunk/Drivers/AgateDrawing/Drawing_Reporter.cs
trunk/Drivers/AgateLib.WinForms/
trunk/Drivers/AgateSDL/
trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs
trunk/Drivers/AgateSDL/Audio/SDL_Music.cs
trunk/Drivers/AgateSDL/Audio/SDL_SoundBuffer.cs
trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs
trunk/Drivers/AgateSDL/Input/SDL_Input.cs
trunk/Drivers/AgateSDL/Reporter.cs
trunk/Examples/BallBuster.Net/OpenTK.dll.config
trunk/Examples/ShootTheTraps/Properties/
trunk/Examples/ShootTheTraps/Properties/AssemblyInfo.cs
trunk/Tests/CoreTests/
trunk/Tests/DisplayTests/SurfaceTester/SurfaceTester.cs
trunk/Tests/DisplayTests/TestPacker/TestPacker.cs
trunk/Tests/DisplayTests/TestPacker/frmTestPacker.Designer.cs
trunk/Tests/DisplayTests/TestPacker/frmTestPacker.cs
trunk/Tests/DisplayTests/TestPacker/frmTestPacker.resx
trunk/Tests/DisplayTests/TileTester/TileTester.cs
trunk/Tests/DisplayTests/TileTester/frmTileTester.Designer.cs
trunk/Tests/DisplayTests/TileTester/frmTileTester.cs
trunk/Tests/DisplayTests/TileTester/frmTileTester.resx
trunk/Tests/InputTests/Input/
trunk/Tests/InputTests/Input/InputTester.cs
trunk/Tests/InputTests/Input/frmInputTester.Designer.cs
trunk/Tests/InputTests/Input/frmInputTester.cs
trunk/Tests/InputTests/InputState/
trunk/Tests/InputTests/InputState/InputStateTester.cs
trunk/Tools/FontCreator/CreateFont.Designer.cs
trunk/Tools/FontCreator/CreateFont.cs
trunk/Tools/FontCreator/CreateFont.resx
trunk/Tools/FontCreator/EditGlyphs.Designer.cs
trunk/Tools/FontCreator/EditGlyphs.cs
trunk/Tools/FontCreator/EditGlyphs.resx
trunk/Tools/FontCreator/SaveFont.Designer.cs
trunk/Tools/FontCreator/SaveFont.cs
trunk/Tools/FontCreator/SaveFont.resx
trunk/Tools/FontCreator/frmFontCreator.Designer.cs
trunk/Tools/FontCreator/frmFontCreator.cs
trunk/Tools/FontCreator/frmFontCreator.resx
trunk/Tools/PackedSpriteCreator/SpriteEditor.Designer.cs
trunk/Tools/PackedSpriteCreator/SpriteEditor.cs
trunk/Tools/PackedSpriteCreator/SpriteEditor.resx
trunk/Tools/PackedSpriteCreator/SpritePacker.cs
Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d:629-702,840-864
/branches/agate3d-3.2:923-1034
/branches/build:424-517,1081-1084
/branches/font:778-916
/branches/merge-tests:806-810
/branches/registrar:595-599
/branches/sprites:463-513
+ /branches/agate-3d:629-702,840-864
/branches/agate3d-3.2:923-1034
/branches/build:424-517,1081-1084
/branches/font:778-916
/branches/merge-tests:806-810
/branches/otkupdate:1068-1076
/branches/registrar:595-599
/branches/shaders:1087-1111
/branches/sprites:463-513
Property changes on: trunk/AgateLib
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib:629-702,840-864
/branches/agate3d-3.2/AgateLib:923-1034
/branches/build/AgateLib:447-448,501-517,1081-1084
/branches/font/AgateLib:778-916
/branches/merge-tests/AgateLib:806-810
/branches/registrar/AgateLib:595-599
/branches/sprites/AgateLib:463-513
+ /branches/agate-3d/AgateLib:629-702,840-864
/branches/agate3d-3.2/AgateLib:923-1034
/branches/build/AgateLib:447-448,501-517,1081-1084
/branches/font/AgateLib:778-916
/branches/merge-tests/AgateLib:806-810
/branches/otkupdate/AgateLib:1068-1076
/branches/registrar/AgateLib:595-599
/branches/shaders/AgateLib:1087-1111
/branches/sprites/AgateLib:463-513
Property changes on: trunk/AgateLib/AgateFileProvider.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate3d-3.2/AgateLib/AgateFileProvider.cs:923-1034
/branches/build/AgateLib/AgateFileProvider.cs:1081-1084
/branches/build/AgateLib/Utility/AgateFileProvider.cs:447-517
/branches/font/AgateLib/AgateFileProvider.cs:778-916
/branches/merge-tests/AgateLib/AgateFileProvider.cs:806-810
/branches/registrar/AgateLib/Utility/AgateFileProvider.cs:595-599
/branches/sprites/AgateLib/Utility/AgateFileProvider.cs:463-513
+ /branches/agate3d-3.2/AgateLib/AgateFileProvider.cs:923-1034
/branches/build/AgateLib/AgateFileProvider.cs:1081-1084
/branches/build/AgateLib/Utility/AgateFileProvider.cs:447-517
/branches/font/AgateLib/AgateFileProvider.cs:778-916
/branches/merge-tests/AgateLib/AgateFileProvider.cs:806-810
/branches/otkupdate/AgateLib/AgateFileProvider.cs:1068-1076
/branches/registrar/AgateLib/Utility/AgateFileProvider.cs:595-599
/branches/shaders/AgateLib/AgateFileProvider.cs:1087-1111
/branches/sprites/AgateLib/Utility/AgateFileProvider.cs:463-513
Modified: trunk/AgateLib/AgateLib.csproj
===================================================================
--- trunk/AgateLib/AgateLib.csproj 2009-11-23 21:19:16 UTC (rev 1111)
+++ trunk/AgateLib/AgateLib.csproj 2009-11-23 23:02:00 UTC (rev 1112)
@@ -1,12 +1,13 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<ProjectType>Local</ProjectType>
- <ProductVersion>9.0.21022</ProductVersion>
+ <ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{BED5DD5D-13C6-4BA4-80DC-A47478E74F84}</ProjectGuid>
+ <ProjectGuid>{9490B719-829E-43A7-A5FE-8001F8A81759}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ApplicationIcon></ApplicationIcon>
+ <ApplicationIcon>
+ </ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>AgateLib</AssemblyName>
@@ -16,9 +17,11 @@
<DelaySign>false</DelaySign>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<OutputType>Library</OutputType>
- <AppDesignerFolder></AppDesignerFolder>
+ <AppDesignerFolder>
+ </AppDesignerFolder>
<RootNamespace>AgateLib</RootNamespace>
- <StartupObject></StartupObject>
+ <StartupObject>
+ </StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
@@ -29,7 +32,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE;</DefineConstants>
- <DocumentationFile></DocumentationFile>
+ <DocumentationFile>
+ </DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
@@ -38,7 +42,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
- <NoWarn></NoWarn>
+ <NoWarn>
+ </NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
@@ -56,17 +61,19 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
- <NoWarn></NoWarn>
+ <NoWarn>
+ </NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
- <Name>System</Name>
+ <Name>System</Name>
</Reference>
<Reference Include="System.Core">
- <Name>System.Core</Name>
+ <Name>System.Core</Name>
</Reference>
+ <Reference Include="System.Data" />
<Reference Include="System.Xml">
- <Name>System.Xml</Name>
+ <Name>System.Xml</Name>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -90,9 +97,23 @@
<Compile Include="Core.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="DisplayLib\Shaders\AgateBuiltInShaders.cs" />
+ <Compile Include="DisplayLib\Shaders\Basic2DShader.cs" />
+ <Compile Include="DisplayLib\Shaders\AgateShader.cs" />
+ <Compile Include="DisplayLib\Shaders\Implementation\AgateInternalShader.cs" />
+ <Compile Include="DisplayLib\Shaders\Implementation\AgateShaderImpl.cs" />
+ <Compile Include="DisplayLib\Shaders\Implementation\Basic2DImpl.cs" />
+ <Compile Include="DisplayLib\Shaders\Implementation\BuiltInShader.cs" />
+ <Compile Include="DisplayLib\Shaders\Implementation\Lighting2DImpl.cs" />
+ <Compile Include="DisplayLib\Shaders\Implementation\Lighting3DImpl.cs" />
+ <Compile Include="DisplayLib\Shaders\Lighting2D.cs" />
+ <Compile Include="DisplayLib\Shaders\Lighting3D.cs" />
+ <Compile Include="Geometry\VertexTypes\PositionTextureColorNormal.cs" />
<Compile Include="IFileProvider.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="Platform.cs" />
+ <Compile Include="PlatformType.cs" />
<Compile Include="Timing.cs">
<SubType>Code</SubType>
</Compile>
@@ -147,12 +168,6 @@
<Compile Include="DisplayLib\ISurface.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="DisplayLib\Light.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="DisplayLib\LightManager.cs">
- <SubType>Code</SubType>
- </Compile>
<Compile Include="DisplayLib\Origin.cs">
<SubType>Code</SubType>
</Compile>
@@ -195,25 +210,25 @@
<Compile Include="DisplayLib\Cache\SurfaceStateCache.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="DisplayLib\Shaders\AgateShaderCompileError.cs">
+ <Compile Include="DisplayLib\Shaders\Implementation\AgateShaderCompileError.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="DisplayLib\Shaders\Effect.cs">
+ <Compile Include="DisplayLib\Shaders\Implementation\Effect.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="DisplayLib\Shaders\ShaderCompiler.cs">
+ <Compile Include="DisplayLib\Shaders\Implementation\ShaderCompiler.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="DisplayLib\Shaders\ShaderLanguage.cs">
+ <Compile Include="DisplayLib\Shaders\Implementation\ShaderLanguage.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="DisplayLib\Shaders\ShaderProgram.cs">
+ <Compile Include="DisplayLib\Shaders\Implementation\ShaderProgram.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="DisplayLib\Shaders\Technique.cs">
+ <Compile Include="DisplayLib\Shaders\Implementation\Technique.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="DisplayLib\Shaders\UniformState.cs">
+ <Compile Include="DisplayLib\Shaders\Implementation\UniformState.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Drivers\AgateDriverInfo.cs">
@@ -415,9 +430,6 @@
<Compile Include="Particles\Particles\SurfaceParticle.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="PlatformSpecific\IPlatformServices.cs">
- <SubType>Code</SubType>
- </Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
@@ -496,9 +508,6 @@
<Compile Include="Utility\FileSystemProvider.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="Utility\Platform.cs">
- <SubType>Code</SubType>
- </Compile>
<Compile Include="Utility\Ref.cs">
<SubType>Code</SubType>
</Compile>
@@ -524,4 +533,4 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
-</Project>
+</Project>
\ No newline at end of file
Modified: trunk/AgateLib/AgateSetup.cs
===================================================================
--- trunk/AgateLib/AgateSetup.cs 2009-11-23 21:19:16 UTC (rev 1111)
+++ trunk/AgateLib/AgateSetup.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -170,6 +170,7 @@
/// Automatically selects the driver to use, or asks the user which
/// driver to use if appropriate.
/// </summary>
+ [Obsolete("Use Initialize(bool, bool, bool) overload instead.")]
public void InitializeDisplay()
{
DoAskUser();
@@ -191,6 +192,7 @@
/// Initializes the Audio subsystem.
/// Automatically picks which driver to use.
/// </summary>
+ [Obsolete("Use Initialize(bool, bool, bool) overload instead.")]
public void InitializeAudio()
{
DoAskUser();
@@ -212,6 +214,7 @@
/// Initializes the Input subsystem.
/// Automatically picks which driver to use.
/// </summary>
+ [Obsolete("Use Initialize(bool, bool, bool) overload instead.")]
public void InitializeInput()
{
DoAskUser();
Property changes on: trunk/AgateLib/AgateSetup.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/AgateSetup.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/AgateSetup.cs:923-1034
/branches/build/AgateLib/AgateSetup.cs:501-517,1081-1084
/branches/font/AgateLib/AgateSetup.cs:778-916
/branches/merge-tests/AgateLib/AgateSetup.cs:806-810
/branches/registrar/AgateLib/AgateSetup.cs:595-599
/branches/sprites/AgateLib/AgateSetup.cs:463-513
+ /branches/agate-3d/AgateLib/AgateSetup.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/AgateSetup.cs:923-1034
/branches/build/AgateLib/AgateSetup.cs:501-517,1081-1084
/branches/font/AgateLib/AgateSetup.cs:778-916
/branches/merge-tests/AgateLib/AgateSetup.cs:806-810
/branches/otkupdate/AgateLib/AgateSetup.cs:1068-1076
/branches/registrar/AgateLib/AgateSetup.cs:595-599
/branches/shaders/AgateLib/AgateSetup.cs:1087-1111
/branches/sprites/AgateLib/AgateSetup.cs:463-513
Property changes on: trunk/AgateLib/AudioLib
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/AudioLib:629-702,840-864
/branches/agate3d-3.2/AgateLib/AudioLib:923-1034
/branches/build/AgateLib/AudioLib:1081-1084
/branches/font/AgateLib/AudioLib:778-916
/branches/merge-tests/AgateLib/AudioLib:806-810
/branches/registrar/AgateLib/AudioLib:595-599
/branches/sprites/AgateLib/AudioLib:463-513
+ /branches/agate-3d/AgateLib/AudioLib:629-702,840-864
/branches/agate3d-3.2/AgateLib/AudioLib:923-1034
/branches/build/AgateLib/AudioLib:1081-1084
/branches/font/AgateLib/AudioLib:778-916
/branches/merge-tests/AgateLib/AudioLib:806-810
/branches/otkupdate/AgateLib/AudioLib:1068-1076
/branches/registrar/AgateLib/AudioLib:595-599
/branches/shaders/AgateLib/AudioLib:1087-1111
/branches/sprites/AgateLib/AudioLib:463-513
Property changes on: trunk/AgateLib/AudioLib/Audio.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/AudioLib/Audio.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/AudioLib/Audio.cs:923-1034
/branches/build/AgateLib/AudioLib/Audio.cs:501-517,1081-1084
/branches/font/AgateLib/AudioLib/Audio.cs:778-916
/branches/merge-tests/AgateLib/AudioLib/Audio.cs:806-810
/branches/registrar/AgateLib/AudioLib/Audio.cs:595-599
/branches/sprites/AgateLib/AudioLib/Audio.cs:463-513
+ /branches/agate-3d/AgateLib/AudioLib/Audio.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/AudioLib/Audio.cs:923-1034
/branches/build/AgateLib/AudioLib/Audio.cs:501-517,1081-1084
/branches/font/AgateLib/AudioLib/Audio.cs:778-916
/branches/merge-tests/AgateLib/AudioLib/Audio.cs:806-810
/branches/otkupdate/AgateLib/AudioLib/Audio.cs:1068-1076
/branches/registrar/AgateLib/AudioLib/Audio.cs:595-599
/branches/shaders/AgateLib/AudioLib/Audio.cs:1087-1111
/branches/sprites/AgateLib/AudioLib/Audio.cs:463-513
Property changes on: trunk/AgateLib/BitmapFont/FontMetrics.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/BitmapFont/FontMetrics.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/BitmapFont/FontMetrics.cs:923-1034
/branches/build/AgateLib/BitmapFont/FontMetrics.cs:1081-1084
/branches/font/AgateLib/BitmapFont/FontMetrics.cs:778-916
/branches/merge-tests/AgateLib/BitmapFont/FontMetrics.cs:806-810
+ /branches/agate-3d/AgateLib/BitmapFont/FontMetrics.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/BitmapFont/FontMetrics.cs:923-1034
/branches/build/AgateLib/BitmapFont/FontMetrics.cs:1081-1084
/branches/font/AgateLib/BitmapFont/FontMetrics.cs:778-916
/branches/merge-tests/AgateLib/BitmapFont/FontMetrics.cs:806-810
/branches/otkupdate/AgateLib/BitmapFont/FontMetrics.cs:1068-1076
/branches/shaders/AgateLib/BitmapFont/FontMetrics.cs:1087-1111
Property changes on: trunk/AgateLib/BitmapFont/GlyphMetrics.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/BitmapFont/GlyphMetrics.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/BitmapFont/GlyphMetrics.cs:923-1034
/branches/build/AgateLib/BitmapFont/GlyphMetrics.cs:1081-1084
/branches/build/AgateLib/Resources/GlyphMetrics.cs:447-517
/branches/font/AgateLib/BitmapFont/GlyphMetrics.cs:778-916
/branches/merge-tests/AgateLib/BitmapFont/GlyphMetrics.cs:806-810
/branches/registrar/AgateLib/Resources/GlyphMetrics.cs:595-599
/branches/sprites/AgateLib/Resources/GlyphMetrics.cs:463-513
+ /branches/agate-3d/AgateLib/BitmapFont/GlyphMetrics.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/BitmapFont/GlyphMetrics.cs:923-1034
/branches/build/AgateLib/BitmapFont/GlyphMetrics.cs:1081-1084
/branches/build/AgateLib/Resources/GlyphMetrics.cs:447-517
/branches/font/AgateLib/BitmapFont/GlyphMetrics.cs:778-916
/branches/merge-tests/AgateLib/BitmapFont/GlyphMetrics.cs:806-810
/branches/otkupdate/AgateLib/BitmapFont/GlyphMetrics.cs:1068-1076
/branches/registrar/AgateLib/Resources/GlyphMetrics.cs:595-599
/branches/shaders/AgateLib/BitmapFont/GlyphMetrics.cs:1087-1111
/branches/sprites/AgateLib/Resources/GlyphMetrics.cs:463-513
Modified: trunk/AgateLib/Core.cs
===================================================================
--- trunk/AgateLib/Core.cs 2009-11-23 21:19:16 UTC (rev 1111)
+++ trunk/AgateLib/Core.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -24,7 +24,6 @@
using AgateLib.AudioLib;
using AgateLib.DisplayLib;
-using AgateLib.PlatformSpecific;
namespace AgateLib
{
@@ -90,6 +89,7 @@
private static bool mAutoPause = false;
private static bool mIsActive = true;
private static bool mInititalized = false;
+ private static Platform mPlatform;
#region --- Error Reporting ---
@@ -98,7 +98,6 @@
public static class ErrorReporting
{
-
private static string mErrorFile = "errorlog.txt";
private static bool mAutoStackTrace = false;
private static bool mWroteHeader = false;
@@ -214,7 +213,7 @@
filewriter.Write(text);
}
- Console.Write(text);
+ Trace.WriteLine(text);
}
/// <summary>
@@ -263,9 +262,8 @@
"Error message: " + e.Message + "\r\n" +
"Errors cannot be saved to a text file.";
- Console.WriteLine(message);
- System.Diagnostics.Debug.WriteLine(message);
- System.Diagnostics.Trace.WriteLine(message);
+ Debug.WriteLine(message);
+ Trace.WriteLine(message);
return null;
}
@@ -296,7 +294,7 @@
static Core()
{
-
+ mPlatform = new Platform();
}
/// <summary>
/// Initializes Core class.
@@ -309,11 +307,17 @@
Drivers.Registrar.Initialize();
- Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
mInititalized = true;
}
+ /// <summary>
+ /// Gets an object which describes details about the current platform.
+ /// </summary>
+ public static Platform Platform
+ {
+ get { return mPlatform; }
+ }
/// <summary>
/// Gets or sets a bool value which indicates whether or not your
@@ -412,5 +416,7 @@
{
return mTime.ElapsedMilliseconds;
}
+
+
}
}
\ No newline at end of file
Property changes on: trunk/AgateLib/Core.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/Core.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Core.cs:923-1034
/branches/build/AgateLib/Core.cs:501-517,1081-1084
/branches/font/AgateLib/Core.cs:778-916
/branches/merge-tests/AgateLib/Core.cs:806-810
/branches/registrar/AgateLib/Core.cs:595-599
/branches/sprites/AgateLib/Core.cs:463-513
+ /branches/agate-3d/AgateLib/Core.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Core.cs:923-1034
/branches/build/AgateLib/Core.cs:501-517,1081-1084
/branches/font/AgateLib/Core.cs:778-916
/branches/merge-tests/AgateLib/Core.cs:806-810
/branches/otkupdate/AgateLib/Core.cs:1068-1076
/branches/registrar/AgateLib/Core.cs:595-599
/branches/shaders/AgateLib/Core.cs:1087-1111
/branches/sprites/AgateLib/Core.cs:463-513
Property changes on: trunk/AgateLib/DisplayLib
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/DisplayLib:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib:923-1034
/branches/build/AgateLib/DisplayLib:1081-1084
/branches/font/AgateLib/DisplayLib:778-916
/branches/merge-tests/AgateLib/DisplayLib:806-810
/branches/registrar/AgateLib/DisplayLib:595-599
/branches/sprites/AgateLib/DisplayLib:463-513
+ /branches/agate-3d/AgateLib/DisplayLib:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib:923-1034
/branches/build/AgateLib/DisplayLib:1081-1084
/branches/font/AgateLib/DisplayLib:778-916
/branches/merge-tests/AgateLib/DisplayLib:806-810
/branches/otkupdate/AgateLib/DisplayLib:1068-1076
/branches/registrar/AgateLib/DisplayLib:595-599
/branches/shaders/AgateLib/DisplayLib:1087-1111
/branches/sprites/AgateLib/DisplayLib:463-513
Modified: trunk/AgateLib/DisplayLib/Display.cs
===================================================================
--- trunk/AgateLib/DisplayLib/Display.cs 2009-11-23 21:19:16 UTC (rev 1111)
+++ trunk/AgateLib/DisplayLib/Display.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -21,6 +21,7 @@
using System.IO;
using System.Text;
+using AgateLib.DisplayLib.Shaders;
using AgateLib.Drivers;
using AgateLib.Geometry;
using AgateLib.ImplementationBase;
@@ -64,6 +65,7 @@
private static Rectangle mCurrentClipRect;
private static Stack<Rectangle> mClipRects = new Stack<Rectangle>();
private static RenderStateAdapter mRenderState = new RenderStateAdapter();
+ private static DisplayCapsInfo mCapsInfo = new DisplayCapsInfo();
/// <summary>
/// Gets the object which handles all of the actual calls to Display functions.
@@ -94,8 +96,11 @@
impl.Initialize();
mSurfacePacker = new SurfacePacker();
+
+ Shaders.AgateBuiltInShaders.InitializeShaders();
}
+
public static RenderStateAdapter RenderState
{
get { return mRenderState; }
@@ -117,6 +122,8 @@
impl.Dispose();
impl = null;
}
+
+ Shaders.AgateBuiltInShaders.DisposeShaders();
}
internal static void ProcessEvents()
@@ -137,12 +144,19 @@
}
}
+ [Obsolete]
public static Shaders.Effect Effect
{
- get { return impl.Effect; }
- set { impl.Effect = value; }
+ get { return null; }
+ set { throw new Exception(); }
}
+ public static Shaders.AgateShader Shader
+ {
+ get { return impl.Shader; }
+ internal set { impl.Shader = value; }
+ }
+
/// <summary>
/// Delegate type for functions which are called when Display.Dispose is called
/// at the end of execution of the program.
@@ -282,7 +296,11 @@
throw new AgateException("The current window has been closed, and a new render target has not been set. A render target must be set to continue rendering.");
impl.BeginFrame();
- mCurrentClipRect = new Rectangle(0, 0, RenderTarget.Width, RenderTarget.Height);
+
+ AgateBuiltInShaders.Basic2DShader.CoordinateSystem = new Rectangle(Point.Empty, RenderTarget.Size);
+ AgateBuiltInShaders.Basic2DShader.Activate();
+
+ mCurrentClipRect = new Rectangle(Point.Empty, RenderTarget.Size);
}
/// <summary>
/// EndFrame must be called at the end of each frame.
@@ -350,7 +368,7 @@
/// </summary>
public static Size MaxSurfaceSize
{
- get { return impl.MaxSurfaceSize; }
+ get { return Caps.MaxSurfaceSize; }
}
/// <summary>
/// Gets the object which handles packing of all surfaces.
@@ -448,14 +466,11 @@
/// <param name="top"></param>
/// <param name="right"></param>
/// <param name="bottom"></param>
+ [Obsolete("Use a AgateBuiltInShaders.Basic2DShader.CoordinateSystem instead.", true)]
public static void SetOrthoProjection(int left, int top, int right, int bottom)
{
SetOrthoProjection(Rectangle.FromLTRB(left, top, right, bottom));
}
- public static Matrix4x4 GetOrthoProjection()
- {
- return Matrix4x4.Ortho(RectangleF.FromLTRB(0, 0, RenderTarget.Width, RenderTarget.Height), -1, 1);
- }
/// <summary>
/// Sets the orthogonal projection for rendering. This allows redefinition of the
@@ -472,9 +487,10 @@
/// the entire window.</para>
/// </remarks>
/// <param name="region"></param>
+ [Obsolete("Use a AgateBuiltInShaders.Basic2DShader.CoordinateSystem instead.", true)]
public static void SetOrthoProjection(Rectangle region)
{
- impl.SetOrthoProjection(region);
+ throw new NotImplementedException();
}
#region --- Drawing Functions ---
@@ -660,34 +676,14 @@
/// </summary>
public static DisplayCapsInfo Caps
{
- get { return impl.Caps; }
+ get { return mCapsInfo; }
}
- /// <summary>
- /// Turns lighting functions off.
- /// </summary>
- [Obsolete("Use shaders instead.")]
- public static void DisableLighting()
- {
- DoLighting(LightManager.Empty);
- }
-
- [Obsolete("Use shaders instead.")]
- internal static void DoLighting(LightManager lights)
- {
- impl.DoLighting(lights);
- }
-
internal static void SavePixelBuffer(PixelBuffer pixelBuffer, string filename, ImageFileFormat format)
{
impl.SavePixelBuffer(pixelBuffer, filename, format);
}
- internal static AgateLib.PlatformSpecific.IPlatformServices GetPlatformServices()
- {
- return impl.GetPlatformServices();
- }
-
internal static void HideCursor()
{
impl.HideCursor();
@@ -697,6 +693,7 @@
{
impl.ShowCursor();
}
+
}
}
Property changes on: trunk/AgateLib/DisplayLib/Display.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/DisplayLib/Display.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Display.cs:923-1034
/branches/build/AgateLib/DisplayLib/Display.cs:501-517,1081-1084
/branches/font/AgateLib/DisplayLib/Display.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Display.cs:806-810
/branches/registrar/AgateLib/DisplayLib/Display.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Display.cs:463-513
+ /branches/agate-3d/AgateLib/DisplayLib/Display.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Display.cs:923-1034
/branches/build/AgateLib/DisplayLib/Display.cs:501-517,1081-1084
/branches/font/AgateLib/DisplayLib/Display.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Display.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/Display.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/Display.cs:595-599
/branches/shaders/AgateLib/DisplayLib/Display.cs:1087-1111
/branches/sprites/AgateLib/DisplayLib/Display.cs:463-513
Modified: trunk/AgateLib/DisplayLib/DisplayCapsInfo.cs
===================================================================
--- trunk/AgateLib/DisplayLib/DisplayCapsInfo.cs 2009-11-23 21:19:16 UTC (rev 1111)
+++ trunk/AgateLib/DisplayLib/DisplayCapsInfo.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -2,11 +2,19 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using AgateLib.Geometry;
namespace AgateLib.DisplayLib
{
+ /// <summary>
+ /// Class which can be used to query information about what features are supported
+ /// by the display driver.
+ /// </summary>
public class DisplayCapsInfo
{
+ internal DisplayCapsInfo()
+ { }
+
/// <summary>
/// Indicates whether or not full screen windows can be created.
/// </summary>
@@ -94,9 +102,9 @@
/// <summary>
/// Indicates whether or not vertex/pixel shaders are supported.
/// </summary>
- public bool SupportsShaders
+ public bool SupportsCustomShaders
{
- get { return Display.Impl.Supports(DisplayBoolCaps.Shaders); }
+ get { return Display.Impl.Supports(DisplayBoolCaps.CustomShaders); }
}
/// <summary>
/// Indicates which shader language is supported.
@@ -113,8 +121,17 @@
{
get { return Display.Impl.Supports(DisplayBoolCaps.CanCreateBitmapFont); }
}
+
+ public Size MaxSurfaceSize
+ {
+ get { return Display.Impl.CapsSize(DisplaySizeCaps.MaxSurfaceSize); }
+ }
}
+ public enum DisplaySizeCaps
+ {
+ MaxSurfaceSize,
+ }
public enum DisplayBoolCaps
{
/// <summary>
@@ -166,7 +183,7 @@
/// <summary>
/// Indicates whether or not vertex/pixel shaders are supported.
/// </summary>
- Shaders,
+ CustomShaders,
/// <summary>
/// Indicates whether the driver can create a bitmap font from an operating
/// system font.
Modified: trunk/AgateLib/DisplayLib/DisplayWindow.cs
===================================================================
--- trunk/AgateLib/DisplayLib/DisplayWindow.cs 2009-11-23 21:19:16 UTC (rev 1111)
+++ trunk/AgateLib/DisplayLib/DisplayWindow.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -304,6 +304,11 @@
impl.SetFullScreen(width, height, bpp);
}
+ public Matrix4x4 OrthoProjection
+ {
+ get { return Matrix4x4.Ortho(new RectangleF(0, 0, Width, Height), -1, 1); }
+ }
+
#region --- IRenderTarget Members ---
IRenderTargetImpl IRenderTarget.Impl
Deleted: trunk/AgateLib/DisplayLib/Light.cs
===================================================================
--- trunk/AgateLib/DisplayLib/Light.cs 2009-11-23 21:19:16 UTC (rev 1111)
+++ trunk/AgateLib/DisplayLib/Light.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -1,160 +0,0 @@
-// The contents of this file are subject to the Mozilla Public License
-// Version 1.1 (the "License"); you may not use this file except in
-// compliance with the License. You may obtain a copy of the License at
-// http://www.mozilla.org/MPL/
-//
-// Software distributed under the License is distributed on an "AS IS"
-// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-// License for the specific language governing rights and limitations
-// under the License.
-//
-// The Original Code is AgateLib.
-//
-// The Initial Developer of the Original Code is Erik Ylvisaker.
-// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009.
-// All Rights Reserved.
-//
-// Contributor(s): Erik Ylvisaker
-//
-using System;
-using System.Collections.Generic;
-using System.Text;
-using AgateLib.Geometry;
-
-namespace AgateLib.DisplayLib
-{
- /// <summary>
- /// Class which represents a single light source.
- /// Only point light sources are supported at the moment.
- /// </summary>
- [Obsolete("Use shaders to accomplish lighting instead.")]
- public class Light
- {
- private bool mEnabled = true;
- private Color mAmbient = Color.Black;
- private Color mDiffuse = Color.White;
- private Color mSpecular = Color.Black;
- private Vector3 mPosition = Vector3.Empty;
- private float mConstantAttenuation = 0.01f;
- private float mLinearAttenuation = 0.0f;
- private float mQuadraticAttenuation = 0.00001f;
- private float mRange = 100000;
-
- /// <summary>
- /// The constant value in the Lighting formula
- /// <seealso cref="SetAttenuationModel"/>
- /// </summary>
- public float AttenuationConstant
- {
- get { return mConstantAttenuation; }
- set { mConstantAttenuation = value; }
- }
- /// <summary>
- /// The linear value in the Lighting formula
- /// <seealso cref="SetAttenuationModel"/>
- /// </summary>
- public float AttenuationLinear
- {
- get { return mLinearAttenuation; }
- set { mLinearAttenuation = value; }
- }
- /// <summary>
- /// The quadratic value in the Lighting formula
- /// <seealso cref="SetAttenuationModel"/>
- /// </summary>
- public float AttenuationQuadratic
- {
- get { return mQuadraticAttenuation; }
- set { mQuadraticAttenuation = value; }
- }
- /// <summary>
- /// Sets the three constants in the attenuation model. See remarks for details.
- /// </summary>
- /// <remarks>
- /// Lights decrease in intensity for objects which are farther away from the lights.
- /// This is called attenuation.
- /// Point Lights are attenuated according to the following formula:
- /// <para>
- /// K = C<sub>0</sub> + C<sub>1</sub>*d + C<sub>2</sub>*d<sup>2</sup>
- /// </para>
- /// <para>
- /// A = 1 / K
- /// </para>
- /// where d is the distance from the light the object being rendered is. The Light's
- /// color components are multiplied by A to decrease the intensity of the light on this
- /// object.
- /// </remarks>
- /// <param name="constant"></param>
- /// <param name="linear"></param>
- /// <param name="quadratic"></param>
- public void SetAttenuationModel(float constant, float linear, float quadratic)
- {
- AttenuationConstant = constant;
- AttenuationLinear = linear;
- AttenuationQuadratic = quadratic;
- }
- /// <summary>
- /// Gets or sets the distance at which the rendering API can consider the light
- /// too far away to have any affect.
- /// </summary>
- public float Range
- {
- get { return mRange; }
- set { mRange = value; }
- }
- /// <summary>
- /// Gets or sets whether or not this Light should have any effect on anything which is rendered.
- /// </summary>
- public bool Enabled
- {
- get
- {
- return mEnabled;
- }
- set
- {
- mEnabled = value;
- }
- }
- /// <summary>
- /// Ambient color for the light. Ambient color is not affected by the dot product with the
- /// normal, so it appears to attenuate slower.
- /// <seealso cref="Diffuse"/>
- /// </summary>
- public Color Ambient
- {
- get { return mAmbient; }
- set { mAmbient = value; }
- }
- /// <summary>
- /// Diffuse color for the light. The diffuse color is modulated by the dot product of the
- /// direction to the light with the surface normal (for 2D drawing in AgateLib, surface normals
- /// are always in the negative z direction). So it attenuates faster than the Ambient color does.
- /// </summary>
- public Color Diffuse
- {
- get { return mDiffuse; }
- set { mDiffuse = value; }
- }
- /// <summary>
- /// Specular highlight color, or "shininess." Not currently used.
- /// </summary>
- public Color Specular
- {
- get { return mSpecular; }
- set { mSpecular = value; }
- }
- /// <summary>
- /// The position of the Light source, in 3D space. Normals in AgateLib are in the negative
- /// z direction, so it is recommended to make Position.Z a negative number. How negative
- /// depends on the Attenuation model and what kind of effect you wish to create with the
- /// lighting.
- /// </summary>
- public Vector3 Position
- {
- get { return mPosition; }
- set { mPosition = value; }
- }
-
- }
-}
\ No newline at end of file
Deleted: trunk/AgateLib/DisplayLib/LightManager.cs
===================================================================
--- trunk/AgateLib/DisplayLib/LightManager.cs 2009-11-23 21:19:16 UTC (rev 1111)
+++ trunk/AgateLib/DisplayLib/LightManager.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -1,208 +0,0 @@
-// The contents of this file are subject to the Mozilla Public License
-// Version 1.1 (the "License"); you may not use this file except in
-// compliance with the License. You may obtain a copy of the License at
-// http://www.mozilla.org/MPL/
-//
-// Software distributed under the License is distributed on an "AS IS"
-// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-// License for the specific language governing rights and limitations
-// under the License.
-//
-// The Original Code is AgateLib.
-//
-// The Initial Developer of the Original Code is Erik Ylvisaker.
-// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009.
-// All Rights Reserved.
-//
-// Contributor(s): Erik Ylvisaker
-//
-using System;
-using System.Collections.Generic;
-using System.Text;
-using AgateLib.Geometry;
-
-namespace AgateLib.DisplayLib
-{
- /// <summary>
- /// The LightManager class keeps a list of Light objects which can be used
- /// to setup the lighting in the rendering API.
- /// </summary>
- [Obsolete("Use shaders to accomplish lighting instead.")]
- public class LightManager : IList<Light>
- {
- List<Light> mLights = new List<Light>();
- bool mEnabled = true;
- Color mAmbient = Color.Black;
-
- internal static readonly LightManager Empty;
-
- static LightManager()
- {
- Empty = new LightManager();
- Empty.Enabled = false;
- }
-
- /// <summary>
- /// Adds a point light to the specified position with the given diffuse color.
- /// </summary>
- /// <param name="position"></param>
- /// <param name="diffuse"></param>
- /// <returns></returns>
- public int AddPointLight(Vector3 position, Color diffuse)
- {
- return AddPointLight(position, diffuse, Color.Black);
- }
- /// <summary>
- /// Adds a point light to the specified position with the given diffuse and ambient colors.
- /// </summary>
- /// <param name="position"></param>
- /// <param name="diffuse"></param>
- /// <param name="ambient"></param>
- /// <returns></returns>
- public int AddPointLight(Vector3 position, Color diffuse, Color ambient)
- {
- mLights.Add(new Light());
-
- int retval = mLights.Count - 1;
-
- mLights[retval].Position = position;
- mLights[retval].Diffuse = diffuse;
- mLights[retval].Ambient = ambient;
-
- return retval;
- }
- /// <summary>
- /// This tells the Display to start use the Lights in this LightManager structure for
- /// lighting.
- /// </summary>
- public void DoLighting()
- {
- Display.DoLighting(this);
- }
- /// <summary>
- /// Gets or sets a flag indicating whether or not lighting calculations should be performed.
- /// </summary>
- public bool Enabled
- {
- get { return mEnabled; }
- set { mEnabled = value; }
- }
- /// <summary>
- /// Gets or sets the global ambient light color. This light color is applied to
- /// all objects rendered, regardless of their position.
- /// </summary>
- public Color Ambient
- {
- get { return mAmbient; }
- set { mAmbient = value; }
- }
-
- #region --- IList<Light> Members ---
-
- /// <summary>
- /// Gets or sets a Light in the list.
- /// </summary>
- /// <param name="index"></param>
- /// <returns></returns>
- public Light this[int index]
- {
- get
- {
- return mLights[index];
- }
- set
- {
- mLights[index] = value;
- }
- }
- /// <summary>
- /// Removes a particular light.
- /// </summary>
- /// <param name="index"></param>
- public void RemoveAt(int index)
- {
- mLights.RemoveAt(index);
- }
-
- int IList<Light>.IndexOf(Light item)
- {
- return mLights.IndexOf(item);
- }
- void IList<Light>.Insert(int index, Light item)
- {
- mLights.Insert(index, item);
- }
-
- #endregion
- #region --- ICollection<Light> Members ---
-
- /// <summary>
- /// Adds a Light to the list. If there are more lights than possible, an exception is thrown.
- /// </summary>
- /// <param name="item"></param>
- public void Add(Light item)
- {
- if (mLights.Count >= Display.Caps.MaxLights)
- {
- throw new InvalidOperationException("Too many lights!");
- }
-
- mLights.Add(item);
- }
- /// <summary>
- /// Removes all Lights from the list.
- /// </summary>
- public void Clear()
- {
- mLights.Clear();
- }
- /// <summary>
- /// Gets the number of Lights in the list.
- /// </summary>
- public int Count
- {
- get { return mLights.Count; }
- }
-
- bool ICollection<Light>.Contains(Light item)
- {
- return mLights.Contains(item);
- }
- void ICollection<Light>.CopyTo(Light[] array, int arrayIndex)
- {
- mLights.CopyTo(array, arrayIndex);
- }
-
-
- bool ICollection<Light>.IsReadOnly
- {
- get { return false; }
- }
- bool ICollection<Light>.Remove(Light item)
- {
- return mLights.Remove(item);
- }
-
- #endregion
- #region --- IEnumerable<Light> Members ---
-
- /// <summary>
- /// Enumerates the Lights in the list.
- /// </summary>
- /// <returns></returns>
- public IEnumerator<Light> GetEnumerator()
- {
- return mLights.GetEnumerator();
- }
-
- #endregion
- #region --- IEnumerable Members ---
-
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- #endregion
- }
-}
Modified: trunk/AgateLib/DisplayLib/PrimitiveType.cs
===================================================================
--- trunk/AgateLib/DisplayLib/PrimitiveType.cs 2009-11-23 21:19:16 UTC (rev 1111)
+++ trunk/AgateLib/DisplayLib/PrimitiveType.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -4,10 +4,24 @@
namespace AgateLib.DisplayLib
{
+ /// <summary>
+ /// Primitive type for types in a vertex buffer.
+ /// </summary>
public enum PrimitiveType
{
+ /// <summary>
+ /// Every three vertices is a separate triangle
+ /// </summary>
TriangleList,
+ /// <summary>
+ /// The vertices indicate a fan; the first point creates a triangle with
+ /// each pair of points after that.
+ /// </summary>
TriangleFan,
+ /// <summary>
+ /// The vertices make a strip of triangles, so each triangle shares a vertex
+ /// with the previous one.
+ /// </summary>
TriangleStrip,
}
}
Copied: trunk/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs (from rev 1111, branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs)
===================================================================
--- trunk/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs (rev 0)
+++ trunk/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AgateLib.DisplayLib.Shaders
+{
+ public static class AgateBuiltInShaders
+ {
+ internal static void InitializeShaders()
+ {
+ if (Basic2DShader != null)
+ throw new InvalidOperationException();
+
+ Basic2DShader = new Basic2DShader();
+ Lighting2D = new Lighting2D();
+ Lighting3D = new Lighting3D();
+ }
+ internal static void DisposeShaders()
+ {
+ Basic2DShader = null;
+ Lighting2D = null;
+ Lighting3D = null;
+ }
+
+ public static Basic2DShader Basic2DShader { get; private set; }
+ public static Lighting2D Lighting2D { get; private set; }
+ public static Lighting3D Lighting3D { get; private set; }
+
+ }
+}
Copied: trunk/AgateLib/DisplayLib/Shaders/AgateShader.cs (from rev 1111, branches/shaders/AgateLib/DisplayLib/Shaders/AgateShader.cs)
===================================================================
--- trunk/AgateLib/DisplayLib/Shaders/AgateShader.cs (rev 0)
+++ trunk/AgateLib/DisplayLib/Shaders/AgateShader.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -0,0 +1,117 @@
+// The contents of this file are subject to the Mozilla Public License
+// Version 1.1 (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS"
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+// License for the specific language governing rights and limitations
+// under the License.
+//
+// The Original Code is AgateLib.
+//
+// The Initial Developer of the Original Code is Erik Ylvisaker.
+// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009.
+// All Rights Reserved.
+//
+// Contributor(s): Erik Ylvisaker
+//
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.DisplayLib.Shaders.Implementation;
+using AgateLib.Geometry;
+
+namespace AgateLib.DisplayLib.Shaders
+{
+ public class AgateShader
+ {
+ AgateShaderImpl impl;
+
+ protected internal void SetImpl(AgateShaderImpl impl)
+ {
+ if (this.impl != null)
+ throw new InvalidOperationException("Cannot set impl on an object which already has one.");
+
+ this.impl = impl;
+ }
+
+ protected AgateShaderImpl Impl
+ {
+ get { return impl; }
+ }
+
+ public int Passes
+ {
+ get { return impl.Passes; }
+ }
+
+ public void Begin()
+ {
+ impl.Begin();
+ }
+ public void BeginPass(int passIndex)
+ {
+ impl.BeginPass(passIndex);
+ }
+ public void EndPass()
+ {
+ impl.EndPass();
+ }
+ public void End()
+ {
+ impl.End();
+ }
+
+ public bool IsValid
+ {
+ get { return impl != null; }
+ }
+
+ public bool IsActive
+ {
+ get { return Display.Shader == this; }
+ }
+
+ public void Activate()
+ {
+ Display.Shader = this;
+ }
+ public void SetTexture(EffectTexture tex, string variableName)
+ {
+ impl.SetTexture(tex, variableName);
+ }
+ public void SetVariable(string name, params float[] v)
+ {
+ impl.SetVariable(name, v);
+ }
+ public void SetVariable(string name, params int[] v)
+ {
+ impl.SetVariable(name, v);
+ }
+ public void SetVariable(string name, Matrix4x4 matrix)
+ {
+ impl.SetVariable(name, matrix);
+ }
+
+ public void SetVariable(string name, Vector2 v)
+ {
+ SetVariable(name, v.X, v.Y);
+ }
+ public void SetVariable(string name, Vector3 v)
+ {
+ SetVariable(name, v.X, v.Y, v.Z);
+ }
+ public void SetVariable(string name, Vector4 v)
+ {
+ SetVariable(name, v.X, v.Y, v.Z, v.W);
+ }
+ public void SetVariable(string name, Color color)
+ {
+ impl.SetVariable(name, color);
+ }
+
+ }
+
+}
Modified: trunk/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs
===================================================================
--- trunk/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs 2009-11-23 21:19:16 UTC (rev 1111)
+++ trunk/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -1,10 +1,31 @@
-using System;
+// The contents of this file are subject to the Mozilla Public License
+// Version 1.1 (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS"
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+// License for the specific language governing rights and limitations
+// under the License.
+//
+// The Original Code is AgateLib.
+//
+// The Initial Developer of the Original Code is Erik Ylvisaker.
+// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009.
+// All Rights Reserved.
+//
+// Contributor(s): Erik Ylvisaker
+//
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AgateLib.DisplayLib.Shaders
{
+ /// <summary>
+ /// Exception thrown when an attempt to compile a shader fails.
+ /// </summary>
[global::System.Serializable]
public class AgateShaderCompilerException : Exception
{
@@ -15,9 +36,21 @@
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp
//
+ /// <summary>
+ /// Constructs an AgateShaderCompilerException object.
+ /// </summary>
public AgateShaderCompilerException() { }
+ /// <summary>
+ /// Constructs an AgateShaderCompilerException object.
+ /// </summary>
public AgateShaderCompilerException(string message) : base(message) { }
+ /// <summary>
+ /// Constructs an AgateShaderCompilerException object.
+ /// </summary>
public AgateShaderCompilerException(string message, Exception inner) : base(message, inner) { }
+ /// <summary>
+ /// Constructs an AgateShaderCompilerException object.
+ /// </summary>
protected AgateShaderCompilerException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
Copied: trunk/AgateLib/DisplayLib/Shaders/Basic2DShader.cs (from rev 1111, branches/shaders/AgateLib/DisplayLib/Shaders/Basic2DShader.cs)
===================================================================
--- trunk/AgateLib/DisplayLib/Shaders/Basic2DShader.cs (rev 0)
+++ trunk/AgateLib/DisplayLib/Shaders/Basic2DShader.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -0,0 +1,51 @@
+// The contents of this file are subject to the Mozilla Public License
+// Version 1.1 (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS"
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+// License for the specific language governing rights and limitations
+// under the License.
+//
+// The Original Code is AgateLib.
+//
+// The Initial Developer of the Original Code is Erik Ylvisaker.
+// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009.
+// All Rights Reserved.
+//
+// Contributor(s): Erik Ylvisaker
+//
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.DisplayLib.Shaders.Implementation;
+using AgateLib.Geometry;
+
+namespace AgateLib.DisplayLib.Shaders
+{
+ public class Basic2DShader : AgateInternalShader
+ {
+ public Basic2DShader()
+ {
+
+ }
+
+ protected new Basic2DImpl Impl
+ {
+ get { return (Basic2DImpl)base.Impl; }
+ }
+
+ protected override BuiltInShader BuiltInShaderType
+ {
+ get { return BuiltInShader.Basic2DShader; }
+ }
+
+ public Rectangle CoordinateSystem
+ {
+ get { return Impl.CoordinateSystem; }
+ set { Impl.CoordinateSystem = value; }
+ }
+ }
+}
Deleted: trunk/AgateLib/DisplayLib/Shaders/Effect.cs
===================================================================
--- trunk/AgateLib/DisplayLib/Shaders/Effect.cs 2009-11-23 21:19:16 UTC (rev 1111)
+++ trunk/AgateLib/DisplayLib/Shaders/Effect.cs 2009-11-23 23:02:00 UTC (rev 1112)
@@ -1,57 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using AgateLib.Geometry;
-using AgateLib.Geometry.VertexTypes;
-
-namespace AgateLib.DisplayLib.Shaders
-{
- public abstract class Effect
- {
- public abstract string Technique { get; set; }
-
- public abstract int Passes { get; }
-
- public abstract void Begin();
- public abstract void BeginPass(int passIndex);
- public abstract void EndPass();
- public abstract void End();
-
- public abstract void SetTexture(EffectTexture tex, string variableName);
- public abstract void SetVariable(string name, params float[] v);
- public abstract void SetVariable(string name, par...
[truncated message content] |
|
From: <ka...@us...> - 2009-11-23 21:19:24
|
Revision: 1111
http://agate.svn.sourceforge.net/agate/?rev=1111&view=rev
Author: kanato
Date: 2009-11-23 21:19:16 +0000 (Mon, 23 Nov 2009)
Log Message:
-----------
Update Obsolete tag on Display.SetOrthoProjection.
Fix reference to AgateLib in AgateSDX.csproj.
Modified Paths:
--------------
branches/shaders/AgateLib/DisplayLib/Display.cs
branches/shaders/Drivers/AgateSDX/AgateSDX.csproj
Modified: branches/shaders/AgateLib/DisplayLib/Display.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Display.cs 2009-11-23 21:10:30 UTC (rev 1110)
+++ branches/shaders/AgateLib/DisplayLib/Display.cs 2009-11-23 21:19:16 UTC (rev 1111)
@@ -466,7 +466,7 @@
/// <param name="top"></param>
/// <param name="right"></param>
/// <param name="bottom"></param>
- [Obsolete]
+ [Obsolete("Use a AgateBuiltInShaders.Basic2DShader.CoordinateSystem instead.", true)]
public static void SetOrthoProjection(int left, int top, int right, int bottom)
{
SetOrthoProjection(Rectangle.FromLTRB(left, top, right, bottom));
@@ -487,7 +487,7 @@
/// the entire window.</para>
/// </remarks>
/// <param name="region"></param>
- [Obsolete("Use a shader instead.")]
+ [Obsolete("Use a AgateBuiltInShaders.Basic2DShader.CoordinateSystem instead.", true)]
public static void SetOrthoProjection(Rectangle region)
{
throw new NotImplementedException();
Modified: branches/shaders/Drivers/AgateSDX/AgateSDX.csproj
===================================================================
--- branches/shaders/Drivers/AgateSDX/AgateSDX.csproj 2009-11-23 21:10:30 UTC (rev 1110)
+++ branches/shaders/Drivers/AgateSDX/AgateSDX.csproj 2009-11-23 21:19:16 UTC (rev 1111)
@@ -159,7 +159,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\AgateLib\AgateLib.csproj">
- <Project>{BED5DD5D-13C6-4BA4-80DC-A47478E74F84}</Project>
+ <Project>{9490B719-829E-43A7-A5FE-8001F8A81759}</Project>
<Name>AgateLib</Name>
</ProjectReference>
<ProjectReference Include="..\AgateLib.WinForms\AgateLib.WinForms.csproj">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-23 21:10:41
|
Revision: 1110
http://agate.svn.sourceforge.net/agate/?rev=1110&view=rev
Author: kanato
Date: 2009-11-23 21:10:30 +0000 (Mon, 23 Nov 2009)
Log Message:
-----------
Work around for virtual box bug: each OpenGL context has its own draw buffer.
Modified Paths:
--------------
branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs
branches/shaders/Drivers/AgateOTK/GLState.cs
branches/shaders/Drivers/AgateOTK/GL_Display.cs
branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs
branches/shaders/Drivers/AgateOTK/GL_GameWindow.cs
branches/shaders/Drivers/AgateOTK/GL_IRenderTarget.cs
branches/shaders/Drivers/AgateOTK/GL_Surface.cs
branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs
branches/shaders/Tests/Shaders/CoordinateSystem.cs
Modified: branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs 2009-11-23 20:48:49 UTC (rev 1109)
+++ branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs 2009-11-23 21:10:30 UTC (rev 1110)
@@ -31,7 +31,7 @@
namespace AgateOTK
{
- class GLDrawBuffer
+ public class GLDrawBuffer
{
#region --- Private types for Vertex Arrays ---
@@ -79,7 +79,6 @@
}
#endregion
- GLState mState;
PositionTextureColorNormal[] mVerts;
int mIndex;
@@ -90,10 +89,8 @@
int mBufferID;
- public GLDrawBuffer(GLState state)
+ public GLDrawBuffer()
{
- mState = state;
-
GL.GenBuffers(1, out mBufferID);
Debug.Print("Draw buffer ID: {0}", mBufferID);
@@ -279,5 +276,12 @@
break;
}
}
+
+
+ public void SetGLColor(Color color)
+ {
+ GL.Color4(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f);
+ }
+
}
}
Modified: branches/shaders/Drivers/AgateOTK/GLState.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GLState.cs 2009-11-23 20:48:49 UTC (rev 1109)
+++ branches/shaders/Drivers/AgateOTK/GLState.cs 2009-11-23 21:10:30 UTC (rev 1110)
@@ -29,6 +29,7 @@
namespace AgateOTK
{
+ [Obsolete]
class GLState
{
#region --- Private variables for state management ---
@@ -39,7 +40,7 @@
public GLState()
{
- mDrawBuffer = new GLDrawBuffer(this);
+ mDrawBuffer = new GLDrawBuffer();
}
@@ -48,11 +49,6 @@
get { return mDrawBuffer; }
}
- public void SetGLColor(Color color)
- {
- GL.Color4(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f);
- }
-
}
}
Modified: branches/shaders/Drivers/AgateOTK/GL_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-23 20:48:49 UTC (rev 1109)
+++ branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-23 21:10:30 UTC (rev 1110)
@@ -37,7 +37,6 @@
public sealed class GL_Display : DisplayImpl
{
GL_IRenderTarget mRenderTarget;
- GLState mState;
Stack<Rectangle> mClipRects = new Stack<Rectangle>();
Rectangle mCurrentClip = Rectangle.Empty;
private bool mVSync = true;
@@ -154,18 +153,22 @@
}
protected override void OnEndFrame()
{
- mState.DrawBuffer.Flush();
+ DrawBuffer.Flush();
mRenderTarget.EndRender();
FlushDeleteQueue();
}
-
+ [Obsolete("Use DrawBuffer instead.", true)]
internal GLState State
{
- get { return mState; }
+ get { throw new NotImplementedException(); }
}
+ internal GLDrawBuffer DrawBuffer
+ {
+ get { return (RenderTarget.Impl as GL_IRenderTarget).DrawBuffer; }
+ }
// TODO: Test clip rect stuff.
@@ -181,27 +184,27 @@
public override void FlushDrawBuffer()
{
- mState.DrawBuffer.Flush();
+ DrawBuffer.Flush();
}
public override void Clear(Color color)
{
- mState.DrawBuffer.Flush();
+ DrawBuffer.Flush();
GL.ClearColor(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, 1.0f);
GL.Clear(ClearBufferMask.DepthBufferBit | ClearBufferMask.ColorBufferBit);
}
public override void Clear(Color color, Rectangle dest)
{
- mState.DrawBuffer.Flush();
+ DrawBuffer.Flush();
DrawRect(dest, Color.FromArgb(255, color));
}
public override void DrawLine(Point a, Point b, Color color)
{
- mState.DrawBuffer.Flush();
- mState.SetGLColor(color);
+ DrawBuffer.Flush();
+ DrawBuffer.SetGLColor(color);
GL.Disable(EnableCap.Texture2D);
GL.Begin(BeginMode.Lines);
@@ -218,8 +221,8 @@
}
public override void DrawRect(RectangleF rect, Color color)
{
- mState.DrawBuffer.Flush();
- mState.SetGLColor(color);
+ DrawBuffer.Flush();
+ DrawBuffer.SetGLColor(color);
GL.Disable(EnableCap.Texture2D);
GL.Begin(BeginMode.Lines);
@@ -246,9 +249,9 @@
}
public override void FillRect(RectangleF rect, Color color)
{
- mState.DrawBuffer.Flush();
+ DrawBuffer.Flush();
- mState.SetGLColor(color);
+ DrawBuffer.SetGLColor(color);
GL.Disable(EnableCap.Texture2D);
@@ -268,21 +271,21 @@
}
public override void FillRect(RectangleF rect, Gradient color)
{
- mState.DrawBuffer.Flush();
+ DrawBuffer.Flush();
GL.Disable(EnableCap.Texture2D);
GL.Begin(BeginMode.Quads);
- mState.SetGLColor(color.TopLeft);
+ DrawBuffer.SetGLColor(color.TopLeft);
GL.Vertex3(rect.Left, rect.Top, 0); // Top Left
- mState.SetGLColor(color.TopRight);
+ DrawBuffer.SetGLColor(color.TopRight);
GL.Vertex3(rect.Right, rect.Top, 0); // Top Right
- mState.SetGLColor(color.BottomRight);
+ DrawBuffer.SetGLColor(color.BottomRight);
GL.Vertex3(rect.Right, rect.Bottom, 0); // Bottom Right
- mState.SetGLColor(color.BottomLeft);
+ DrawBuffer.SetGLColor(color.BottomLeft);
GL.Vertex3(rect.Left, rect.Bottom, 0); // Bottom Left
GL.End(); // Done Drawing The Quad
@@ -291,11 +294,11 @@
public override void FillPolygon(PointF[] pts, Color color)
{
- mState.DrawBuffer.Flush();
+ DrawBuffer.Flush();
GL.Disable(EnableCap.Texture2D);
- mState.SetGLColor(color);
+ DrawBuffer.SetGLColor(color);
GL.Begin(BeginMode.TriangleFan);
for (int i = 0; i < pts.Length; i++)
@@ -310,7 +313,6 @@
public override void Initialize()
{
CreateFakeWindow();
- mState = new GLState();
Report("OpenTK / OpenGL driver instantiated for display.");
}
Modified: branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs 2009-11-23 20:48:49 UTC (rev 1109)
+++ branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs 2009-11-23 21:10:30 UTC (rev 1110)
@@ -60,7 +60,13 @@
WindowPosition mChoosePosition;
bool mHasFrame = true;
+ GLDrawBuffer mDrawBuffer;
+ public GLDrawBuffer DrawBuffer
+ {
+ get { return mDrawBuffer; }
+ }
+
public GL_DisplayControl(CreateWindowParams windowParams)
{
mChoosePosition = windowParams.WindowPosition;
@@ -111,6 +117,7 @@
mDisplay.ProcessEventsEvent += new EventHandler(mDisplay_ProcessEventsEvent);
mDisplay.InitializeCurrentContext();
+ mDrawBuffer = new GLDrawBuffer();
}
void mDisplay_ProcessEventsEvent(object sender, EventArgs e)
Modified: branches/shaders/Drivers/AgateOTK/GL_GameWindow.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_GameWindow.cs 2009-11-23 20:48:49 UTC (rev 1109)
+++ branches/shaders/Drivers/AgateOTK/GL_GameWindow.cs 2009-11-23 21:10:30 UTC (rev 1110)
@@ -172,6 +172,7 @@
bool mAllowResize;
bool mHasFrame;
WindowPosition mCreatePosition;
+ GLDrawBuffer mDrawBuffer;
public GL_GameWindow(CreateWindowParams windowParams)
{
@@ -199,8 +200,14 @@
mDisplay.InitializeCurrentContext();
+ mDrawBuffer = new GLDrawBuffer();
}
+ public GLDrawBuffer DrawBuffer
+ {
+ get { return mDrawBuffer; }
+ }
+
bool done = false;
void mWindow_CloseWindow(object sender, EventArgs e)
{
Modified: branches/shaders/Drivers/AgateOTK/GL_IRenderTarget.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_IRenderTarget.cs 2009-11-23 20:48:49 UTC (rev 1109)
+++ branches/shaders/Drivers/AgateOTK/GL_IRenderTarget.cs 2009-11-23 21:10:30 UTC (rev 1110)
@@ -32,5 +32,6 @@
void HideCursor();
void ShowCursor();
+ GLDrawBuffer DrawBuffer { get; }
}
}
Modified: branches/shaders/Drivers/AgateOTK/GL_Surface.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_Surface.cs 2009-11-23 20:48:49 UTC (rev 1109)
+++ branches/shaders/Drivers/AgateOTK/GL_Surface.cs 2009-11-23 21:10:30 UTC (rev 1110)
@@ -42,7 +42,7 @@
public sealed class GL_Surface : SurfaceImpl, GL_IRenderTarget
{
GL_Display mDisplay;
- GLState mState;
+ GLDrawBuffer mDrawBuffer;
string mFilename;
@@ -65,11 +65,17 @@
TextureCoordinates mTexCoord;
+ GLDrawBuffer mInternalDrawBuffer;
+ GLDrawBuffer GL_IRenderTarget.DrawBuffer
+ {
+ get { return mInternalDrawBuffer; }
+ }
+
public GL_Surface(string filename)
{
mDisplay = Display.Impl as GL_Display;
- mState = mDisplay.State;
+ mDrawBuffer = mDisplay.DrawBuffer;
mFilename = filename;
@@ -78,7 +84,7 @@
public GL_Surface(Stream st)
{
mDisplay = Display.Impl as GL_Display;
- mState = mDisplay.State;
+ mDrawBuffer = mDisplay.DrawBuffer;
// Load The Bitmap
Drawing.Bitmap sourceImage = new Drawing.Bitmap(st);
@@ -88,7 +94,7 @@
public GL_Surface(Size size)
{
mDisplay = Display.Impl as GL_Display;
- mState = mDisplay.State;
+ mDrawBuffer = mDisplay.DrawBuffer;
mSourceRect = new Rectangle(Point.Empty, size);
@@ -125,7 +131,7 @@
private GL_Surface(int textureID, Rectangle sourceRect, Size textureSize)
{
mDisplay = Display.Impl as GL_Display;
- mState = mDisplay.State;
+ mDrawBuffer = mDisplay.DrawBuffer;
AddTextureRef(textureID);
@@ -208,7 +214,7 @@
mTexCoord = GetTextureCoords(srcRect);
- mState.DrawBuffer.SetInterpolationMode(InterpolationHint);
+ mDrawBuffer.SetInterpolationMode(InterpolationHint);
if (TesselateFactor == 1)
{
@@ -278,7 +284,7 @@
// new SizeF(displayWidth, displayHeight));
- mState.DrawBuffer.AddQuad(mTextureID, color, texCoord, pt);
+ mDrawBuffer.AddQuad(mTextureID, color, texCoord, pt);
}
private void SetPoints(PointF[] pt, float destX, float destY, float rotationCenterX, float rotationCenterY,
@@ -422,6 +428,9 @@
public override void BeginRender()
{
+ if (mInternalDrawBuffer == null)
+ mInternalDrawBuffer = new GLDrawBuffer();
+
GL.Viewport(0, 0, SurfaceWidth, SurfaceHeight);
mDisplay.SetupGLOrtho(Rectangle.FromLTRB(0, SurfaceHeight, SurfaceWidth, 0));
@@ -500,7 +509,7 @@
}
else
{
- mState.DrawBuffer.ResetTexture();
+ mDrawBuffer.ResetTexture();
GL.BindTexture(TextureTarget.Texture2D, mTextureID);
Modified: branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs 2009-11-23 20:48:49 UTC (rev 1109)
+++ branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs 2009-11-23 21:10:30 UTC (rev 1110)
@@ -15,7 +15,7 @@
public class GL_VertexBuffer : VertexBufferImpl
{
GL_Display mDisplay;
- GLState mState;
+ GLDrawBuffer mDrawBuffer;
struct AttributeData
{
@@ -35,7 +35,7 @@
public GL_VertexBuffer(VertexLayout layout, int count)
{
mDisplay = Display.Impl as GL_Display;
- mState = mDisplay.State;
+ mDrawBuffer = mDisplay.DrawBuffer;
mVertexCount = count;
mLayout = layout;
@@ -122,7 +122,7 @@
private void SetClientStates()
{
- mState.SetGLColor(Color.White);
+ mDrawBuffer.SetGLColor(Color.White);
if (UseTexture)
SetTextures();
Modified: branches/shaders/Tests/Shaders/CoordinateSystem.cs
===================================================================
--- branches/shaders/Tests/Shaders/CoordinateSystem.cs 2009-11-23 20:48:49 UTC (rev 1109)
+++ branches/shaders/Tests/Shaders/CoordinateSystem.cs 2009-11-23 21:10:30 UTC (rev 1110)
@@ -15,7 +15,6 @@
int ortho = 0;
DisplayWindow wind;
-
#region IAgateTest Members
public string Name { get { return "Coordinate System"; } }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-23 20:48:57
|
Revision: 1109
http://agate.svn.sourceforge.net/agate/?rev=1109&view=rev
Author: kanato
Date: 2009-11-23 20:48:49 +0000 (Mon, 23 Nov 2009)
Log Message:
-----------
Renamed Ortho test to Coordinate system test.
Modified Paths:
--------------
branches/shaders/Tests/Tests.csproj
Added Paths:
-----------
branches/shaders/Tests/Shaders/CoordinateSystem.cs
Removed Paths:
-------------
branches/shaders/Tests/DisplayTests/Ortho.cs
Deleted: branches/shaders/Tests/DisplayTests/Ortho.cs
===================================================================
--- branches/shaders/Tests/DisplayTests/Ortho.cs 2009-11-23 20:24:25 UTC (rev 1108)
+++ branches/shaders/Tests/DisplayTests/Ortho.cs 2009-11-23 20:48:49 UTC (rev 1109)
@@ -1,84 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-using AgateLib;
-using AgateLib.DisplayLib;
-using AgateLib.Geometry;
-using AgateLib.InputLib;
-
-namespace Tests.OrthoProjectionTest
-{
- class Ortho : IAgateTest
- {
- int ortho = 0;
- DisplayWindow wind;
-
-
- #region IAgateTest Members
-
- public string Name { get { return "Ortho Projection"; } }
- public string Category { get { return "Display"; } }
-
- #endregion
-
- public void Main(string[] args)
- {
- using (AgateSetup setup = new AgateSetup())
- {
- setup.AskUser = true;
- setup.Initialize(true, false, false);
- if (setup.WasCanceled)
- return;
-
- Keyboard.KeyDown += new InputEventHandler(Keyboard_KeyDown);
-
- wind = DisplayWindow.CreateWindowed("Ortho Projection Test", 640, 480, false);
-
- Surface surf = new Surface("jellybean.png");
- surf.Color = Color.Cyan;
-
- while (wind.IsClosed == false)
- {
- Display.BeginFrame();
- Display.Clear();
-
- switch (ortho)
- {
- case 1:
- Display.SetOrthoProjection(0, 0, surf.SurfaceWidth * 2, surf.SurfaceHeight * 2);
- break;
-
- case 2:
- Display.SetOrthoProjection(-surf.SurfaceWidth, -surf.SurfaceHeight,
- surf.SurfaceWidth, surf.SurfaceHeight);
- break;
- }
-
- Display.FillRect(-2, -2, 4, 4, Color.Red);
-
- surf.Draw();
-
- Display.EndFrame();
-
- Core.KeepAlive();
- }
- }
- }
-
- void Keyboard_KeyDown(InputEventArgs e)
- {
- if (e.KeyCode == KeyCode.Space)
- {
- ortho++;
- if (ortho > 2)
- ortho = 0;
-
- Keyboard.ReleaseKey(KeyCode.Space);
- }
- else if (e.KeyCode == KeyCode.Escape)
- wind.Dispose();
-
- }
- }
-}
Copied: branches/shaders/Tests/Shaders/CoordinateSystem.cs (from rev 1103, branches/shaders/Tests/DisplayTests/Ortho.cs)
===================================================================
--- branches/shaders/Tests/Shaders/CoordinateSystem.cs (rev 0)
+++ branches/shaders/Tests/Shaders/CoordinateSystem.cs 2009-11-23 20:48:49 UTC (rev 1109)
@@ -0,0 +1,88 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using AgateLib;
+using AgateLib.DisplayLib;
+using AgateLib.DisplayLib.Shaders;
+using AgateLib.Geometry;
+using AgateLib.InputLib;
+
+namespace Tests.CoordinateSystemTest
+{
+ class CoordinateSystem : IAgateTest
+ {
+ int ortho = 0;
+ DisplayWindow wind;
+
+
+ #region IAgateTest Members
+
+ public string Name { get { return "Coordinate System"; } }
+ public string Category { get { return "Shaders"; } }
+
+ #endregion
+
+ public void Main(string[] args)
+ {
+ using (AgateSetup setup = new AgateSetup())
+ {
+ setup.AskUser = true;
+ setup.Initialize(true, false, false);
+ if (setup.WasCanceled)
+ return;
+
+ Keyboard.KeyDown += new InputEventHandler(Keyboard_KeyDown);
+
+ wind = DisplayWindow.CreateWindowed("Ortho Projection Test", 640, 480, false);
+
+ Surface surf = new Surface("jellybean.png");
+ surf.Color = Color.Cyan;
+
+ while (wind.IsClosed == false)
+ {
+ Display.BeginFrame();
+ Display.Clear();
+
+ switch (ortho)
+ {
+ case 1:
+ AgateBuiltInShaders.Basic2DShader.CoordinateSystem = new Rectangle
+ (0, 0, surf.SurfaceWidth * 2, surf.SurfaceHeight * 2);
+ break;
+
+ case 2:
+ AgateBuiltInShaders.Basic2DShader.CoordinateSystem = new Rectangle
+ (-surf.SurfaceWidth, -surf.SurfaceHeight, surf.SurfaceWidth*2, surf.SurfaceHeight*2);
+ break;
+ }
+
+ AgateBuiltInShaders.Basic2DShader.Activate();
+
+ Display.FillRect(-2, -2, 4, 4, Color.Red);
+
+ surf.Draw();
+
+ Display.EndFrame();
+
+ Core.KeepAlive();
+ }
+ }
+ }
+
+ void Keyboard_KeyDown(InputEventArgs e)
+ {
+ if (e.KeyCode == KeyCode.Space)
+ {
+ ortho++;
+ if (ortho > 2)
+ ortho = 0;
+
+ Keyboard.ReleaseKey(KeyCode.Space);
+ }
+ else if (e.KeyCode == KeyCode.Escape)
+ wind.Dispose();
+
+ }
+ }
+}
Modified: branches/shaders/Tests/Tests.csproj
===================================================================
--- branches/shaders/Tests/Tests.csproj 2009-11-23 20:24:25 UTC (rev 1108)
+++ branches/shaders/Tests/Tests.csproj 2009-11-23 20:48:49 UTC (rev 1109)
@@ -173,7 +173,7 @@
<Compile Include="DisplayTests\Interpolation.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="DisplayTests\Ortho.cs">
+ <Compile Include="Shaders\CoordinateSystem.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DisplayTests\RotatingSpriteTester.cs">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-23 20:24:41
|
Revision: 1108
http://agate.svn.sourceforge.net/agate/?rev=1108&view=rev
Author: kanato
Date: 2009-11-23 20:24:25 +0000 (Mon, 23 Nov 2009)
Log Message:
-----------
Add Basic2DShader.CoordinateSystem.
Fix removal of InternalResources data when display is disposed.
Remove obsolete matrices from DisplayImpl.
Reorganize setting of 2D drawing state in AgateSDX.
Modified Paths:
--------------
branches/shaders/AgateLib/AgateLib.csproj
branches/shaders/AgateLib/DisplayLib/Display.cs
branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Basic2DShader.cs
branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs
branches/shaders/AgateLib/InternalResources/Data.cs
branches/shaders/Drivers/AgateDrawing/DrawingBasic2DShader.cs
branches/shaders/Drivers/AgateOTK/GL_Display.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs
branches/shaders/Drivers/AgateSDX/D3DDevice.cs
branches/shaders/Drivers/AgateSDX/SDX_Display.cs
branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs
Added Paths:
-----------
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Basic2DImpl.cs
Modified: branches/shaders/AgateLib/AgateLib.csproj
===================================================================
--- branches/shaders/AgateLib/AgateLib.csproj 2009-11-23 19:44:15 UTC (rev 1107)
+++ branches/shaders/AgateLib/AgateLib.csproj 2009-11-23 20:24:25 UTC (rev 1108)
@@ -102,6 +102,7 @@
<Compile Include="DisplayLib\Shaders\AgateShader.cs" />
<Compile Include="DisplayLib\Shaders\Implementation\AgateInternalShader.cs" />
<Compile Include="DisplayLib\Shaders\Implementation\AgateShaderImpl.cs" />
+ <Compile Include="DisplayLib\Shaders\Implementation\Basic2DImpl.cs" />
<Compile Include="DisplayLib\Shaders\Implementation\BuiltInShader.cs" />
<Compile Include="DisplayLib\Shaders\Implementation\Lighting2DImpl.cs" />
<Compile Include="DisplayLib\Shaders\Implementation\Lighting3DImpl.cs" />
Modified: branches/shaders/AgateLib/DisplayLib/Display.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Display.cs 2009-11-23 19:44:15 UTC (rev 1107)
+++ branches/shaders/AgateLib/DisplayLib/Display.cs 2009-11-23 20:24:25 UTC (rev 1108)
@@ -296,9 +296,11 @@
throw new AgateException("The current window has been closed, and a new render target has not been set. A render target must be set to continue rendering.");
impl.BeginFrame();
+
+ AgateBuiltInShaders.Basic2DShader.CoordinateSystem = new Rectangle(Point.Empty, RenderTarget.Size);
AgateBuiltInShaders.Basic2DShader.Activate();
- mCurrentClipRect = new Rectangle(0, 0, RenderTarget.Width, RenderTarget.Height);
+ mCurrentClipRect = new Rectangle(Point.Empty, RenderTarget.Size);
}
/// <summary>
/// EndFrame must be called at the end of each frame.
@@ -488,7 +490,7 @@
[Obsolete("Use a shader instead.")]
public static void SetOrthoProjection(Rectangle region)
{
- impl.SetOrthoProjection(region);
+ throw new NotImplementedException();
}
#region --- Drawing Functions ---
Modified: branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs 2009-11-23 19:44:15 UTC (rev 1107)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs 2009-11-23 20:24:25 UTC (rev 1108)
@@ -15,8 +15,6 @@
Basic2DShader = new Basic2DShader();
Lighting2D = new Lighting2D();
Lighting3D = new Lighting3D();
-
- Basic2DShader.Activate();
}
internal static void DisposeShaders()
{
Modified: branches/shaders/AgateLib/DisplayLib/Shaders/Basic2DShader.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/Basic2DShader.cs 2009-11-23 19:44:15 UTC (rev 1107)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/Basic2DShader.cs 2009-11-23 20:24:25 UTC (rev 1108)
@@ -21,6 +21,7 @@
using System.Linq;
using System.Text;
using AgateLib.DisplayLib.Shaders.Implementation;
+using AgateLib.Geometry;
namespace AgateLib.DisplayLib.Shaders
{
@@ -30,10 +31,21 @@
{
}
+
+ protected new Basic2DImpl Impl
+ {
+ get { return (Basic2DImpl)base.Impl; }
+ }
protected override BuiltInShader BuiltInShaderType
{
get { return BuiltInShader.Basic2DShader; }
}
+
+ public Rectangle CoordinateSystem
+ {
+ get { return Impl.CoordinateSystem; }
+ set { Impl.CoordinateSystem = value; }
+ }
}
}
Added: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Basic2DImpl.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Basic2DImpl.cs (rev 0)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Basic2DImpl.cs 2009-11-23 20:24:25 UTC (rev 1108)
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.Geometry;
+
+namespace AgateLib.DisplayLib.Shaders.Implementation
+{
+ public abstract class Basic2DImpl : AgateShaderImpl
+ {
+ public abstract Rectangle CoordinateSystem { get; set; }
+ }
+}
Modified: branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs
===================================================================
--- branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs 2009-11-23 19:44:15 UTC (rev 1107)
+++ branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs 2009-11-23 20:24:25 UTC (rev 1108)
@@ -547,7 +547,9 @@
/// Sets the boundary coordinates of the window.
/// </summary>
/// <param name="region"></param>
- public abstract void SetOrthoProjection(Rectangle region);
+ [Obsolete]
+ public virtual void SetOrthoProjection(Rectangle region)
+ { }
/// <summary>
/// Processes pending events.
@@ -595,22 +597,6 @@
throw new AgateException("Cannot create an index buffer with a driver that does not support 3D.");
}
- public virtual Matrix4x4 MatrixProjection
- {
- get { throw new AgateException("3D is not supported."); }
- set { throw new AgateException("3D is not supported."); }
- }
- public virtual Matrix4x4 MatrixView
- {
- get { throw new AgateException("3D is not supported."); }
- set { throw new AgateException("3D is not supported."); }
- }
- public virtual Matrix4x4 MatrixWorld
- {
- get { throw new AgateException("3D is not supported."); }
- set { throw new AgateException("3D is not supported."); }
- }
-
/// <summary>
/// Override this method if shaders are supported.
/// Only call the base class method if shaders aren't supported, as it throws a NotSupportedException.
Modified: branches/shaders/AgateLib/InternalResources/Data.cs
===================================================================
--- branches/shaders/AgateLib/InternalResources/Data.cs 2009-11-23 19:44:15 UTC (rev 1107)
+++ branches/shaders/AgateLib/InternalResources/Data.cs 2009-11-23 20:24:25 UTC (rev 1108)
@@ -13,6 +13,15 @@
static Surface mPoweredBy;
+ static Data()
+ {
+ Display.DisposeDisplay += new Display.DisposeDisplayHandler(OnDisplayDispose);
+ }
+ internal static void OnDisplayDispose()
+ {
+ mPoweredBy = null;
+ }
+
internal static Surface PoweredBy
{
get
Modified: branches/shaders/Drivers/AgateDrawing/DrawingBasic2DShader.cs
===================================================================
--- branches/shaders/Drivers/AgateDrawing/DrawingBasic2DShader.cs 2009-11-23 19:44:15 UTC (rev 1107)
+++ branches/shaders/Drivers/AgateDrawing/DrawingBasic2DShader.cs 2009-11-23 20:24:25 UTC (rev 1108)
@@ -1,57 +1,94 @@
using System;
using System.Collections.Generic;
+using System.Drawing;
using System.Linq;
using System.Text;
using AgateLib.DisplayLib.Shaders.Implementation;
+using AgateLib.Geometry;
namespace AgateDrawing
{
- class DrawingBasic2DShader : AgateShaderImpl
+ class DrawingBasic2DShader : Basic2DImpl
{
- public override void SetTexture(AgateLib.DisplayLib.Shaders.EffectTexture tex, string variableName)
+ AgateLib.Geometry.Rectangle mCoords;
+ Drawing_Display mDisplay;
+ System.Drawing.PointF[] regionCorners = new System.Drawing.PointF[3];
+
+ public DrawingBasic2DShader()
{
- throw new NotImplementedException();
+ mDisplay = AgateLib.DisplayLib.Display.Impl as Drawing_Display;
}
- public override void SetVariable(string name, params float[] v)
+ public override AgateLib.Geometry.Rectangle CoordinateSystem
{
- throw new NotImplementedException();
+ get
+ {
+ return mCoords;
+ }
+ set
+ {
+ mCoords = value;
+ }
}
- public override void SetVariable(string name, params int[] v)
+ public override int Passes
{
- throw new NotImplementedException();
+ get { return 1; }
}
- public override void SetVariable(string name, AgateLib.Geometry.Matrix4x4 matrix)
+ public override void Begin()
{
- throw new NotImplementedException();
+ Graphics g = mDisplay.FrameGraphics;
+
+ System.Drawing.RectangleF rect = new System.Drawing.RectangleF(
+ mCoords.Left, mCoords.Top, mCoords.Width, mCoords.Height);
+
+ regionCorners[0] = new System.Drawing.PointF(0,0);
+ regionCorners[1] = new System.Drawing.PointF(mDisplay.RenderTarget.Width, 0);
+ regionCorners[2] = new System.Drawing.PointF(0, mDisplay.RenderTarget.Height);
+
+ System.Drawing.Drawing2D.Matrix m = new System.Drawing.Drawing2D.Matrix(
+ rect, regionCorners);
+
+ g.Transform = m;
}
- public override void SetVariable(string name, AgateLib.Geometry.Color color)
+ public override void BeginPass(int passIndex)
{
- throw new NotImplementedException();
}
- public override int Passes
+ public override void EndPass()
{
- get { return 1; }
}
- public override void Begin()
+ public override void End()
{
}
- public override void BeginPass(int passIndex)
+
+ public override void SetTexture(AgateLib.DisplayLib.Shaders.EffectTexture tex, string variableName)
{
+ throw new NotImplementedException();
}
- public override void EndPass()
+ public override void SetVariable(string name, params float[] v)
{
+ throw new NotImplementedException();
}
- public override void End()
+ public override void SetVariable(string name, params int[] v)
{
+ throw new NotImplementedException();
}
+
+ public override void SetVariable(string name, AgateLib.Geometry.Matrix4x4 matrix)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, AgateLib.Geometry.Color color)
+ {
+ throw new NotImplementedException();
+ }
}
}
Modified: branches/shaders/Drivers/AgateOTK/GL_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-23 19:44:15 UTC (rev 1107)
+++ branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-23 20:24:25 UTC (rev 1108)
@@ -41,7 +41,6 @@
Stack<Rectangle> mClipRects = new Stack<Rectangle>();
Rectangle mCurrentClip = Rectangle.Empty;
private bool mVSync = true;
- private int mMaxLightsUsed = 0;
private bool mSupportsFramebuffer;
private bool mNonPowerOf2Textures;
private bool mSupportsShaders;
@@ -185,62 +184,6 @@
mState.DrawBuffer.Flush();
}
- public override void SetOrthoProjection(Rectangle region)
- {
- GL.MatrixMode(MatrixMode.Projection);
- GL.LoadIdentity();
- GL.Ortho(region.Left, region.Right, region.Bottom, region.Top, -1, 1);
- }
-
- Matrix4x4 projection = Matrix4x4.Identity;
- Matrix4x4 world = Matrix4x4.Identity;
- Matrix4x4 view = Matrix4x4.Identity;
-
- public override Matrix4x4 MatrixProjection
- {
- get { return projection; }
- set
- {
- projection = value;
- SetProjection();
- }
- }
- public override Matrix4x4 MatrixView
- {
- get { return view; }
- set
- {
- view = value;
- SetModelview();
- }
- }
- public override Matrix4x4 MatrixWorld
- {
- get { return world; }
- set
- {
- world = value;
- SetModelview();
- }
- }
-
- private void SetModelview()
- {
- OpenTK.Matrix4 modelview = GeoHelper.ConvertAgateMatrix(view * world, false);
-
- GL.MatrixMode(MatrixMode.Modelview);
- GL.LoadIdentity();
- GL.LoadMatrix(ref modelview);
- }
- private void SetProjection()
- {
- OpenTK.Matrix4 otkProjection = GeoHelper.ConvertAgateMatrix(projection, false);
-
- GL.MatrixMode(MatrixMode.Projection);
- GL.LoadIdentity();
- GL.LoadMatrix(ref otkProjection);
- }
-
public override void Clear(Color color)
{
mState.DrawBuffer.Flush();
Modified: branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs 2009-11-23 19:44:15 UTC (rev 1107)
+++ branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs 2009-11-23 20:24:25 UTC (rev 1108)
@@ -10,16 +10,26 @@
namespace AgateOTK.Shaders.FixedFunction
{
- class OTK_FF_Basic2DShader : AgateShaderImpl
+ class OTK_FF_Basic2DShader : Basic2DImpl
{
Rectangle coords;
+ public override Rectangle CoordinateSystem
+ {
+ get
+ {
+ return coords;
+ }
+ set
+ {
+ coords = value;
+ }
+ }
+
public override void Begin()
{
GL.Disable(EnableCap.Lighting);
- coords = new Rectangle(Point.Empty, Display.RenderTarget.Size);
-
GL.MatrixMode(MatrixMode.Projection);
GL.LoadIdentity();
GL.Ortho(coords.Left, coords.Right, coords.Bottom, coords.Top, -1, 1);
Modified: branches/shaders/Drivers/AgateSDX/D3DDevice.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/D3DDevice.cs 2009-11-23 19:44:15 UTC (rev 1107)
+++ branches/shaders/Drivers/AgateSDX/D3DDevice.cs 2009-11-23 20:24:25 UTC (rev 1108)
@@ -197,39 +197,7 @@
}
}
}
- public void Set2DDrawState()
- {
- mDevice.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha);
- mDevice.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha);
- mDevice.SetSamplerState(0, SamplerState.AddressU, TextureAddress.Clamp);
- mDevice.SetSamplerState(0, SamplerState.AddressV, TextureAddress.Clamp);
-
- mDevice.SetSamplerState(0, SamplerState.MagFilter, TextureFilter.Anisotropic);
- mDevice.SetSamplerState(0, SamplerState.MinFilter, TextureFilter.Anisotropic);
-
- SetView2D();
- }
-
-
- public void SetOrthoProjection(Rectangle region)
- {
- Matrix orthoProj = Matrix.OrthoOffCenterRH(
- region.Left, region.Right, region.Bottom, region.Top, -1, 1);
-
- mDevice.SetTransform(TransformState.Projection, orthoProj);
- }
-
- public void SetView2D()
- {
- mDevice.SetRenderState(RenderState.CullMode, Cull.None);
- mDevice.SetRenderState(RenderState.Lighting, false);
-
- mDevice.SetTransform(TransformState.World, Matrix.Identity);
- mDevice.SetTransform(TransformState.View, Matrix.Identity);
-
- SetOrthoProjection(new Rectangle(0, 0, RenderTarget.Width, RenderTarget.Height));
- }
public void SetFontRenderState()
{
mLastTexture = null;
Modified: branches/shaders/Drivers/AgateSDX/SDX_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/SDX_Display.cs 2009-11-23 19:44:15 UTC (rev 1107)
+++ branches/shaders/Drivers/AgateSDX/SDX_Display.cs 2009-11-23 20:24:25 UTC (rev 1108)
@@ -301,9 +301,6 @@
mRenderTarget.BeginRender();
SetClipRect(new Rectangle(new Point(0, 0), mRenderTarget.Size));
-
- mDevice.Set2DDrawState();
-
}
protected override void OnEndFrame()
{
@@ -860,10 +857,6 @@
{
mDevice.DrawBuffer.Flush();
}
- public override void SetOrthoProjection(Rectangle region)
- {
- mDevice.SetOrthoProjection(region);
- }
protected override void SavePixelBuffer(PixelBuffer pixelBuffer, string filename, ImageFileFormat format)
{
@@ -914,10 +907,6 @@
#region --- 3D stuff ---
- Matrix4x4 projection = Matrix4x4.Identity;
- Matrix4x4 world = Matrix4x4.Identity;
- Matrix4x4 view = Matrix4x4.Identity;
-
protected override VertexBufferImpl CreateVertexBuffer(
AgateLib.Geometry.VertexTypes.VertexLayout layout, int vertexCount)
{
@@ -928,58 +917,6 @@
return new SDX_IndexBuffer(this, type, size);
}
- public override Matrix4x4 MatrixProjection
- {
- get
- {
- return projection;
- }
- set
- {
- //value = Matrix4.Projection(45, 800 / 600f, 1f, 1000f);
- var x = SlimDX.Matrix.PerspectiveFovRH(
- (float)(45 * Math.PI / 180), 800 / 600f, 1f, 1000f);
-
- projection = value;
- mDevice.Device.SetTransform(TransformState.Projection,
- GeoHelper.TransformAgateMatrix(value));
- }
- }
-
- public override Matrix4x4 MatrixView
- {
- get
- {
- return view;
- }
- set
- {
- view = value;
-
- mDevice.Device.SetTransform(TransformState.View,
- GeoHelper.TransformAgateMatrix(value));
- }
- }
- public override Matrix4x4 MatrixWorld
- {
- get
- {
- return world;
- }
- set
- {
- world = value;
-
- mDevice.Device.SetTransform(TransformState.World,
- GeoHelper.TransformAgateMatrix(value));
- }
- }
-
- Matrix GetTotalTransform()
- {
- return GeoHelper.TransformAgateMatrix(MatrixProjection * MatrixView * MatrixWorld);
- }
-
#endregion
[Obsolete("The necessity of this needs to be verified.")]
Modified: branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs 2009-11-23 19:44:15 UTC (rev 1107)
+++ branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs 2009-11-23 20:24:25 UTC (rev 1108)
@@ -4,16 +4,55 @@
using System.Text;
using AgateLib.DisplayLib.Shaders;
using AgateLib.DisplayLib.Shaders.Implementation;
+using AgateLib.Geometry;
+using SlimDX.Direct3D9;
namespace AgateSDX.Shaders
{
- class SDX_FF_Basic2DShader : AgateShaderImpl
+ class SDX_FF_Basic2DShader : Basic2DImpl
{
+ Device mDevice;
+ Rectangle mCoords;
+
+ public SDX_FF_Basic2DShader()
+ {
+ mDevice = (AgateLib.DisplayLib.Display.Impl as SDX_Display).D3D_Device.Device;
+ }
+
+ public override AgateLib.Geometry.Rectangle CoordinateSystem
+ {
+ get { return mCoords; }
+ set { mCoords = value; }
+ }
+
+ public void Set2DDrawState()
+ {
+ mDevice.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha);
+ mDevice.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha);
+
+ mDevice.SetSamplerState(0, SamplerState.AddressU, TextureAddress.Clamp);
+ mDevice.SetSamplerState(0, SamplerState.AddressV, TextureAddress.Clamp);
+
+ mDevice.SetSamplerState(0, SamplerState.MagFilter, TextureFilter.Anisotropic);
+ mDevice.SetSamplerState(0, SamplerState.MinFilter, TextureFilter.Anisotropic);
+
+ mDevice.SetRenderState(RenderState.CullMode, Cull.None);
+ mDevice.SetRenderState(RenderState.Lighting, false);
+
+ mDevice.SetTransform(TransformState.World, SlimDX.Matrix.Identity);
+ mDevice.SetTransform(TransformState.View, SlimDX.Matrix.Identity);
+
+ SlimDX.Matrix orthoProj = SlimDX.Matrix.OrthoOffCenterRH(
+ mCoords.Left, mCoords.Right, mCoords.Bottom, mCoords.Top, -1, 1);
+
+ mDevice.SetTransform(TransformState.Projection, orthoProj);
+ }
+
public override void Begin()
{
SDX_Display mDisplay = (SDX_Display)AgateLib.DisplayLib.Display.Impl;
- mDisplay.D3D_Device.Set2DDrawState();
+ Set2DDrawState();
}
public override void BeginPass(int passIndex)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-23 19:44:39
|
Revision: 1107
http://agate.svn.sourceforge.net/agate/?rev=1107&view=rev
Author: kanato
Date: 2009-11-23 19:44:15 +0000 (Mon, 23 Nov 2009)
Log Message:
-----------
Update OpenTK.dll.
Fix initialization of 2D draw state.
Modified Paths:
--------------
branches/shaders/Drivers/AgateOTK/AL_Audio.cs
branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs
branches/shaders/Drivers/AgateOTK/GL_IndexBuffer.cs
branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs
branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.dll
branches/shaders/Drivers/AgateOTK/OpenTK.dll
branches/shaders/Drivers/AgateOTK/OpenTK.dll.config
branches/shaders/Drivers/AgateOTK/OpenTK.xml
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs
branches/shaders/Tests/Shaders/Lighting3DTest.cs
Modified: branches/shaders/Drivers/AgateOTK/AL_Audio.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/AL_Audio.cs 2009-11-21 00:09:04 UTC (rev 1106)
+++ branches/shaders/Drivers/AgateOTK/AL_Audio.cs 2009-11-23 19:44:15 UTC (rev 1107)
@@ -23,7 +23,6 @@
using AgateLib.ImplementationBase;
using AgateLib.Drivers;
using OpenTK.Audio.OpenAL;
-using AL = OpenTK.Audio.AL;
namespace AgateOTK
{
Modified: branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs 2009-11-21 00:09:04 UTC (rev 1106)
+++ branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs 2009-11-23 19:44:15 UTC (rev 1107)
@@ -18,6 +18,7 @@
//
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
@@ -93,7 +94,8 @@
{
mState = state;
- GL.GenBuffers(1, out mBufferID );
+ GL.GenBuffers(1, out mBufferID);
+ Debug.Print("Draw buffer ID: {0}", mBufferID);
SetBufferSize(1000);
}
@@ -108,11 +110,27 @@
private void BufferData()
{
+ int bufferSize = mIndex * Marshal.SizeOf(typeof(PositionTextureColorNormal));
+
GL.BindBuffer(BufferTarget.ArrayBuffer, mBufferID);
- GL.BufferData(BufferTarget.ArrayBuffer,
- (IntPtr)(mIndex * Marshal.SizeOf(typeof(PositionTextureColorNormal))), mVerts,
- BufferUsageHint.StaticDraw);
+ unsafe
+ {
+ GCHandle handle = new GCHandle();
+
+ try
+ {
+ handle = GCHandle.Alloc(mVerts, GCHandleType.Pinned);
+
+ IntPtr ptr = handle.AddrOfPinnedObject();
+
+ GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)bufferSize, ptr, BufferUsageHint.StaticDraw);
+ }
+ finally
+ {
+ handle.Free();
+ }
+ }
}
private void SetTexture(int textureID)
@@ -212,7 +230,6 @@
SetGLInterpolation();
- GL.BindBuffer(BufferTarget.ArrayBuffer, mBufferID);
GL.EnableClientState(EnableCap.TextureCoordArray);
GL.EnableClientState(EnableCap.ColorArray);
GL.EnableClientState(EnableCap.VertexArray);
@@ -224,7 +241,6 @@
int pos = PositionTextureColorNormal.VertexLayout.ElementByteIndex(VertexElement.Position);
int norm = PositionTextureColorNormal.VertexLayout.ElementByteIndex(VertexElement.Normal);
-
GL.TexCoordPointer(2, TexCoordPointerType.Float, size, (IntPtr) tex);
GL.ColorPointer(4, ColorPointerType.UnsignedByte, size, color);
GL.VertexPointer(2, VertexPointerType.Float, size, pos);
Modified: branches/shaders/Drivers/AgateOTK/GL_IndexBuffer.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_IndexBuffer.cs 2009-11-21 00:09:04 UTC (rev 1106)
+++ branches/shaders/Drivers/AgateOTK/GL_IndexBuffer.cs 2009-11-23 19:44:15 UTC (rev 1107)
@@ -21,6 +21,8 @@
mType = type;
CreateBuffer();
+
+ System.Diagnostics.Debug.Print("Created {0} index buffer.", type);
}
private void CreateBuffer()
Modified: branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs 2009-11-21 00:09:04 UTC (rev 1106)
+++ branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs 2009-11-23 19:44:15 UTC (rev 1107)
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using AgateLib;
@@ -39,6 +40,8 @@
mLayout = layout;
GL.GenBuffers(1, out mVertexBufferID);
+ Debug.Print("Vertex buffer ID: {0}", mVertexBufferID);
+
}
public override void Write<T>(T[] vertices)
@@ -46,23 +49,29 @@
GL.BindBuffer(BufferTarget.ArrayBuffer, mVertexBufferID);
int size = vertices.Length * Marshal.SizeOf(typeof(T));
- GCHandle h = GCHandle.Alloc(vertices, GCHandleType.Pinned);
+ GCHandle h = new GCHandle();
- IntPtr arrayptr = Marshal.UnsafeAddrOfPinnedArrayElement(vertices, 0);
-
- unsafe
+ try
{
- byte* ptr = (byte*)arrayptr;
+ h = GCHandle.Alloc(vertices, GCHandleType.Pinned);
- GL.BufferData(
- BufferTarget.ArrayBuffer,
- (IntPtr)(vertices.Length * Marshal.SizeOf(typeof(T))),
- (IntPtr)ptr,
- BufferUsageHint.StaticDraw);
- }
+ IntPtr arrayptr = Marshal.UnsafeAddrOfPinnedArrayElement(vertices, 0);
- h.Free();
+ unsafe
+ {
+ byte* ptr = (byte*)arrayptr;
+ GL.BufferData(
+ BufferTarget.ArrayBuffer,
+ (IntPtr)size,
+ (IntPtr)ptr,
+ BufferUsageHint.StaticDraw);
+ }
+ }
+ finally
+ {
+ h.Free();
+ }
}
public override void Draw(int start, int count)
@@ -142,6 +151,9 @@
mLayout.ElementByteIndex(VertexElement.Position));
}
+ GL.DisableClientState(EnableCap.ColorArray);
+
+
SetAttributes();
}
Modified: branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.dll
===================================================================
(Binary files differ)
Modified: branches/shaders/Drivers/AgateOTK/OpenTK.dll
===================================================================
(Binary files differ)
Modified: branches/shaders/Drivers/AgateOTK/OpenTK.dll.config
===================================================================
--- branches/shaders/Drivers/AgateOTK/OpenTK.dll.config 2009-11-21 00:09:04 UTC (rev 1106)
+++ branches/shaders/Drivers/AgateOTK/OpenTK.dll.config 2009-11-23 19:44:15 UTC (rev 1107)
@@ -6,6 +6,6 @@
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
- <dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
+ <dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
</configuration>
Modified: branches/shaders/Drivers/AgateOTK/OpenTK.xml
===================================================================
--- branches/shaders/Drivers/AgateOTK/OpenTK.xml 2009-11-21 00:09:04 UTC (rev 1106)
+++ branches/shaders/Drivers/AgateOTK/OpenTK.xml 2009-11-23 19:44:15 UTC (rev 1107)
@@ -4,22 +4,6 @@
<name>OpenTK</name>
</assembly>
<members>
- <member name="T:OpenTK.Properties.Resources">
- <summary>
- A strongly-typed resource class, for looking up localized strings, etc.
- </summary>
- </member>
- <member name="P:OpenTK.Properties.Resources.ResourceManager">
- <summary>
- Returns the cached ResourceManager instance used by this class.
- </summary>
- </member>
- <member name="P:OpenTK.Properties.Resources.Culture">
- <summary>
- Overrides the current thread's CurrentUICulture property for all
- resource lookups using this strongly typed resource class.
- </summary>
- </member>
<member name="T:OpenTK.Platform.X11.Glx">
<summary>
Provides access to GLX functions.
@@ -67,1483 +51,571 @@
values.
</remarks>
</member>
- <member name="M:OpenTK.BindingsBase.Load(System.String)">
- <summary>
- Loads all extension and core functions.
- </summary>
- </member>
<member name="P:OpenTK.BindingsBase.RebuildExtensionList">
<summary>
Gets or sets a <see cref="T:System.Boolean"/> that indicates whether the list of supported extensions may have changed.
</summary>
</member>
- <member name="T:OpenTK.GraphicsException">
- <summary>Represents errors related to Graphics operations.</summary>
- </member>
- <member name="M:OpenTK.GraphicsException.#ctor">
- <summary>Constructs a new GraphicsException.</summary>
- </member>
- <member name="M:OpenTK.GraphicsException.#ctor(System.String)">
- <summary>Constructs a new GraphicsException with the specified excpetion message.</summary>
- <param name="message"></param>
- </member>
- <member name="T:OpenTK.Graphics.GraphicsErrorException">
+ <member name="P:OpenTK.BindingsBase.SyncRoot">
<summary>
- Identifies a specific OpenGL or OpenGL|ES error. Such exceptions are only thrown
- when OpenGL or OpenGL|ES automatic error checking is enabled -
- <see cref="P:OpenTK.Graphics.GraphicsContext.ErrorChecking"/> property.
- Important: Do *not* catch this exception. Rather, fix the underlying issue that caused the error.
+ Gets an object that can be used to synchronize access to the bindings implementation.
</summary>
+ <remarks>This object should be unique across bindings but consistent between bindings
+ of the same type. For example, ES10.GL, OpenGL.GL and CL10.CL should all return
+ unique objects, but all instances of ES10.GL should return the same object.</remarks>
</member>
- <member name="M:OpenTK.Graphics.GraphicsErrorException.#ctor(System.String)">
+ <member name="T:OpenTK.BezierCurve">
<summary>
- Constructs a new GraphicsErrorException instance with the specified error message.
+ Represents a bezier curve with as many points as you want.
</summary>
- <param name="message"></param>
</member>
- <member name="T:OpenTK.Graphics.IGraphicsContext">
+ <member name="F:OpenTK.BezierCurve.Parallel">
<summary>
- Provides methods for creating and interacting with an OpenGL context.
+ The parallel value.
</summary>
+ <remarks>This value defines whether the curve should be calculated as a
+ parallel curve to the original bezier curve. A value of 0.0f represents
+ the original curve, 5.0f i.e. stands for a curve that has always a distance
+ of 5.0f to the orignal curve at any point.</remarks>
</member>
- <member name="M:OpenTK.Graphics.IGraphicsContext.SwapBuffers">
- <summary>Swaps buffers, presenting the rendered scene to the user.</summary>
- </member>
- <member name="M:OpenTK.Graphics.IGraphicsContext.MakeCurrent(OpenTK.Platform.IWindowInfo)">
- <summary>Makes the GraphicsContext current in the calling thread.</summary>
- <param name="window">An OpenTK.Platform.IWindowInfo structure that points to a valid window.</param>
- <remarks>
- <para>OpenGL commands in one thread, affect the GraphicsContext which is current in that thread.</para>
- <para>It is an error to issue an OpenGL command in a thread without a current GraphicsContext.</para>
- </remarks>
- </member>
- <member name="M:OpenTK.Graphics.IGraphicsContext.Update(OpenTK.Platform.IWindowInfo)">
+ <member name="M:OpenTK.BezierCurve.#ctor(System.Collections.Generic.IEnumerable{OpenTK.Vector2})">
<summary>
- Updates the graphics context. This must be called when the region the graphics context
- is drawn to is resized.
+ Constructs a new <see cref="T:OpenTK.BezierCurve"/>.
</summary>
- <param name="window"></param>
+ <param name="points">The points.</param>
</member>
- <member name="P:OpenTK.Graphics.IGraphicsContext.IsCurrent">
+ <member name="M:OpenTK.BezierCurve.#ctor(OpenTK.Vector2[])">
<summary>
- Gets a <see cref="T:System.Boolean"/> indicating whether this instance is current in the calling thread.
+ Constructs a new <see cref="T:OpenTK.BezierCurve"/>.
</summary>
+ <param name="points">The points.</param>
</member>
- <member name="P:OpenTK.Graphics.IGraphicsContext.IsDisposed">
+ <member name="M:OpenTK.BezierCurve.#ctor(System.Single,OpenTK.Vector2[])">
<summary>
- Gets a <see cref="T:System.Boolean"/> indicating whether this instance has been disposed.
- It is an error to access any instance methods if this property returns true.
+ Constructs a new <see cref="T:OpenTK.BezierCurve"/>.
</summary>
+ <param name="parallel">The parallel value.</param>
+ <param name="points">The points.</param>
</member>
- <member name="P:OpenTK.Graphics.IGraphicsContext.VSync">
+ <member name="M:OpenTK.BezierCurve.#ctor(System.Single,System.Collections.Generic.IEnumerable{OpenTK.Vector2})">
<summary>
- Gets or sets a value indicating whether VSyncing is enabled.
+ Constructs a new <see cref="T:OpenTK.BezierCurve"/>.
</summary>
+ <param name="parallel">The parallel value.</param>
+ <param name="points">The points.</param>
</member>
- <member name="P:OpenTK.Graphics.IGraphicsContext.GraphicsMode">
- <summary>Gets the GraphicsMode of this instance.</summary>
- </member>
- <member name="P:OpenTK.Graphics.IGraphicsContext.ErrorChecking">
+ <member name="M:OpenTK.BezierCurve.CalculatePoint(System.Single)">
<summary>
- Gets or sets a System.Boolean, indicating whether automatic error checking should be performed.
+ Calculates the point with the specified t.
</summary>
- <remarks>
- <para>It is an error to enable error checking inside a Begin()-End() region.</para>
- <para>This method only affects the debug version of OpenTK.dll.</para>
- </remarks>
+ <param name="t">The t value, between 0.0f and 1.0f.</param>
+ <returns>Resulting point.</returns>
</member>
- <member name="T:OpenTK.Graphics.IGraphicsContextInternal">
+ <member name="M:OpenTK.BezierCurve.CalculateLength(System.Single)">
<summary>
- Provides methods to create new GraphicsContexts. Should only be used for extending OpenTK.
+ Calculates the length of this bezier curve.
</summary>
+ <param name="precision">The precision.</param>
+ <returns>Length of curve.</returns>
+ <remarks>The precision gets better as the <paramref name="precision"/>
+ value gets smaller.</remarks>
</member>
- <member name="M:OpenTK.Graphics.IGraphicsContextInternal.LoadAll">
+ <member name="M:OpenTK.BezierCurve.CalculateLength(System.Collections.Generic.IList{OpenTK.Vector2},System.Single)">
<summary>
- Prepares the entry points for OpenGL.
+ Calculates the length of the specified bezier curve.
</summary>
+ <param name="points">The points.</param>
+ <param name="precision">The precision value.</param>
+ <returns>The precision gets better as the <paramref name="precision"/>
+ value gets smaller.</returns>
</member>
- <member name="M:OpenTK.Graphics.IGraphicsContextInternal.GetAddress(System.String)">
+ <member name="M:OpenTK.BezierCurve.CalculateLength(System.Collections.Generic.IList{OpenTK.Vector2},System.Single,System.Single)">
<summary>
- Gets the address of an OpenGL extension function.
+ Calculates the length of the specified bezier curve.
</summary>
- <param name="function">The name of the OpenGL function (e.g. "glGetString")</param>
- <returns>
- A pointer to the specified function or IntPtr.Zero if the function isn't
- available in the current opengl context.
- </returns>
+ <param name="points">The points.</param>
+ <param name="precision">The precision value.</param>
+ <param name="parallel">The parallel value.</param>
+ <returns>Length of curve.</returns>
+ <remarks><para>The precision gets better as the <paramref name="precision"/>
+ value gets smaller.</para>
+ <para>The <paramref name="parallel"/> parameter defines whether the curve should be calculated as a
+ parallel curve to the original bezier curve. A value of 0.0f represents
+ the original curve, 5.0f represents a curve that has always a distance
+ of 5.0f to the orignal curve.</para></remarks>
</member>
- <member name="P:OpenTK.Graphics.IGraphicsContextInternal.Implementation">
+ <member name="M:OpenTK.BezierCurve.CalculatePoint(System.Collections.Generic.IList{OpenTK.Vector2},System.Single)">
<summary>
- Gets the internal implementation of the current instance.
+ Calculates the point on the given bezier curve with the specified t parameter.
</summary>
+ <param name="points">The points.</param>
+ <param name="t">The t parameter, a value between 0.0f and 1.0f.</param>
+ <returns>Resulting point.</returns>
</member>
- <member name="P:OpenTK.Graphics.IGraphicsContextInternal.Context">
+ <member name="M:OpenTK.BezierCurve.CalculatePoint(System.Collections.Generic.IList{OpenTK.Vector2},System.Single,System.Single)">
<summary>
- Gets a handle to the OpenGL rendering context.
+ Calculates the point on the given bezier curve with the specified t parameter.
</summary>
+ <param name="points">The points.</param>
+ <param name="t">The t parameter, a value between 0.0f and 1.0f.</param>
+ <param name="parallel">The parallel value.</param>
+ <returns>Resulting point.</returns>
+ <remarks>The <paramref name="parallel"/> parameter defines whether the curve should be calculated as a
+ parallel curve to the original bezier curve. A value of 0.0f represents
+ the original curve, 5.0f represents a curve that has always a distance
+ of 5.0f to the orignal curve.</remarks>
</member>
- <member name="T:OpenTK.Audio.AudioValueException">
- <summary>Represents exceptions related to invalid values.</summary>
- </member>
- <member name="T:OpenTK.Audio.AudioException">
- <summary>Represents exceptions related to the OpenTK.Audio subsystem.</summary>
- </member>
- <member name="M:OpenTK.Audio.AudioException.#ctor">
- <summary>Constructs a new AudioException.</summary>
- </member>
- <member name="M:OpenTK.Audio.AudioException.#ctor(System.String)">
- <summary>Constructs a new AudioException with the specified error message.</summary>
- <param name="message">The error message of the AudioException.</param>
- </member>
- <member name="M:OpenTK.Audio.AudioValueException.#ctor">
- <summary>Constructs a new instance.</summary>
- </member>
- <member name="M:OpenTK.Audio.AudioValueException.#ctor(System.String)">
- <summary>Constructs a new instance with the specified error message.</summary>
- <param name="message">The error message of the AudioContextException.</param>
- </member>
- <member name="T:OpenTK.Audio.AudioContext">
+ <member name="M:OpenTK.BezierCurve.CalculatePointOfDerivative(System.Collections.Generic.IList{OpenTK.Vector2},System.Single)">
<summary>
- Provides methods to instantiate, use and destroy an audio context for playback.
- Static methods are provided to list available devices known by the driver.
+ Calculates the point with the specified t of the derivative of the given bezier function.
</summary>
+ <param name="points">The points.</param>
+ <param name="t">The t parameter, value between 0.0f and 1.0f.</param>
+ <returns>Resulting point.</returns>
</member>
- <member name="M:OpenTK.Audio.AudioContext.#cctor">
- <private />
- <static />
+ <member name="P:OpenTK.BezierCurve.Points">
<summary>
- Runs before the actual class constructor, to load available devices.
+ Gets the points of this curve.
</summary>
+ <remarks>The first point and the last points represent the anchor points.</remarks>
</member>
- <member name="M:OpenTK.Audio.AudioContext.#ctor">
- <summary>Constructs a new AudioContext, using the default audio device.</summary>
- </member>
- <member name="M:OpenTK.Audio.AudioContext.#ctor(System.String)">
+ <member name="T:OpenTK.Input.Key">
<summary>
- Constructs a new AudioContext instance.
+ The available keyboard keys.
</summary>
- <param name="device">The device name that will host this instance.</param>
</member>
- <member name="M:OpenTK.Audio.AudioContext.#ctor(System.String,System.Int32)">
- <summary>Constructs a new AudioContext, using the specified audio device and device parameters.</summary>
- <param name="device">The name of the audio device to use.</param>
- <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
- <remarks>
- Use AudioContext.AvailableDevices to obtain a list of all available audio devices.
- devices.
- </remarks>
+ <member name="F:OpenTK.Input.Key.Unknown">
+ <summary>A key outside the known keys.</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.#ctor(System.String,System.Int32,System.Int32)">
- <summary>Constructs a new AudioContext, using the specified audio device and device parameters.</summary>
- <param name="device">The name of the audio device to use.</param>
- <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
- <param name="refresh">Refresh intervals, in units of Hz. Pass 0 for driver default.</param>
- <remarks>
- Use AudioContext.AvailableDevices to obtain a list of all available audio devices.
- devices.
- </remarks>
+ <member name="F:OpenTK.Input.Key.ShiftLeft">
+ <summary>The left shift key.</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.#ctor(System.String,System.Int32,System.Int32,System.Boolean)">
- <summary>Constructs a new AudioContext, using the specified audio device and device parameters.</summary>
- <param name="device">The name of the audio device to use.</param>
- <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
- <param name="refresh">Refresh intervals, in units of Hz. Pass 0 for driver default.</param>
- <param name="sync">Flag, indicating a synchronous context.</param>
- <remarks>
- Use AudioContext.AvailableDevices to obtain a list of all available audio devices.
- devices.
- </remarks>
+ <member name="F:OpenTK.Input.Key.LShift">
+ <summary>The left shift key (equivalent to ShiftLeft).</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.#ctor(System.String,System.Int32,System.Int32,System.Boolean,System.Boolean)">
- <summary>Creates the audio context using the specified device and device parameters.</summary>
- <param name="device">The device descriptor obtained through AudioContext.AvailableDevices.</param>
- <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
- <param name="refresh">Refresh intervals, in units of Hz. Pass 0 for driver default.</param>
- <param name="sync">Flag, indicating a synchronous context.</param>
- <param name="enableEfx">Indicates whether the EFX extension should be initialized, if present.</param>
- <exception cref="T:System.ArgumentNullException">Occurs when the device string is invalid.</exception>
- <exception cref="T:System.ArgumentOutOfRangeException">Occurs when a specified parameter is invalid.</exception>
- <exception cref="T:OpenTK.Audio.AudioDeviceException">
- Occurs when the specified device is not available, or is in use by another program.
- </exception>
- <exception cref="T:OpenTK.Audio.AudioContextException">
- Occurs when an audio context could not be created with the specified parameters.
- </exception>
- <exception cref="T:System.NotSupportedException">
- Occurs when an AudioContext already exists.</exception>
- <remarks>
- <para>For maximum compatibility, you are strongly recommended to use the default constructor.</para>
- <para>Multiple AudioContexts are not supported at this point.</para>
- <para>
- The number of auxilliary EFX sends depends on the audio hardware and drivers. Most Realtek devices, as well
- as the Creative SB Live!, support 1 auxilliary send. Creative's Audigy and X-Fi series support 4 sends.
- Values higher than supported will be clamped by the driver.
- </para>
- </remarks>
+ <member name="F:OpenTK.Input.Key.ShiftRight">
+ <summary>The right shift key.</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.#ctor(System.String,System.Int32,System.Int32,System.Boolean,System.Boolean,OpenTK.Audio.AudioContext.MaxAuxiliarySends)">
- <summary>Creates the audio context using the specified device and device parameters.</summary>
- <param name="device">The device descriptor obtained through AudioContext.AvailableDevices.</param>
- <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
- <param name="refresh">Refresh intervals, in units of Hz. Pass 0 for driver default.</param>
- <param name="sync">Flag, indicating a synchronous context.</param>
- <param name="enableEfx">Indicates whether the EFX extension should be initialized, if present.</param>
- <param name="efxMaxAuxSends">Requires EFX enabled. The number of desired Auxiliary Sends per source.</param>
- <exception cref="T:System.ArgumentNullException">Occurs when the device string is invalid.</exception>
- <exception cref="T:System.ArgumentOutOfRangeException">Occurs when a specified parameter is invalid.</exception>
- <exception cref="T:OpenTK.Audio.AudioDeviceException">
- Occurs when the specified device is not available, or is in use by another program.
- </exception>
- <exception cref="T:OpenTK.Audio.AudioContextException">
- Occurs when an audio context could not be created with the specified parameters.
- </exception>
- <exception cref="T:System.NotSupportedException">
- Occurs when an AudioContext already exists.</exception>
- <remarks>
- <para>For maximum compatibility, you are strongly recommended to use the default constructor.</para>
- <para>Multiple AudioContexts are not supported at this point.</para>
- <para>
- The number of auxilliary EFX sends depends on the audio hardware and drivers. Most Realtek devices, as well
- as the Creative SB Live!, support 1 auxilliary send. Creative's Audigy and X-Fi series support 4 sends.
- Values higher than supported will be clamped by the driver.
- </para>
- </remarks>
+ <member name="F:OpenTK.Input.Key.RShift">
+ <summary>The right shift key (equivalent to ShiftRight).</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.CreateContext(System.String,System.Int32,System.Int32,System.Boolean,System.Boolean,OpenTK.Audio.AudioContext.MaxAuxiliarySends)">
- <private/>
- <summary>Creates the audio context using the specified device.</summary>
- <param name="device">The device descriptor obtained through AudioContext.AvailableDevices, or null for the default device.</param>
- <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
- <param name="refresh">Refresh intervals, in units of Hz. Pass 0 for driver default.</param>
- <param name="sync">Flag, indicating a synchronous context.</param>
- <param name="enableEfx">Indicates whether the EFX extension should be initialized, if present.</param>
- <param name="efxAuxiliarySends">Requires EFX enabled. The number of desired Auxiliary Sends per source.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">Occurs when a specified parameter is invalid.</exception>
- <exception cref="T:OpenTK.Audio.AudioDeviceException">
- Occurs when the specified device is not available, or is in use by another program.
- </exception>
- <exception cref="T:OpenTK.Audio.AudioContextException">
- Occurs when an audio context could not be created with the specified parameters.
- </exception>
- <exception cref="T:System.NotSupportedException">
- Occurs when an AudioContext already exists.</exception>
- <remarks>
- <para>For maximum compatibility, you are strongly recommended to use the default constructor.</para>
- <para>Multiple AudioContexts are not supported at this point.</para>
- <para>
- The number of auxilliary EFX sends depends on the audio hardware and drivers. Most Realtek devices, as well
- as the Creative SB Live!, support 1 auxilliary send. Creative's Audigy and X-Fi series support 4 sends.
- Values higher than supported will be clamped by the driver.
- </para>
- </remarks>
+ <member name="F:OpenTK.Input.Key.ControlLeft">
+ <summary>The left control key.</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.MakeCurrent(OpenTK.Audio.AudioContext)">
- <private/>
- <summary>Makes the specified AudioContext current in the calling thread.</summary>
- <param name="context">The OpenTK.Audio.AudioContext to make current, or null.</param>
- <exception cref="T:System.ObjectDisposedException">
- Occurs if this function is called after the AudioContext has been disposed.
- </exception>
- <exception cref="T:OpenTK.Audio.AudioContextException">
- Occurs when the AudioContext could not be made current.
- </exception>
+ <member name="F:OpenTK.Input.Key.LControl">
+ <summary>The left control key (equivalent to ControlLeft).</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.CheckErrors">
- <summary>
- Checks for ALC error conditions.
- </summary>
- <exception cref="T:System.OutOfMemoryException">Raised when an out of memory error is detected.</exception>
- <exception cref="T:OpenTK.Audio.AudioValueException">Raised when an invalid value is detected.</exception>
- <exception cref="T:OpenTK.Audio.AudioDeviceException">Raised when an invalid device is detected.</exception>
- <exception cref="T:OpenTK.Audio.AudioContextException">Raised when an invalid context is detected.</exception>
+ <member name="F:OpenTK.Input.Key.ControlRight">
+ <summary>The right control key.</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.MakeCurrent">
- <summary>Makes the AudioContext current in the calling thread.</summary>
- <exception cref="T:System.ObjectDisposedException">
- Occurs if this function is called after the AudioContext has been disposed.
- </exception>
- <exception cref="T:OpenTK.Audio.AudioContextException">
- Occurs when the AudioContext could not be made current.
- </exception>
- <remarks>
- Only one AudioContext can be current in the application at any time,
- <b>regardless of the number of threads</b>.
- </remarks>
+ <member name="F:OpenTK.Input.Key.RControl">
+ <summary>The right control key (equivalent to ControlRight).</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.Process">
- <summary>
- Processes queued audio events.
- </summary>
- <remarks>
- <para>
- If AudioContext.IsSynchronized is true, this function will resume
- the internal audio processing thread. If AudioContext.IsSynchronized is false,
- you will need to call this function multiple times per second to process
- audio events.
- </para>
- <para>
- In some implementations this function may have no effect.
- </para>
- </remarks>
- <exception cref="T:System.ObjectDisposedException">Occurs when this function is called after the AudioContext had been disposed.</exception>
- <seealso cref="M:OpenTK.Audio.AudioContext.Suspend"/>
- <seealso cref="P:OpenTK.Audio.AudioContext.IsProcessing"/>
- <seealso cref="P:OpenTK.Audio.AudioContext.IsSynchronized"/>
+ <member name="F:OpenTK.Input.Key.AltLeft">
+ <summary>The left alt key.</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.Suspend">
- <summary>
- Suspends processing of audio events.
- </summary>
- <remarks>
- <para>
- To avoid audio artifacts when calling this function, set audio gain to zero before
- suspending an AudioContext.
- </para>
- <para>
- In some implementations, it can be faster to suspend processing before changing
- AudioContext state.
- </para>
- <para>
- In some implementations this function may have no effect.
- </para>
- </remarks>
- <exception cref="T:System.ObjectDisposedException">Occurs when this function is called after the AudioContext had been disposed.</exception>
- <seealso cref="M:OpenTK.Audio.AudioContext.Process"/>
- <seealso cref="P:OpenTK.Audio.AudioContext.IsProcessing"/>
- <seealso cref="P:OpenTK.Audio.AudioContext.IsSynchronized"/>
+ <member name="F:OpenTK.Input.Key.LAlt">
+ <summary>The left alt key (equivalent to AltLeft.</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.SupportsExtension(System.String)">
- <summary>
- Checks whether the specified OpenAL extension is supported.
- </summary>
- <param name="extension">The name of the extension to check (e.g. "ALC_EXT_EFX").</param>
- <returns>true if the extension is supported; false otherwise.</returns>
+ <member name="F:OpenTK.Input.Key.AltRight">
+ <summary>The right alt key.</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.Dispose">
- <summary>
- Disposes of the AudioContext, cleaning up all resources consumed by it.
- </summary>
+ <member name="F:OpenTK.Input.Key.RAlt">
+ <summary>The right alt key (equivalent to AltRight).</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.Finalize">
- <summary>
- Finalizes this instance.
- </summary>
+ <member name="F:OpenTK.Input.Key.WinLeft">
+ <summary>The left win key.</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.GetHashCode">
- <summary>
- Calculates the hash code for this instance.
- </summary>
- <returns></returns>
+ <member name="F:OpenTK.Input.Key.LWin">
+ <summary>The left win key (equivalent to WinLeft).</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.Equals(System.Object)">
- <summary>
- Compares this instance with another.
- </summary>
- <param name="obj">The instance to compare to.</param>
- <returns>True, if obj refers to this instance; false otherwise.</returns>
+ <member name="F:OpenTK.Input.Key.WinRight">
+ <summary>The right win key.</summary>
</member>
- <member name="M:OpenTK.Audio.AudioContext.ToString">
- <summary>
- Returns a <see cref="T:System.String"/> that desrcibes this instance.
- </summary>
- <returns>A <see cref="T:System.String"/> that desrcibes this instance.</returns>
+ <member name="F:OpenTK.Input.Key.RWin">
+ <summary>The right win key (equivalent to WinRight).</summary>
</member>
- <member name="P:OpenTK.Audio.AudioContext.IsCurrent">
- <summary>
- Gets or sets a System.Boolean indicating whether the AudioContext
- is current.
- </summary>
- <remarks>
- Only one AudioContext can be current in the application at any time,
- <b>regardless of the number of threads</b>.
- </remarks>
+ <member name="F:OpenTK.Input.Key.Menu">
+ <summary>The menu key.</summary>
</member>
- <member name="P:OpenTK.Audio.AudioContext.CurrentError">
- <summary>
- Returns the ALC error code for this instance.
- </summary>
+ <member name="F:OpenTK.Input.Key.F1">
+ <summary>The F1 key.</summary>
</member>
- <member name="P:OpenTK.Audio.AudioContext.IsProcessing">
- <summary>
- Gets a System.Boolean indicating whether the AudioContext is
- currently processing audio events.
- </summary>
- <seealso cref="M:OpenTK.Audio.AudioContext.Process"/>
- <seealso cref="M:OpenTK.Audio.AudioContext.Suspend"/>
+ <member name="F:OpenTK.Input.Key.F2">
+ <summary>The F2 key.</summary>
</member>
- <member name="P:OpenTK.Audio.AudioContext.IsSynchronized">
- <summary>
- Gets a System.Boolean indicating whether the AudioContext is
- synchronized.
- </summary>
- <seealso cref="M:OpenTK.Audio.AudioContext.Process"/>
+ <member name="F:OpenTK.Input.Key.F3">
+ <summary>The F3 key.</summary>
</member>
- <member name="P:OpenTK.Audio.AudioContext.CurrentDevice">
- <summary>
- Gets a System.String with the name of the device used in this context.
- </summary>
+ <member name="F:OpenTK.Input.Key.F4">
+ <summary>The F4 key.</summary>
</member>
- <member name="P:OpenTK.Audio.AudioContext.CurrentContext">
- <summary>
- Gets the OpenTK.Audio.AudioContext which is current in the application.
- </summary>
- <remarks>
- Only one AudioContext can be current in the application at any time,
- <b>regardless of the number of threads</b>.
- </remarks>
+ <member name="F:OpenTK.Input.Key.F5">
+ <summary>The F5 key.</summary>
</member>
- <member name="P:OpenTK.Audio.AudioContext.AvailableDevices">
- <summary>
- Returns a list of strings containing all known playback devices.
- </summary>
+ <member name="F:OpenTK.Input.Key.F6">
+ <summary>The F6 key.</summary>
</member>
- <member name="P:OpenTK.Audio.AudioContext.DefaultDevice">
- <summary>
- Returns the name of the device that will be used as playback default.
- </summary>
+ <member name="F:OpenTK.Input.Key.F7">
+ <summary>The F7 key.</summary>
</member>
- <member name="T:OpenTK.Audio.AudioContext.MaxAuxiliarySends">
- <summary>May be passed at context construction time to indicate the number of desired auxiliary effect slot sends per source.</summary>
+ <member name="F:OpenTK.Input.Key.F8">
+ <summary>The F8 key.</summary>
</member>
- <member name="F:OpenTK.Audio.AudioContext.MaxAuxiliarySends.UseDriverDefault">
- <summary>Will chose a reliably working parameter.</summary>
+ <member name="F:OpenTK.Input.Key.F9">
+ <summary>The F9 key.</summary>
</member>
- <member name="F:OpenTK.Audio.AudioContext.MaxAuxiliarySends.One">
- <summary>One send per source.</summary>
+ <member name="F:OpenTK.Input.Key.F10">
+ <summary>The F10 key.</summary>
</member>
- <member name="F:OpenTK.Audio.AudioContext.MaxAuxiliarySends.Two">
- <summary>Two sends per source.</summary>
+ <member name="F:OpenTK.Input.Key.F11">
+ <summary>The F11 key.</summary>
</member>
- <member name="F:OpenTK.Audio.AudioContext.MaxAuxiliarySends.Three">
- <summary>Three sends per source.</summary>
+ <member name="F:OpenTK.Input.Key.F12">
+ <summary>The F12 key.</summary>
</member>
- <member name="F:OpenTK.Audio.AudioContext.MaxAuxiliarySends.Four">
- <summary>Four sends per source.</summary>
+ <member name="F:OpenTK.Input.Key.F13">
+ <summary>The F13 key.</summary>
</member>
- <member name="M:OpenTK.Platform.Windows.WinDisplayDeviceDriver.#cctor">
- <summary>Queries available display devices and display resolutions.</summary>
+ <member name="F:OpenTK.Input.Key.F14">
+ <summary>The F14 key.</summary>
</member>
- <member name="T:OpenTK.Box2">
- <summary>
- Defines a 2d box (rectangle).
- </summary>
+ <member name="F:OpenTK.Input.Key.F15">
+ <summary>The F15 key.</summary>
</member>
- <member name="F:OpenTK.Box2.Left">
- <summary>
- The left boundary of the structure.
- </summary>
+ <member name="F:OpenTK.Input.Key.F16">
+ <summary>The F16 key.</summary>
</member>
- <member name="F:OpenTK.Box2.Right">
- <summary>
- The right boundary of the structure.
- </summary>
+ <member name="F:OpenTK.Input.Key.F17">
+ <summary>The F17 key.</summary>
</member>
- <member name="F:OpenTK.Box2.Top">
- <summary>
- The top boundary of the structure.
- </summary>
+ <member name="F:OpenTK.Input.Key.F18">
+ <summary>The F18 key.</summary>
</member>
- <member name="F:OpenTK.Box2.Bottom">
- <summary>
- The bottom boundary of the structure.
- </summary>
+ <member name="F:OpenTK.Input.Key.F19">
+ <summary>The F19 key.</summary>
</member>
- <member name="M:OpenTK.Box2.#ctor(OpenTK.Vector2,OpenTK.Vector2)">
- <summary>
- Constructs a new Box2 with the specified dimensions.
- </summary>
- <param name="topLeft">AnOpenTK.Vector2 describing the top-left corner of the Box2.</param>
- <param name="bottomRight">An OpenTK.Vector2 describing the bottom-right corner of the Box2.</param>
+ <member name="F:OpenTK.Input.Key.F20">
+ <summary>The F20 key.</summary>
</member>
- <member name="M:OpenTK.Box2.#ctor(System.Single,System.Single,System.Single,System.Single)">
- <summary>
- Constructs a new Box2 with the specified dimensions.
- </summary>
- <param name="left">The position of the left boundary.</param>
- <param name="top">The position of the top boundary.</param>
- <param name="right">The position of the right boundary.</param>
- <param name="bottom">The position of the bottom boundary.</param>
+ <member name="F:OpenTK.Input.Key.F21">
+ <summary>The F21 key.</summary>
</member>
- <member name="M:OpenTK.Box2.FromTLRB(System.Single,System.Single,System.Single,System.Single)">
- <summary>
- Creates a new Box2 with the specified dimensions.
- </summary>
- <param name="top">The position of the top boundary.</param>
- <param name="left">The position of the left boundary.</param>
- <param name="right">The position of the right boundary.</param>
- <param name="bottom">The position of the bottom boundary.</param>
- <returns>A new OpenTK.Box2 with the specfied dimensions.</returns>
+ <member name="F:OpenTK.Input.Key.F22">
+ <summary>The F22 key.</summary>
</member>
- <member name="M:OpenTK.Box2.ToString">
- <summary>
- Returns a <see cref="T:System.String"/> describing the current instance.
- </summary>
- <returns></returns>
+ <member name="F:OpenTK.Input.Key.F23">
+ <summary>The F23 key.</summary>
</member>
- <member name="P:OpenTK.Box2.Width">
- <summary>
- Gets a float describing the width of the Box2 structure.
- </summary>
+ <member name="F:OpenTK.Input.Key.F24">
+ <summary>The F24 key.</summary>
</member>
- <member name="P:OpenTK.Box2.Height">
- <summary>
- Gets a float describing the height of the Box2 structure.
- </summary>
+ <member name="F:OpenTK.Input.Key.F25">
+ <summary>The F25 key.</summary>
</member>
- <member name="T:OpenTK.Input.MouseState">
- <summary>
- Encapsulates the state of a mouse device.
- </summary>
+ <member name="F:OpenTK.Input.Key.F26">
+ <summary>The F26 key.</summary>
</member>
- <member name="M:OpenTK.Input.MouseState.Equals(OpenTK.Input.MouseState)">
- <summary>
- Compares two MouseState instances for equality.
- </summary>
- <param name="other">The instance to compare to.</param>
- <returns>True, if both instances are equal; false otherwise.</returns>
+ <member name="F:OpenTK.Input.Key.F27">
+ <summary>The F27 key.</summary>
</member>
- <member name="T:OpenTK.Graphics.GraphicsModeException">
- <summary>
- Represents errors related to unavailable graphics parameters.
- </summary>
+ <member name="F:OpenTK.Input.Key.F28">
+ <summary>The F28 key.</summary>
</member>
- <member name="M:OpenTK.Graphics.GraphicsModeException.#ctor">
- <summary>
- Constructs a new GraphicsModeException.
- </summary>
+ <member name="F:OpenTK.Input.Key.F29">
+ <summary>The F29 key.</summary>
</member>
- <member name="M:OpenTK.Graphics.GraphicsModeException.#ctor(System.String)">
- <summary>
- Constructs a new GraphicsModeException with the given error message.
- </summary>
+ <member name="F:OpenTK.Input.Key.F30">
+ <summary>The F30 key.</summary>
</member>
- <member name="T:OpenTK.Compute.CL10.CL">
- <summary>
- Provides access to the OpenCL 1.0 flat API.
- </summary>
+ <member name="F:OpenTK.Input.Key.F31">
+ <summary>The F31 key.</summary>
</member>
- <member name="T:OpenTK.Audio.OpenAL.XRamExtension">
- <summary>
- The X-Ram Extension is provided on the top-end Sound Blaster X-Fi solutions (Sound Blaster X-Fi Fatal1ty, Sound Blaster X-Fi Elite Pro, or later).
- These products feature 64MB of X-Ram that can only be used for audio purposes, which can be controlled by this Extension.
- </summary>
+ <member name="F:OpenTK.Input.Key.F32">
+ <summary>The F32 key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.XRamExtension.#ctor">
- <summary>
- Constructs a new XRamExtension instance.
- </summary>
+ <member name="F:OpenTK.Input.Key.F33">
+ <summary>The F33 key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.XRamExtension.SetBufferMode(System.Int32,System.UInt32@,OpenTK.Audio.OpenAL.XRamExtension.XRamStorage)">
- <summary>This function is used to set the storage Mode of an array of OpenAL Buffers.</summary>
- <param name="n">The number of OpenAL Buffers pointed to by buffer.</param>
- <param name="buffer">An array of OpenAL Buffer handles.</param>
- <param name="mode">The storage mode that should be used for all the given buffers. Should be the value of one of the following enum names: XRamStorage.Automatic, XRamStorage.Hardware, XRamStorage.Accessible</param>
- <returns>True if all the Buffers were successfully set to the requested storage mode, False otherwise.</returns>
+ <member name="F:OpenTK.Input.Key.F34">
+ <summary>The F34 key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.XRamExtension.SetBufferMode(System.Int32,System.Int32@,OpenTK.Audio.OpenAL.XRamExtension.XRamStorage)">
- <summary>This function is used to set the storage Mode of an array of OpenAL Buffers.</summary>
- <param name="n">The number of OpenAL Buffers pointed to by buffer.</param>
- <param name="buffer">An array of OpenAL Buffer handles.</param>
- <param name="mode">The storage mode that should be used for all the given buffers. Should be the value of one of the following enum names: XRamStorage.Automatic, XRamStorage.Hardware, XRamStorage.Accessible</param>
- <returns>True if all the Buffers were successfully set to the requested storage mode, False otherwise.</returns>
+ <member name="F:OpenTK.Input.Key.F35">
+ <summary>The F35 key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.XRamExtension.GetBufferMode(System.UInt32@)">
- <summary>This function is used to retrieve the storage Mode of a single OpenAL Buffer.</summary>
- <param name="buffer">The handle of an OpenAL Buffer.</param>
- <returns>The current Mode of the Buffer.</returns>
+ <member name="F:OpenTK.Input.Key.Up">
+ <summary>The up arrow key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.XRamExtension.GetBufferMode(System.Int32@)">
- <summary>This function is used to retrieve the storage Mode of a single OpenAL Buffer.</summary>
- <param name="buffer">The handle of an OpenAL Buffer.</param>
- <returns>The current Mode of the Buffer.</returns>
+ <member name="F:OpenTK.Input.Key.Down">
+ <summary>The down arrow key.</summary>
</member>
- <member name="P:OpenTK.Audio.OpenAL.XRamExtension.IsInitialized">
- <summary>Returns True if the X-Ram Extension has been found and could be initialized.</summary>
+ <member name="F:OpenTK.Input.Key.Left">
+ <summary>The left arrow key.</summary>
</member>
- <member name="P:OpenTK.Audio.OpenAL.XRamExtension.GetRamSize">
- <summary>Query total amount of X-RAM in bytes.</summary>
+ <member name="F:OpenTK.Input.Key.Right">
+ <summary>The right arrow key.</summary>
</member>
- <member name="P:OpenTK.Audio.OpenAL.XRamExtension.GetRamFree">
- <summary>Query free X-RAM available in bytes.</summary>
+ <member name="F:OpenTK.Input.Key.Enter">
+ <summary>The enter key.</summary>
</member>
- <member name="T:OpenTK.Audio.OpenAL.XRamExtension.XRamStorage">
- <summary>This enum is used to abstract the need of using AL.GetEnumValue() with the Extension. The values do NOT correspond to AL_STORAGE_* tokens!</summary>
+ <member name="F:OpenTK.Input.Key.Escape">
+ <summary>The escape key.</summary>
</member>
- <member name="F:OpenTK.Audio.OpenAL.XRamExtension.XRamStorage.Automatic">
- <summary>Put an Open AL Buffer into X-RAM if memory is available, otherwise use host RAM. This is the default mode.</summary>
+ <member name="F:OpenTK.Input.Key.Space">
+ <summary>The space key.</summary>
</member>
- <member name="F:OpenTK.Audio.OpenAL.XRamExtension.XRamStorage.Hardware">
- <summary>Force an Open AL Buffer into X-RAM, good for non-streaming buffers.</summary>
+ <member name="F:OpenTK.Input.Key.Tab">
+ <summary>The tab key.</summary>
</member>
- <member name="F:OpenTK.Audio.OpenAL.XRamExtension.XRamStorage.Accessible">
- <summary>Force an Open AL Buffer into 'accessible' (currently host) RAM, good for streaming buffers.</summary>
+ <member name="F:OpenTK.Input.Key.BackSpace">
+ <summary>The backspace key.</summary>
</member>
- <member name="T:OpenTK.Audio.OpenAL.EffectsExtension">
- <summary>
- Provides access to the OpenAL effects extension.
- </summary>
+ <member name="F:OpenTK.Input.Key.Back">
+ <summary>The backspace key (equivalent to BackSpace).</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.EffectsExtension.BindEffect(System.UInt32,OpenTK.Audio.OpenAL.EfxEffectType)">
- <summary>(Helper) Selects the Effect type used by this Effect handle.</summary>
- <param name="eid">Effect id returned from a successful call to GenEffects.</param>
- <param name="type">Effect type.</param>
+ <member name="F:OpenTK.Input.Key.Insert">
+ <summary>The insert key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.EffectsExtension.BindEffect(System.Int32,OpenTK.Audio.OpenAL.EfxEffectType)">
- <summary>(Helper) Selects the Effect type used by this Effect handle.</summary>
- <param name="eid">Effect id returned from a successful call to GenEffects.</param>
- <param name="type">Effect type.</param>
+ <member name="F:OpenTK.Input.Key.Delete">
+ <summary>The delete key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.EffectsExtension.BindFilterToSource(System.UInt32,System.UInt32)">
- <summary>(Helper) reroutes the output of a Source through a Filter.</summary>
- <param name="source">A valid Source handle.</param>
- <param name="filter">A valid Filter handle.</param>
+ <member name="F:OpenTK.Input.Key.PageUp">
+ <summary>The page up key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.EffectsExtension.BindFilterToSource(System.Int32,System.Int32)">
- <summary>(Helper) reroutes the output of a Source through a Filter.</summary>
- <param name="source">A valid Source handle.</param>
- <param name="filter">A valid Filter handle.</param>
+ <member name="F:OpenTK.Input.Key.PageDown">
+ <summary>The page down key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.EffectsExtension.BindEffectToAuxiliarySlot(System.UInt32,System.UInt32)">
- <summary>(Helper) Attaches an Effect to an Auxiliary Effect Slot.</summary>
- <param name="auxiliaryeffectslot">The slot handle to attach the Effect to.</param>
- <param name="effect">The Effect handle that is being attached.</param>
+ <member name="F:OpenTK.Input.Key.Home">
+ <summary>The home key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.EffectsExtension.BindEffectToAuxiliarySlot(System.Int32,System.Int32)">
- <summary>(Helper) Attaches an Effect to an Auxiliary Effect Slot.</summary>
- <param name="auxiliaryeffectslot">The slot handle to attach the Effect to.</param>
- <param name="effect">The Effect handle that is being attached.</param>
+ <member name="F:OpenTK.Input.Key.End">
+ <summary>The end key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.EffectsExtension.BindSourceToAuxiliarySlot(System.UInt32,System.UInt32,System.Int32,System.UInt32)">
- <summary>(Helper) Reroutes a Source's output into an Auxiliary Effect Slot.</summary>
- <param name="source">The Source handle who's output is forwarded.</param>
- <param name="slot">The Auxiliary Effect Slot handle that receives input from the Source.</param>
- <param name="slotnumber">Every Source has only a limited number of slots it can feed buffer to. The number must stay below AlcContextAttributes.EfxMaxAuxiliarySends</param>
- <param name="filter">Filter handle to be attached between Source ouput and Auxiliary Slot input. Use 0 or EfxFilterType.FilterNull for no filter. </param>
+ <member name="F:OpenTK.Input.Key.CapsLock">
+ <summary>The caps lock key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.EffectsExtension.BindSourceToAuxiliarySlot(System.Int32,System.Int32,System.Int32,System.Int32)">
- <summary>(Helper) Reroutes a Source's output into an Auxiliary Effect Slot.</summary>
- <param name="source">The Source handle who's output is forwarded.</param>
- <param name="slot">The Auxiliary Effect Slot handle that receives input from the Source.</param>
- <param name="slotnumber">Every Source has only a limited number of slots it can feed buffer to. The number must stay below AlcContextAttributes.EfxMaxAuxiliarySends</param>
- <param name="filter">Filter handle to be attached between Source ouput and Auxiliary Slot input. Use 0 or EfxFilterType.FilterNull for no filter. </param>
+ <member name="F:OpenTK.Input.Key.ScrollLock">
+ <summary>The scroll lock key.</summary>
</member>
- <member name="M:OpenTK.Audio.OpenAL.EffectsExtension.GenEffects(System.Int32,System.UInt32@)">
- <summary>The GenEffects function is used to create one or more Effect objects. An Effect object stores an effect type and a set of parameter values to control that Effect. In order to use an Effect it must be attached to an Auxiliary Effect Slot object</summary>
- <...
[truncated message content] |
|
From: <ka...@us...> - 2009-11-21 00:09:13
|
Revision: 1106
http://agate.svn.sourceforge.net/agate/?rev=1106&view=rev
Author: kanato
Date: 2009-11-21 00:09:04 +0000 (Sat, 21 Nov 2009)
Log Message:
-----------
Disable AL for now.
Prevent crash if OpenGL 3.0 context is not available.
Modified Paths:
--------------
branches/shaders/Drivers/AgateOTK/AL_Audio.cs
branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
branches/shaders/Drivers/AgateOTK/GL_Display.cs
branches/shaders/Drivers/AgateOTK/Otk_Reporter.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs
Modified: branches/shaders/Drivers/AgateOTK/AL_Audio.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/AL_Audio.cs 2009-11-21 00:07:42 UTC (rev 1105)
+++ branches/shaders/Drivers/AgateOTK/AL_Audio.cs 2009-11-21 00:09:04 UTC (rev 1106)
@@ -22,11 +22,12 @@
using System.Text;
using AgateLib.ImplementationBase;
using AgateLib.Drivers;
-using OpenTK.Audio;
using OpenTK.Audio.OpenAL;
+using AL = OpenTK.Audio.AL;
namespace AgateOTK
{
+ /*
class AL_Audio : AudioImpl
{
AudioContext context;
@@ -257,4 +258,5 @@
}
}
}
+ * */
}
Modified: branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
===================================================================
--- branches/shaders/Drivers/AgateOTK/AgateOTK.csproj 2009-11-21 00:07:42 UTC (rev 1105)
+++ branches/shaders/Drivers/AgateOTK/AgateOTK.csproj 2009-11-21 00:09:04 UTC (rev 1106)
@@ -70,10 +70,7 @@
<Name>OpenTK</Name>
<HintPath>.\OpenTK.dll</HintPath>
</Reference>
- <Reference Include="OpenTK.Utilities">
- <Name>OpenTK.Utilities</Name>
- <HintPath>.\OpenTK.Utilities.dll</HintPath>
- </Reference>
+ <Reference Include="OpenTK.Compatibility, Version=0.9.9.4, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="System">
<Name>System</Name>
</Reference>
Modified: branches/shaders/Drivers/AgateOTK/GL_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-21 00:07:42 UTC (rev 1105)
+++ branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-21 00:09:04 UTC (rev 1106)
@@ -427,14 +427,29 @@
string[] extensions;
private void LoadExtensions()
{
- // Forward compatible context (GL 3.0+)
- int num_extensions;
- GL.GetInteger(GetPName.NumExtensions, out num_extensions);
+ try
+ {
+ // Forward compatible context (GL 3.0+)
+ int num_extensions;
+ GL.GetInteger(GetPName.NumExtensions, out num_extensions);
- extensions = new string[num_extensions];
+ if (GL.GetError() != ErrorCode.NoError)
+ throw new OpenTK.Graphics.GraphicsErrorException("Not 3.0 context.");
- for (int i = 0; i < num_extensions; i++)
- extensions[i] = GL.GetString(StringName.Extensions, i).ToLowerInvariant();
+ extensions = new string[num_extensions];
+
+ for (int i = 0; i < num_extensions; i++)
+ extensions[i] = GL.GetString(StringName.Extensions, i).ToLowerInvariant();
+ }
+ catch (OpenTK.Graphics.GraphicsErrorException)
+ {
+ string ext = GL.GetString(StringName.Extensions);
+
+ extensions = ext.Split(' ');
+
+ for (int i = 0; i < extensions.Length; i++)
+ Debug.Print(extensions[i]);
+ }
}
private bool SupportsExtension(string name)
{
Modified: branches/shaders/Drivers/AgateOTK/Otk_Reporter.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Otk_Reporter.cs 2009-11-21 00:07:42 UTC (rev 1105)
+++ branches/shaders/Drivers/AgateOTK/Otk_Reporter.cs 2009-11-21 00:09:04 UTC (rev 1106)
@@ -36,8 +36,8 @@
if (ReportOpenAL())
{
- yield return new AgateDriverInfo(
- AudioTypeID.OpenAL, typeof(AL_Audio), "OpenAL through OpenTK " + opentk_version, 100);
+ //yield return new AgateDriverInfo(
+ // AudioTypeID.OpenAL, typeof(AL_Audio), "OpenAL through OpenTK " + opentk_version, 100);
}
}
Modified: branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs 2009-11-21 00:07:42 UTC (rev 1105)
+++ branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs 2009-11-21 00:09:04 UTC (rev 1106)
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Text;
using AgateLib.Geometry;
@@ -83,9 +84,13 @@
SetArray(array, AmbientLight);
GL.LightModel(LightModelParameter.LightModelAmbient, array);
- GL.Enable(EnableCap.ColorMaterial);
+ GL.Color4(1.0f, 1.0f, 1.0f, 1.0f);
GL.ColorMaterial(MaterialFace.FrontAndBack,
ColorMaterialParameter.AmbientAndDiffuse);
+ GL.Enable(EnableCap.ColorMaterial);
+
+ SetArray(array, Color.White);
+ GL.Material(MaterialFace.Front, MaterialParameter.AmbientAndDiffuse, array);
for (int i = 0; i < mLights.Length; i++)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-21 00:07:48
|
Revision: 1105
http://agate.svn.sourceforge.net/agate/?rev=1105&view=rev
Author: kanato
Date: 2009-11-21 00:07:42 +0000 (Sat, 21 Nov 2009)
Log Message:
-----------
Add guards to connection of listeners in Platform initializer.
Modified Paths:
--------------
branches/shaders/AgateLib/Platform.cs
Modified: branches/shaders/AgateLib/Platform.cs
===================================================================
--- branches/shaders/AgateLib/Platform.cs 2009-11-20 22:45:44 UTC (rev 1104)
+++ branches/shaders/AgateLib/Platform.cs 2009-11-21 00:07:42 UTC (rev 1105)
@@ -55,8 +55,8 @@
SetFolders();
string debugLog = "agate-debuglog.txt";
+ string traceLog = "debuglog.txt";
- string traceLog = "debuglog.txt";
if (HasWriteAccessToAppDirectory())
{
debugLog = Path.Combine(mAppDir, debugLog);
@@ -68,8 +68,15 @@
traceLog = Path.Combine(mAppData, traceLog);
}
- Debug.Listeners.Add(new TextWriterTraceListener(new StreamWriter(debugLog)));
- Trace.Listeners.Add(new TextWriterTraceListener(new StreamWriter(traceLog)));
+ try
+ {
+ Debug.Listeners.Add(new TextWriterTraceListener(new StreamWriter(debugLog)));
+ Trace.Listeners.Add(new TextWriterTraceListener(new StreamWriter(traceLog)));
+ }
+ catch (Exception)
+ {
+ Trace.WriteLine("Could not open debug or trace log for writing.");
+ }
}
// TODO: Maybe there is a better way to inspect permissions?
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-20 22:45:52
|
Revision: 1104
http://agate.svn.sourceforge.net/agate/?rev=1104&view=rev
Author: kanato
Date: 2009-11-20 22:45:44 +0000 (Fri, 20 Nov 2009)
Log Message:
-----------
Add flag to enable/diable lighting in Lighting3D.
Implement Lighting3D in OpenGL.
Modified Paths:
--------------
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Lighting3D.cs
branches/shaders/Drivers/AgateOTK/GL_Display.cs
branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs
branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs
branches/shaders/Tests/Shaders/Lighting3DTest.cs
Modified: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs 2009-11-20 20:21:33 UTC (rev 1103)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs 2009-11-20 22:45:44 UTC (rev 1104)
@@ -8,11 +8,18 @@
{
public abstract class Lighting3DImpl : AgateShaderImpl
{
+ public Lighting3DImpl()
+ {
+ AmbientLight = Color.White;
+ EnableLighting = true;
+ }
public abstract Matrix4x4 Projection { get; set; }
public abstract Matrix4x4 View { get; set; }
public abstract Matrix4x4 World { get; set; }
public abstract Light[] Lights { get; }
public abstract Color AmbientLight { get; set; }
+ public virtual bool EnableLighting { get; set; }
+
}
}
Modified: branches/shaders/AgateLib/DisplayLib/Shaders/Lighting3D.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/Lighting3D.cs 2009-11-20 20:21:33 UTC (rev 1103)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/Lighting3D.cs 2009-11-20 22:45:44 UTC (rev 1104)
@@ -20,6 +20,7 @@
public Matrix4x4 View { get { return Impl.View; } set { Impl.View = value; } }
public Matrix4x4 World { get { return Impl.World; } set { Impl.World= value; } }
+ public bool EnableLighting { get { return Impl.EnableLighting; } set { Impl.EnableLighting = value; } }
public Light[] Lights { get { return Impl.Lights; } }
public Color AmbientLight { get { return Impl.AmbientLight; } set { Impl.AmbientLight = value; } }
}
Modified: branches/shaders/Drivers/AgateOTK/GL_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-20 20:21:33 UTC (rev 1103)
+++ branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-20 22:45:44 UTC (rev 1104)
@@ -374,13 +374,13 @@
public void InitializeCurrentContext()
{
- GL.ShadeModel(ShadingModel.Smooth); // Enable Smooth Shading
+ //GL.ShadeModel(ShadingModel.Smooth); // Enable Smooth Shading
GL.ClearColor(0, 0, 0, 1.0f); // Black Background
GL.ClearDepth(1); // Depth Buffer Setup
GL.Enable(EnableCap.DepthTest); // Enables Depth Testing
GL.DepthFunc(DepthFunction.Lequal); // The Type Of Depth Testing To Do
- GL.Hint(HintTarget.PerspectiveCorrectionHint, // Really Nice Perspective Calculations
- HintMode.Nicest);
+ //GL.Hint(HintTarget.PerspectiveCorrectionHint, // Really Nice Perspective Calculations
+ // HintMode.Nicest);
}
private void CreateFakeWindow()
@@ -410,16 +410,17 @@
mNonPowerOf2Textures = true;
mSupportsShaders = true;
}
- else if (mGLVersion >= 1.5m)
- {
- mNonPowerOf2Textures = true;
- }
if (SupportsExtension("GL_ARB_FRAGMENT_PROGRAM"))
{
mSupportsShaders = true;
}
+ Trace.WriteLine(string.Format("OpenGL version {0} from vendor {1} detected.", mGLVersion, vendor));
+ Trace.WriteLine("Framebuffer: " + mSupportsFramebuffer.ToString());
+ Trace.WriteLine("NPOT: " + mNonPowerOf2Textures.ToString());
+ Trace.WriteLine("Shaders: " + mSupportsShaders.ToString());
+
InitializeShaders();
}
Modified: branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs 2009-11-20 20:21:33 UTC (rev 1103)
+++ branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs 2009-11-20 22:45:44 UTC (rev 1104)
@@ -208,9 +208,14 @@
mWindowInfo = CreateWindowInfo(newMode);
- mContext = OpenTK.Platform.Utilities.CreateGraphicsContext(
- newMode, mWindowInfo, 3, 1, GraphicsContextFlags.Default);
- //OpenTK.Platform.Utilities.CreateGraphicsContext(newMode, mRenderTarget, out mContext, out mWindowInfo);
+ GraphicsContextFlags flags = GraphicsContextFlags.Default;
+#if DEBUG
+ //flags = GraphicsContextFlags.ForwardCompatible;
+#endif
+ mContext = new OpenTK.Graphics.GraphicsContext(newMode, mWindowInfo, 3, 1, flags);
+ mContext.MakeCurrent(mWindowInfo);
+ (mContext as IGraphicsContextInternal).LoadAll();
+
}
private IWindowInfo CreateWindowInfo(GraphicsMode mode)
@@ -262,7 +267,7 @@
}
- #region --- X11 imports
+ #region --- X11 imports ---
[StructLayout(LayoutKind.Sequential)]
struct XVisualInfo
Modified: branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs 2009-11-20 20:21:33 UTC (rev 1103)
+++ branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs 2009-11-20 22:45:44 UTC (rev 1104)
@@ -4,6 +4,7 @@
using System.Text;
using AgateLib.DisplayLib.Shaders;
using AgateLib.DisplayLib.Shaders.Implementation;
+using OpenTK.Graphics.OpenGL;
namespace AgateOTK.Shaders.FixedFunction
{
@@ -11,6 +12,7 @@
{
public override void Begin()
{
+ GL.Disable(EnableCap.Lighting);
}
public override void BeginPass(int passIndex)
Modified: branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs 2009-11-20 20:21:33 UTC (rev 1103)
+++ branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs 2009-11-20 22:45:44 UTC (rev 1104)
@@ -15,7 +15,15 @@
Matrix4x4 mProjection;
Matrix4x4 mView;
Matrix4x4 mWorld;
+ AgateLib.DisplayLib.Shaders.Light[] mLights;
+ public OTK_FF_Lighting3D()
+ {
+ int maxLights;
+ GL.GetInteger(GetPName.MaxLights, out maxLights);
+
+ mLights = new Light[maxLights];
+ }
public override Color AmbientLight
{
get { return mAmbientLight; }
@@ -24,7 +32,7 @@
public override Light[] Lights
{
- get { throw new NotImplementedException(); }
+ get { return mLights; }
}
public override Matrix4x4 Projection
@@ -47,22 +55,90 @@
public override void Begin()
{
- OpenTK.Matrix4 modelview = GeoHelper.ConvertAgateMatrix(mView * mWorld, false);
-
- GL.MatrixMode(MatrixMode.Modelview);
- GL.LoadIdentity();
- GL.LoadMatrix(ref modelview);
OpenTK.Matrix4 otkProjection = GeoHelper.ConvertAgateMatrix(mProjection, false);
GL.MatrixMode(MatrixMode.Projection);
GL.LoadIdentity();
GL.LoadMatrix(ref otkProjection);
+
+ OpenTK.Matrix4 view = GeoHelper.ConvertAgateMatrix(mView, false);
+
+ GL.MatrixMode(MatrixMode.Modelview);
+ GL.LoadIdentity();
+ GL.LoadMatrix(ref view);
+
+ if (EnableLighting == false)
+ {
+ GL.Disable(EnableCap.Lighting);
+ }
+ else
+ {
+ GL.Enable(EnableCap.Lighting);
+
+ float[] array = new float[4];
+
+ GL.Enable(EnableCap.Lighting);
+
+ SetArray(array, AmbientLight);
+ GL.LightModel(LightModelParameter.LightModelAmbient, array);
+
+ GL.Enable(EnableCap.ColorMaterial);
+ GL.ColorMaterial(MaterialFace.FrontAndBack,
+ ColorMaterialParameter.AmbientAndDiffuse);
+
+ for (int i = 0; i < mLights.Length; i++)
+ {
+ EnableCap lightID = (EnableCap)((int)EnableCap.Light0 + i);
+ LightName lightName = (LightName)((int)LightName.Light0 + i);
+
+ if (mLights[i] == null || mLights[i].Enabled == false)
+ {
+ GL.Disable(lightID);
+ continue;
+ }
+
+ GL.Enable(lightID);
+
+ SetArray(array, mLights[i].DiffuseColor);
+ GL.Light(lightName, LightParameter.Diffuse, array);
+
+ SetArray(array, mLights[i].AmbientColor);
+ GL.Light(lightName, LightParameter.Ambient, array);
+
+ SetArray(array, mLights[i].Position);
+ GL.Light(lightName, LightParameter.Position, array);
+
+ GL.Light(lightName, LightParameter.ConstantAttenuation, mLights[i].AttenuationConstant);
+ GL.Light(lightName, LightParameter.LinearAttenuation, mLights[i].AttenuationLinear);
+ GL.Light(lightName, LightParameter.QuadraticAttenuation, mLights[i].AttenuationQuadratic);
+ }
+ }
+
+ OpenTK.Matrix4 viewworld = GeoHelper.ConvertAgateMatrix(mView * mWorld, false);
+
+ GL.MatrixMode(MatrixMode.Modelview);
+ GL.LoadIdentity();
+ GL.LoadMatrix(ref viewworld);
+
}
+ private void SetArray(float[] array, Vector3 vec)
+ {
+ array[0] = vec.X;
+ array[1] = vec.Y;
+ array[2] = vec.Z;
+ }
+ private void SetArray(float[] array, Color color)
+ {
+ array[0] = color.R / 255.0f;
+ array[1] = color.G / 255.0f;
+ array[2] = color.B / 255.0f;
+ array[3] = color.A / 255.0f;
+ }
+
public override void BeginPass(int passIndex)
{
- throw new NotImplementedException();
}
public override void End()
@@ -71,7 +147,6 @@
public override void EndPass()
{
- throw new NotImplementedException();
}
public override int Passes
Modified: branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs 2009-11-20 20:21:33 UTC (rev 1103)
+++ branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs 2009-11-20 22:45:44 UTC (rev 1104)
@@ -60,6 +60,19 @@
{
int index = 0;
+ mDisplay.D3D_Device.Device.SetTransform(
+ TransformState.Projection, GeoHelper.TransformAgateMatrix(mProjection.Transpose()));
+ mDisplay.D3D_Device.Device.SetTransform(
+ TransformState.View, GeoHelper.TransformAgateMatrix(mView.Transpose()));
+ mDisplay.D3D_Device.Device.SetTransform(
+ TransformState.World, GeoHelper.TransformAgateMatrix(mWorld.Transpose()));
+
+ if (EnableLighting == false)
+ {
+ mDisplay.D3D_Device.Device.SetRenderState(RenderState.Lighting, false);
+ return;
+ }
+
mDisplay.D3D_Device.Device.SetRenderState(RenderState.Lighting, true);
mDisplay.D3D_Device.Device.SetRenderState(RenderState.Ambient, mAmbientLight.ToArgb());
@@ -98,19 +111,8 @@
index++;
- }
+ }
- if (index == 0)
- mDisplay.D3D_Device.Device.SetRenderState(RenderState.Lighting, false);
-
- mDisplay.D3D_Device.Device.SetTransform(
- TransformState.Projection, GeoHelper.TransformAgateMatrix(mProjection.Transpose()));
- mDisplay.D3D_Device.Device.SetTransform(
- TransformState.View, GeoHelper.TransformAgateMatrix(mView.Transpose()));
- mDisplay.D3D_Device.Device.SetTransform(
- TransformState.World, GeoHelper.TransformAgateMatrix(mWorld.Transpose()));
-
-
}
public override void BeginPass(int passIndex)
Modified: branches/shaders/Tests/Shaders/Lighting3DTest.cs
===================================================================
--- branches/shaders/Tests/Shaders/Lighting3DTest.cs 2009-11-20 20:21:33 UTC (rev 1103)
+++ branches/shaders/Tests/Shaders/Lighting3DTest.cs 2009-11-20 22:45:44 UTC (rev 1104)
@@ -65,6 +65,7 @@
if (lightEnable)
{
+ shader.EnableLighting = true;
shader.Lights[0] = new Light();
shader.Lights[0].Position = new Vector3(0, 3, eye.Z);
shader.Lights[0].DiffuseColor = Color.White;
@@ -73,7 +74,7 @@
shader.Lights[0].AttenuationQuadratic = 0.03f;
}
else
- shader.Lights[0] = null;
+ shader.EnableLighting = false;
Vector3 dir = LookDir;
Vector3 target = eye + dir * 3;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-20 20:21:43
|
Revision: 1103
http://agate.svn.sourceforge.net/agate/?rev=1103&view=rev
Author: kanato
Date: 2009-11-20 20:21:33 +0000 (Fri, 20 Nov 2009)
Log Message:
-----------
Implement SDX_FF_Lighting3D.
Modified Paths:
--------------
branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs
branches/shaders/Tests/Shaders/Lighting3DTest.cs
Modified: branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/FixedFunctionShaderFactory.cs 2009-11-20 06:38:29 UTC (rev 1102)
+++ branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/FixedFunctionShaderFactory.cs 2009-11-20 20:21:33 UTC (rev 1103)
@@ -9,7 +9,7 @@
{
class FixedFunctionShaderFactory : ShaderFactory
{
- protected override AgateLib.DisplayLib.Shaders.Implementation.AgateShaderImpl CreateBuiltInShaderImpl(AgateLib.DisplayLib.Shaders.Implementation.BuiltInShader BuiltInShaderType)
+ protected override AgateShaderImpl CreateBuiltInShaderImpl(BuiltInShader BuiltInShaderType)
{
switch (BuiltInShaderType)
{
Modified: branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs 2009-11-20 06:38:29 UTC (rev 1102)
+++ branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs 2009-11-20 20:21:33 UTC (rev 1103)
@@ -58,17 +58,63 @@
}
public override void Begin()
{
+ int index = 0;
+
+ mDisplay.D3D_Device.Device.SetRenderState(RenderState.Lighting, true);
+ mDisplay.D3D_Device.Device.SetRenderState(RenderState.Ambient, mAmbientLight.ToArgb());
+
+ Material material = new Material();
+ material.Diffuse = new SlimDX.Color4(Color.White.ToArgb());
+ material.Ambient = new SlimDX.Color4(Color.White.ToArgb());
+
+ mDisplay.D3D_Device.Device.Material = material;
+
+ for (int i = 0; i < Lights.Length; i++)
+ {
+ var agateLight = Lights[i];
+
+ if (agateLight == null)
+ continue;
+ if (agateLight.Enabled == false)
+ continue;
+
+ SlimDX.Direct3D9.Light l = new SlimDX.Direct3D9.Light();
+
+ l.Ambient = new SlimDX.Color4(agateLight.AmbientColor.ToArgb());
+ l.Attenuation0 = agateLight.AttenuationConstant;
+ l.Attenuation1 = agateLight.AttenuationLinear;
+ l.Attenuation2 = agateLight.AttenuationQuadratic;
+ l.Diffuse = new SlimDX.Color4(agateLight.DiffuseColor.ToArgb());
+ l.Type = LightType.Point;
+ l.Direction = new SlimDX.Vector3(0, 0, 1);
+ l.Range = 100;
+
+ Vector3 pos = agateLight.Position;
+
+ l.Position = new SlimDX.Vector3(pos.X, pos.Y, pos.Z);
+
+ mDisplay.D3D_Device.Device.SetLight(index, l);
+ mDisplay.D3D_Device.Device.EnableLight(index, true);
+
+ index++;
+
+ }
+
+ if (index == 0)
+ mDisplay.D3D_Device.Device.SetRenderState(RenderState.Lighting, false);
+
mDisplay.D3D_Device.Device.SetTransform(
TransformState.Projection, GeoHelper.TransformAgateMatrix(mProjection.Transpose()));
mDisplay.D3D_Device.Device.SetTransform(
TransformState.View, GeoHelper.TransformAgateMatrix(mView.Transpose()));
mDisplay.D3D_Device.Device.SetTransform(
TransformState.World, GeoHelper.TransformAgateMatrix(mWorld.Transpose()));
+
+
}
public override void BeginPass(int passIndex)
{
- throw new NotImplementedException();
}
public override void End()
@@ -77,7 +123,6 @@
public override void EndPass()
{
- throw new NotImplementedException();
}
public override int Passes
Modified: branches/shaders/Tests/Shaders/Lighting3DTest.cs
===================================================================
--- branches/shaders/Tests/Shaders/Lighting3DTest.cs 2009-11-20 06:38:29 UTC (rev 1102)
+++ branches/shaders/Tests/Shaders/Lighting3DTest.cs 2009-11-20 20:21:33 UTC (rev 1103)
@@ -28,6 +28,7 @@
Vector3 up = new Vector3(0, 0, 1);
double lookAngle = 0;
double angle = 0;
+ bool lightEnable;
public void Main(string[] args)
{
@@ -59,10 +60,21 @@
font.DrawText(0, 0, "Location: {0}", eye);
font.DrawText(0, font.FontHeight, "Angle: {0}", lookAngle);
-
var shader = AgateBuiltInShaders.Lighting3D;
- shader.AmbientLight = Color.White;
+ shader.AmbientLight = Color.Black;
+ if (lightEnable)
+ {
+ shader.Lights[0] = new Light();
+ shader.Lights[0].Position = new Vector3(0, 3, eye.Z);
+ shader.Lights[0].DiffuseColor = Color.White;
+ shader.Lights[0].AttenuationConstant = 1f;
+ shader.Lights[0].AttenuationLinear = 0.1f;
+ shader.Lights[0].AttenuationQuadratic = 0.03f;
+ }
+ else
+ shader.Lights[0] = null;
+
Vector3 dir = LookDir;
Vector3 target = eye + dir * 3;
target.Z = 0;
@@ -109,6 +121,7 @@
case KeyCode.Down: eye -= (float)(speed * Display.DeltaTime / 1000.0f) * LookDir; break;
case KeyCode.Left: lookAngle += (float)(speed * Display.DeltaTime / 1000.0f); break;
case KeyCode.Right: lookAngle -= (float)(speed * Display.DeltaTime / 1000.0f); break;
+ case KeyCode.L: lightEnable = !lightEnable; break;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-20 06:38:38
|
Revision: 1102
http://agate.svn.sourceforge.net/agate/?rev=1102&view=rev
Author: kanato
Date: 2009-11-20 06:38:29 +0000 (Fri, 20 Nov 2009)
Log Message:
-----------
Added PositionTextureColorNormal vertex layout.
Corrected PositionTextureNormal to be a struct.
Modified Paths:
--------------
branches/shaders/AgateLib/AgateLib.csproj
branches/shaders/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs
Added Paths:
-----------
branches/shaders/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs
Modified: branches/shaders/AgateLib/AgateLib.csproj
===================================================================
--- branches/shaders/AgateLib/AgateLib.csproj 2009-11-17 00:12:06 UTC (rev 1101)
+++ branches/shaders/AgateLib/AgateLib.csproj 2009-11-20 06:38:29 UTC (rev 1102)
@@ -107,6 +107,7 @@
<Compile Include="DisplayLib\Shaders\Implementation\Lighting3DImpl.cs" />
<Compile Include="DisplayLib\Shaders\Lighting2D.cs" />
<Compile Include="DisplayLib\Shaders\Lighting3D.cs" />
+ <Compile Include="Geometry\VertexTypes\PositionTextureColorNormal.cs" />
<Compile Include="IFileProvider.cs">
<SubType>Code</SubType>
</Compile>
Added: branches/shaders/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs
===================================================================
--- branches/shaders/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs (rev 0)
+++ branches/shaders/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs 2009-11-20 06:38:29 UTC (rev 1102)
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace AgateLib.Geometry.VertexTypes
+{
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PositionTextureColorNormal
+ {
+ public Vector3 Position;
+ public Vector2 TexCoord;
+ public int Color;
+ public Vector3 Normal;
+
+ public PositionTextureColorNormal(float x, float y, float z, Color color, float tu, float tv, float nx, float ny, float nz)
+ : this(x, y, z, color.ToArgb(), tu, tv, nx, ny, nz)
+ { }
+ public PositionTextureColorNormal(float x, float y, float z, int color, float tu, float tv, float nx, float ny, float nz)
+ {
+ Position = new Vector3(x, y, z);
+ TexCoord = new Vector2(tu, tv);
+ this.Color = color;
+ Normal = new Vector3(nx, ny, nz);
+ }
+
+ public float X { get { return Position.X; } set { Position.X = value; } }
+ public float Y { get { return Position.Y; } set { Position.Y = value; } }
+ public float Z { get { return Position.Z; } set { Position.Z = value; } }
+
+ public float U { get { return TexCoord.X; } set { TexCoord.X = value; } }
+ public float V { get { return TexCoord.Y; } set { TexCoord.Y = value; } }
+
+ public override string ToString()
+ {
+ return string.Format("X: {0} Y: {1} Z: {2} Color: {3} Tu: {4}, Tv: {5} Nx: {6} Ny: {7} Nz: {8}",
+ Position.X, Position.Y, Position.Z, Color, TexCoord.X, TexCoord.Y, Normal.X, Normal.Y, Normal.Z);
+ }
+
+ public static VertexLayout VertexLayout
+ {
+ get
+ {
+ return new VertexLayout
+ {
+ new VertexElementDesc(VertexElementDataType.Float3, VertexElement.Position),
+ new VertexElementDesc(VertexElementDataType.Float2, VertexElement.Texture),
+ new VertexElementDesc(VertexElementDataType.Int, VertexElement.DiffuseColor),
+ new VertexElementDesc(VertexElementDataType.Float3, VertexElement.Normal),
+ };
+ }
+ }
+ }
+
+}
Modified: branches/shaders/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs
===================================================================
--- branches/shaders/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs 2009-11-17 00:12:06 UTC (rev 1101)
+++ branches/shaders/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs 2009-11-20 06:38:29 UTC (rev 1102)
@@ -7,7 +7,7 @@
namespace AgateLib.Geometry.VertexTypes
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
- public class PositionTextureNormal
+ public struct PositionTextureNormal
{
public Vector3 Position;
public Vector2 Texture;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-17 01:27:58
|
Revision: 1101
http://agate.svn.sourceforge.net/agate/?rev=1101&view=rev
Author: kanato
Date: 2009-11-17 00:12:06 +0000 (Tue, 17 Nov 2009)
Log Message:
-----------
Use int overloads where possible, instead of casting to IntPtr.
Modified Paths:
--------------
branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs
branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs
Modified: branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs 2009-11-17 00:07:22 UTC (rev 1100)
+++ branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs 2009-11-17 00:12:06 UTC (rev 1101)
@@ -226,7 +226,7 @@
GL.TexCoordPointer(2, TexCoordPointerType.Float, size, (IntPtr) tex);
- GL.ColorPointer(4, ColorPointerType.UnsignedByte, size, (IntPtr)color);
+ GL.ColorPointer(4, ColorPointerType.UnsignedByte, size, color);
GL.VertexPointer(2, VertexPointerType.Float, size, pos);
GL.NormalPointer(NormalPointerType.Float, size, (IntPtr)norm);
Modified: branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs 2009-11-17 00:07:22 UTC (rev 1100)
+++ branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs 2009-11-17 00:12:06 UTC (rev 1101)
@@ -78,7 +78,7 @@
GL_IndexBuffer gl_indexbuffer = (GL_IndexBuffer) indexbuffer.Impl;
GL.BindBuffer(BufferTarget.ElementArrayBuffer, gl_indexbuffer.BufferID);
- GL.IndexPointer(IndexPointerType.Short, 0, (IntPtr)start);
+ GL.IndexPointer(IndexPointerType.Short, 0, start);
GL.BindBuffer(BufferTarget.ArrayBuffer, mVertexBufferID);
SetClientStates();
@@ -139,7 +139,7 @@
GL.EnableClientState(EnableCap.VertexArray);
GL.VertexPointer(
PositionSize / sizeof(float), VertexPointerType.Float, mLayout.VertexSize,
- (IntPtr)mLayout.ElementByteIndex(VertexElement.Position));
+ mLayout.ElementByteIndex(VertexElement.Position));
}
SetAttributes();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-17 00:07:33
|
Revision: 1100
http://agate.svn.sourceforge.net/agate/?rev=1100&view=rev
Author: kanato
Date: 2009-11-17 00:07:22 +0000 (Tue, 17 Nov 2009)
Log Message:
-----------
Switch GLDrawBuffer to use VBO's instead of client memory vertex arrays.
Modified Paths:
--------------
branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs
branches/shaders/Drivers/AgateOTK/GL_Display.cs
branches/shaders/Drivers/AgateOTK/OpenTK.dll.config
Modified: branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
===================================================================
--- branches/shaders/Drivers/AgateOTK/AgateOTK.csproj 2009-11-15 23:18:57 UTC (rev 1099)
+++ branches/shaders/Drivers/AgateOTK/AgateOTK.csproj 2009-11-17 00:07:22 UTC (rev 1100)
@@ -95,9 +95,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\AgateLib\AgateLib.csproj">
+ <Project>{9490B719-829E-43A7-A5FE-8001F8A81759}</Project>
<Name>AgateLib</Name>
- <Project>{1539806E-2473-4D67-9D10-F2CDC8C2B874}</Project>
- <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
</ProjectReference>
<ProjectReference Include="..\AgateLib.WinForms\AgateLib.WinForms.csproj">
<Name>AgateLib.WinForms</Name>
Modified: branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs 2009-11-15 23:18:57 UTC (rev 1099)
+++ branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs 2009-11-17 00:07:22 UTC (rev 1100)
@@ -24,6 +24,7 @@
using AgateLib;
using AgateLib.DisplayLib;
using AgateLib.Geometry;
+using AgateLib.Geometry.VertexTypes;
using OpenTK.Graphics.OpenGL;
@@ -78,35 +79,42 @@
#endregion
GLState mState;
+ PositionTextureColorNormal[] mVerts;
- TexCoord[] mTexCoords;
- ColorCoord[] mColorCoords;
- VertexCoord[] mVertexCoords;
- NormalCoord[] mNormalCoords;
-
int mIndex;
int mCurrentTexture;
InterpolationMode lastInterpolation = (InterpolationMode)(-1);
PointF[] cachePts = new PointF[4];
+ int mBufferID;
+
public GLDrawBuffer(GLState state)
{
mState = state;
+ GL.GenBuffers(1, out mBufferID );
+
SetBufferSize(1000);
}
private void SetBufferSize(int size)
{
- mTexCoords = new TexCoord[size];
- mColorCoords = new ColorCoord[size];
- mVertexCoords = new VertexCoord[size];
- mNormalCoords = new NormalCoord[size];
+ mVerts = new PositionTextureColorNormal[size];
mIndex = 0;
}
+
+ private void BufferData()
+ {
+ GL.BindBuffer(BufferTarget.ArrayBuffer, mBufferID);
+ GL.BufferData(BufferTarget.ArrayBuffer,
+ (IntPtr)(mIndex * Marshal.SizeOf(typeof(PositionTextureColorNormal))), mVerts,
+ BufferUsageHint.StaticDraw);
+
+ }
+
private void SetTexture(int textureID)
{
if (textureID == mCurrentTexture)
@@ -159,40 +167,36 @@
{
SetTexture(textureID);
- if (mIndex + 4 >= mVertexCoords.Length)
+ if (mIndex + 4 >= mVerts.Length)
{
Flush();
- SetBufferSize(mVertexCoords.Length + 1000);
+ SetBufferSize(mVerts.Length + 1000);
}
for (int i = 0; i < 4; i++)
{
- mVertexCoords[mIndex + i].x = pts[i].X;
- mVertexCoords[mIndex + i].y = pts[i].Y;
+ mVerts[mIndex + i].X = pts[i].X;
+ mVerts[mIndex + i].Y = pts[i].Y;
- mNormalCoords[mIndex + i].x = 0;
- mNormalCoords[mIndex + i].y = 0;
- mNormalCoords[mIndex + i].z = -1;
-
+ mVerts[mIndex + i].Normal = new Vector3(0, 0, -1);
}
- mTexCoords[mIndex].u = texCoord.Left;
- mTexCoords[mIndex].v = texCoord.Top;
- mColorCoords[mIndex] = new ColorCoord(color.TopLeft);
+ mVerts[mIndex].U = texCoord.Left;
+ mVerts[mIndex].V = texCoord.Top;
+ mVerts[mIndex].Color = color.TopLeft.ToArgb();
- mTexCoords[mIndex + 1].u = texCoord.Right;
- mTexCoords[mIndex + 1].v = texCoord.Top;
- mColorCoords[mIndex + 1] = new ColorCoord(color.TopRight);
+ mVerts[mIndex+1].U = texCoord.Right;
+ mVerts[mIndex+1].V = texCoord.Top;
+ mVerts[mIndex + 1].Color = color.TopRight.ToArgb();
- mTexCoords[mIndex + 2].u = texCoord.Right;
- mTexCoords[mIndex + 2].v = texCoord.Bottom;
- mColorCoords[mIndex + 2] = new ColorCoord(color.BottomRight);
+ mVerts[mIndex + 2].U = texCoord.Right;
+ mVerts[mIndex + 2].V = texCoord.Bottom;
+ mVerts[mIndex + 2].Color = color.BottomRight.ToArgb();
- mTexCoords[mIndex + 3].u = texCoord.Left;
- mTexCoords[mIndex + 3].v = texCoord.Bottom;
- mColorCoords[mIndex + 3] = new ColorCoord(color.BottomLeft);
+ mVerts[mIndex + 3].U = texCoord.Left;
+ mVerts[mIndex + 3].V = texCoord.Bottom;
+ mVerts[mIndex + 3].Color = color.BottomLeft.ToArgb();
-
mIndex += 4;
}
@@ -202,23 +206,30 @@
if (mIndex == 0)
return;
+ BufferData();
+
GL.BindTexture(TextureTarget.Texture2D, mCurrentTexture);
SetGLInterpolation();
+ GL.BindBuffer(BufferTarget.ArrayBuffer, mBufferID);
GL.EnableClientState(EnableCap.TextureCoordArray);
GL.EnableClientState(EnableCap.ColorArray);
GL.EnableClientState(EnableCap.VertexArray);
GL.EnableClientState(EnableCap.NormalArray);
- GL.TexCoordPointer(2, TexCoordPointerType.Float,
- Marshal.SizeOf(typeof(TexCoord)), mTexCoords);
- GL.ColorPointer(4, ColorPointerType.Float,
- Marshal.SizeOf(typeof(ColorCoord)), mColorCoords);
- GL.VertexPointer(2, VertexPointerType.Float,
- Marshal.SizeOf(typeof(VertexCoord)), mVertexCoords);
- GL.NormalPointer(NormalPointerType.Float,
- Marshal.SizeOf(typeof(NormalCoord)), mNormalCoords);
+ int size = Marshal.SizeOf(typeof(PositionTextureColorNormal));
+ int tex = PositionTextureColorNormal.VertexLayout.ElementByteIndex(VertexElement.Texture);
+ int color = PositionTextureColorNormal.VertexLayout.ElementByteIndex(VertexElement.DiffuseColor);
+ int pos = PositionTextureColorNormal.VertexLayout.ElementByteIndex(VertexElement.Position);
+ int norm = PositionTextureColorNormal.VertexLayout.ElementByteIndex(VertexElement.Normal);
+
+
+ GL.TexCoordPointer(2, TexCoordPointerType.Float, size, (IntPtr) tex);
+ GL.ColorPointer(4, ColorPointerType.UnsignedByte, size, (IntPtr)color);
+ GL.VertexPointer(2, VertexPointerType.Float, size, pos);
+ GL.NormalPointer(NormalPointerType.Float, size, (IntPtr)norm);
+
GL.DrawArrays(BeginMode.Quads, 0, mIndex);
mIndex = 0;
@@ -252,24 +263,5 @@
break;
}
}
-
- private void oldFlush()
- {
-
- GL.BindTexture(TextureTarget.Texture2D, mCurrentTexture);
-
- GL.Begin(BeginMode.Quads);
-
- for (int i = 0; i < mIndex; i++)
- {
- GL.Color4(mColorCoords[i].r, mColorCoords[i].g, mColorCoords[i].b, mColorCoords[i].a);
- GL.TexCoord2(mTexCoords[i].u, mTexCoords[i].v);
- GL.Vertex2(mVertexCoords[i].x, mVertexCoords[i].y);
- }
-
- GL.End();
-
- mIndex = 0;
- }
}
}
Modified: branches/shaders/Drivers/AgateOTK/GL_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-15 23:18:57 UTC (rev 1099)
+++ branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-17 00:07:22 UTC (rev 1100)
@@ -366,9 +366,9 @@
public override void Initialize()
{
+ CreateFakeWindow();
mState = new GLState();
- CreateFakeWindow();
-
+
Report("OpenTK / OpenGL driver instantiated for display.");
}
public void InitializeCurrentContext()
Modified: branches/shaders/Drivers/AgateOTK/OpenTK.dll.config
===================================================================
--- branches/shaders/Drivers/AgateOTK/OpenTK.dll.config 2009-11-15 23:18:57 UTC (rev 1099)
+++ branches/shaders/Drivers/AgateOTK/OpenTK.dll.config 2009-11-17 00:07:22 UTC (rev 1100)
@@ -6,6 +6,6 @@
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
- <dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
+ <dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
</configuration>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-15 23:19:47
|
Revision: 1099
http://agate.svn.sourceforge.net/agate/?rev=1099&view=rev
Author: kanato
Date: 2009-11-15 23:18:57 +0000 (Sun, 15 Nov 2009)
Log Message:
-----------
Update to OpenTK 1.0 beta.
Modified Paths:
--------------
branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.dll
branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.dll.config
branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.xml
branches/shaders/Drivers/AgateOTK/OpenTK.dll
branches/shaders/Drivers/AgateOTK/OpenTK.dll.config
Modified: branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
===================================================================
--- branches/shaders/Drivers/AgateOTK/AgateOTK.csproj 2009-11-15 23:09:42 UTC (rev 1098)
+++ branches/shaders/Drivers/AgateOTK/AgateOTK.csproj 2009-11-15 23:18:57 UTC (rev 1099)
@@ -200,6 +200,7 @@
<Content Include="OpenTK.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="OpenTK.GLControl.xml" />
<Content Include="OpenTK.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Modified: branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.dll
===================================================================
(Binary files differ)
Modified: branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.dll.config
===================================================================
--- branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.dll.config 2009-11-15 23:09:42 UTC (rev 1098)
+++ branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.dll.config 2009-11-15 23:18:57 UTC (rev 1099)
@@ -6,4 +6,6 @@
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
+ <dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
+ <dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
</configuration>
Modified: branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.xml
===================================================================
--- branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.xml 2009-11-15 23:09:42 UTC (rev 1098)
+++ branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.xml 2009-11-15 23:18:57 UTC (rev 1099)
@@ -4,3167 +4,46612 @@
<name>OpenTK.Compatibility</name>
</assembly>
<members>
- <member name="T:OpenTK.Math.Vector2">
- <summary>Represents a 2D vector using two single-precision floating-point numbers.</summary>
- <remarks>
- The Vector2 structure is suitable for interoperation with unmanaged code requiring two consecutive floats.
- </remarks>
+ <member name="T:Tao.Platform.Windows.SimpleOpenGlControl">
+ <summary>
+ Provides a simple OpenGL control allowing quick development of Windows.Forms-based
+ OpenGL applications. Relies on OpenTK.GLControl for cross-platform compatibility.
+ </summary>
</member>
- <member name="F:OpenTK.Math.Vector2.X">
+ <member name="F:Tao.Platform.Windows.SimpleOpenGlControl.components">
+ <summary>
+ Required designer variable.
+ </summary>
+ </member>
+ <member name="M:Tao.Platform.Windows.SimpleOpenGlControl.Dispose(System.Boolean)">
+ <summary>
+ Clean up any resources being used.
+ </summary>
+ <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ </member>
+ <member name="M:Tao.Platform.Windows.SimpleOpenGlControl.InitializeComponent">
+ <summary>
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+ </summary>
+ </member>
+ <member name="M:Tao.Platform.Windows.SimpleOpenGlControl.#ctor">
<summary>
- The X component of the Vector2.
+ Constructor. Creates contexts and sets properties.
</summary>
</member>
- <member name="F:OpenTK.Math.Vector2.Y">
+ <member name="M:Tao.Platform.Windows.SimpleOpenGlControl.DestroyContexts">
<summary>
- The Y component of the Vector2.
+
</summary>
</member>
- <member name="M:OpenTK.Math.Vector2.#ctor(System.Single,System.Single)">
+ <member name="M:Tao.Platform.Windows.SimpleOpenGlControl.Draw">
<summary>
- Constructs a new Vector2.
+ Sends an see cref="UserControl.Invalidate" command to this control, thus
+ forcing a redraw to occur.
</summary>
- <param name="x">The x coordinate of the net Vector2.</param>
- <param name="y">The y coordinate of the net Vector2.</param>
</member>
- <member name="M:OpenTK.Math.Vector2.#ctor(OpenTK.Math.Vector2)">
+ <member name="M:Tao.Platform.Windows.SimpleOpenGlControl.InitializeContexts">
<summary>
- Constructs a new Vector2 from the given Vector2.
+ Creates the OpenGL contexts.
</summary>
- <param name="v">The Vector2 to copy components from.</param>
</member>
- <member name="M:OpenTK.Math.Vector2.#ctor(OpenTK.Math.Vector3)">
+ <member name="M:Tao.Platform.Windows.SimpleOpenGlControl.OnPaint(System.Windows.Forms.PaintEventArgs)">
<summary>
- Constructs a new Vector2 from the given Vector3.
+ Paints the control.
</summary>
- <param name="v">The Vector3 to copy components from. Z is discarded.</param>
+ <param name="e">The paint event arguments.</param>
</member>
- <member name="M:OpenTK.Math.Vector2.#ctor(OpenTK.Math.Vector4)">
+ <member name="M:Tao.Platform.Windows.SimpleOpenGlControl.InitializeBackground">
<summary>
- Constructs a new Vector2 from the given Vector4.
+ Loads the bitmap from the assembly's manifest resource.
</summary>
- <param name="v">The Vector4 to copy components from. Z and W are discarded.</param>
</member>
- <member name="M:OpenTK.Math.Vector2.Add(OpenTK.Math.Vector2)">
- <summary>Add the Vector passed as parameter to this instance.</summary>
- <param name="right">Right operand. This parameter is only read from.</param>
+ <member name="M:Tao.Platform.Windows.SimpleOpenGlControl.InitializeStyles">
+ <summary>
+ Initializes the control's styles.
+ </summary>
</member>
- <member name="M:OpenTK.Math.Vector2.Add(OpenTK.Math.Vector2@)">
- <summary>Add the Vector passed as parameter to this instance.</summary>
- <param name="right">Right operand. This parameter is only read from.</param>
+ <member name="P:Tao.Platform.Windows.SimpleOpenGlControl.LogScaleX">
+ <summary>
+ Gets the number of logical pixels or dots per inch (dpi) in X-direction
+ </summary>
</member>
- <member name="M:OpenTK.Math.Vector2.Sub(OpenTK.Math.Vector2)">
- <summary>Subtract the Vector passed as parameter from this instance.</summary>
- <param name="right">Right operand. This parameter is only read from.</param>
+ <member name="P:Tao.Platform.Windows.SimpleOpenGlControl.LogScaleY">
+ <summary>
+ Gets the number of logical pixels or dots per inch (dpi) in Y-direction
+ </summary>
</member>
- <member name="M:OpenTK.Math.Vector2.Sub(OpenTK.Math.Vector2@)">
- <summary>Subtract the Vector passed as parameter from this instance.</summary>
- <param name="right">Right operand. This parameter is only read from.</param>
+ <member name="P:Tao.Platform.Windows.SimpleOpenGlControl.AccumBits">
+ <summary>
+ Gets and sets the OpenGL control's accumulation buffer depth.
+ </summary>
</member>
- <member name="M:OpenTK.Math.Vector2.Mult(System.Single)">
- <summary>Multiply this instance by a scalar.</summary>
- <param name="f">Scalar operand.</param>
+ <member name="P:Tao.Platform.Windows.SimpleOpenGlControl.ColorBits">
+ <summary>
+ Gets and sets the OpenGL control's color buffer depth.
+ </summary>
</member>
- <member name="M:OpenTK.Math.Vector2.Div(System.Single)">
- <summary>Divide this instance by a scalar.</summary>
- <param name="f">Scalar operand.</param>
+ <member name="P:Tao.Platform.Windows.SimpleOpenGlControl.DepthBits">
+ <summary>
+ Gets and sets the OpenGL control's depth buffer (Z-buffer) depth.
+ </summary>
</member>
- <member name="M:OpenTK.Math.Vector2.Normalize">
+ <member name="P:Tao.Platform.Windows.SimpleOpenGlControl.StencilBits">
<summary>
- Scales the Vector2 to unit length.
+ Gets and sets the OpenGL control's stencil buffer depth.
</summary>
</member>
- <member name="M:OpenTK.Math.Vector2.NormalizeFast">
+ <member name="P:Tao.Platform.Windows.SimpleOpenGlControl.AutoCheckErrors">
<summary>
- Scales the Vector2 to approximately unit length.
+ Gets and sets the OpenGL control's automatic sending of a glGetError command
+ after drawing.
</summary>
</member>
- <member name="M:OpenTK.Math.Vector2.Scale(System.Single,System.Single)">
+ <member name="P:Tao.Platform.Windows.SimpleOpenGlControl.AutoFinish">
<summary>
- Scales the current Vector2 by the given amounts.
+ Gets and sets the OpenGL control's automatic sending of a glFinish command
+ after drawing.
</summary>
- <param name="sx">The scale of the X component.</param>
- <param name="sy">The scale of the Y component.</param>
</member>
- <member name="M:OpenTK.Math.Vector2.Scale(OpenTK.Math.Vector2)">
- <summary>Scales this instance by the given parameter.</summary>
- <param name="scale">The scaling of the individual components.</param>
+ <member name="P:Tao.Platform.Windows.SimpleOpenGlControl.AutoMakeCurrent">
+ <summary>
+ Gets and sets the OpenGL control's automatic forcing of the rendering context to
+ be current before drawing.
+ </summary>
</member>
- <member name="M:OpenTK.Math.Vector2.Scale(OpenTK.Math.Vector2@)">
- <summary>Scales this instance by the given parameter.</summary>
- <param name="scale">The scaling of the individual components.</param>
+ <member name="P:Tao.Platform.Windows.SimpleOpenGlControl.AutoSwapBuffers">
+ <summary>
+ Gets and sets the OpenGL control's automatic sending of a SwapBuffers command
+ after drawing.
+ </summary>
</member>
- <member name="F:OpenTK.Math.Vector2.UnitX">
+ <member name="P:Tao.Platform.Windows.SimpleOpenGlControl.CreateParams">
<summary>
- Defines a unit-length Vector2 that points towards the X-axis.
+ Overrides the control's class style parameters.
</summary>
</member>
- <member name="F:OpenTK.Math.Vector2.UnitY">
+ <member name="T:Tao.OpenGl.Gl">
<summary>
- Defines a unit-length Vector2 that points towards the Y-axis.
+ OpenGL binding for .NET, implementing OpenGL 2.1, plus extensions.
</summary>
+ <remarks>
+ <para>
+ This class contains all OpenGL enums and functions defined in the 2.1 specification.
+ The official .spec files can be found at: http://opengl.org/registry/.
+ </para>
+ <para>
+ We rely on static initialization to obtain the entry points for OpenGL functions.
+ Please ensure that a valid OpenGL context has been made current in the pertinent thread <b>before</b>
+ any OpenGL functions are called (toolkits like GLUT, SDL or GLFW will automatically take care of
+ the context initialization process). Without a valid OpenGL context, we will only be able
+ to retrieve statically exported entry points (typically corresponding to OpenGL version 1.1 under Windows,
+ 1.3 under Linux and 1.4 under Windows Vista), and extension methods will need to be loaded manually.
+ </para>
+ <para>
+ If you prefer to have more control on extension loading, you can use the
+ ReloadFunctions or ReloadFunction methods to manually force the initialisation of OpenGL entry points.
+ The ReloadFunctions method should be called whenever you change an existing visual or pixelformat. This
+ generally happens when you change the color/stencil/depth buffer associated with a window (but probably
+ not the resolution). This may or may not be necessary under Linux/MacOS, but is generally required for
+ Windows.
+ </para>
+ <para>
+ You can use the Gl.IsExtensionSupported method to check whether any given category of extension functions
+ exists in the current OpenGL context. The results can be cached to speed up future searches.
+ Keep in mind that different OpenGL contexts may support different extensions, and under different entry
+ points. Always check if all required extensions are still supported when changing visuals or pixel
+ formats.
+ </para>
+ <para>
+ You may retrieve the entry point for an OpenGL function using the Gl.GetDelegate method.
+ </para>
+ <para>
+ <see href="http://opengl.org/registry/"/>
+ <seealso cref="M:Tao.OpenGl.Gl.IsExtensionSupported(System.String)"/>
+ <seealso cref="M:Tao.OpenGl.Gl.GetDelegate(System.String,System.Type)"/>
+ <seealso cref="M:Tao.OpenGl.Gl.ReloadFunctions"/>
+ </para>
+ </remarks>
</member>
- <member name="F:OpenTK.Math.Vector2.Zero">
+ <member name="M:Tao.OpenGl.Gl.IsExtensionSupported(System.String)">
<summary>
- Defines a zero-length Vector2.
+ Determines whether the specified OpenGL extension category is available in
+ the current OpenGL context. Equivalent to IsExtensionSupported(name, true)
</summary>
+ <param name="name">The string for the OpenGL extension category (eg. "GL_ARB_multitexture")</param>
+ <returns>True if the specified extension is available, false otherwise.</returns>
</member>
- <member name="F:OpenTK.Math.Vector2.One">
+ <member name="M:Tao.OpenGl.Gl.GetDelegate(System.String,System.Type)">
<summary>
- Defines an instance with all components set to 1.
+ Creates a System.Delegate that can be used to call an OpenGL function, core or extension.
</summary>
+ <param name="name">The name of the OpenGL function (eg. "glNewList")</param>
+ <param name="signature">The signature of the OpenGL function.</param>
+ <returns>
+ A System.Delegate that can be used to call this OpenGL function, or null if the specified
+ function name did not correspond to an OpenGL function.
+ </returns>
</member>
- <member name="F:OpenTK.Math.Vector2.SizeInBytes">
+ <member name="M:Tao.OpenGl.Gl.ReloadFunctions">
<summary>
- Defines the size of the Vector2 struct in bytes.
+ Loads all OpenGL functions (core and extensions).
</summary>
+ <remarks>
+ <para>
+ This function will be automatically called the first time you use any opengl function. There is
+ </para>
+ <para>
+ Call this function manually whenever you need to update OpenGL entry points.
+ This need may arise if you change the pixelformat/visual, or in case you cannot
+ (or do not want) to use the automatic initialization of the GL class.
+ </para>
+ </remarks>
</member>
- <member name="M:OpenTK.Math.Vector2.Add(OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="M:Tao.OpenGl.Gl.Load(System.String)">
<summary>
- Add the specified instances
+ Tries to reload the given OpenGL function (core or extension).
</summary>
- <param name="a">First operand</param>
- <param name="b">Second operand</param>
- <returns>Result of addition</returns>
+ <param name="function">The name of the OpenGL function (i.e. glShaderSource)</param>
+ <returns>True if the function was found and reloaded, false otherwise.</returns>
+ <remarks>
+ <para>
+ Use this function if you require greater granularity when loading OpenGL entry points.
+ </para>
+ <para>
+ While the automatic initialisation will load all OpenGL entry points, in some cases
+ the initialisation can take place before an OpenGL Context has been established.
+ In this case, use this function to load the entry points for the OpenGL functions
+ you will need, or use ReloadFunctions() to load all available entry points.
+ </para>
+ <para>
+ This function returns true if the given OpenGL function is supported, false otherwise.
+ </para>
+ <para>
+ To query for supported extensions use the IsExtensionSupported() function instead.
+ </para>
+ </remarks>
</member>
- <member name="M:OpenTK.Math.Vector2.Add(OpenTK.Math.Vector2@,OpenTK.Math.Vector2@,OpenTK.Math.Vector2@)">
+ <member name="M:Tao.OpenGl.Gl.BuildExtensionList">
<summary>
- Add two Vectors
+ Builds a cache of all supported extensions.
</summary>
- <param name="a">First operand</param>
- <param name="b">Second operand</param>
- <param name="result">Result of addition</param>
</member>
- <member name="M:OpenTK.Math.Vector2.Sub(OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="M:Tao.OpenGl.Gl.GetAddress(System.String)">
<summary>
- Subtract one Vector from another
+ Retrieves the entry point for a dynamically exported OpenGL function.
</summary>
- <param name="a">First operand</param>
- <param name="b">Second operand</param>
- <returns>Result of subtraction</returns>
+ <param name="function">The function string for the OpenGL function (eg. "glNewList")</param>
+ <returns>
+ An IntPtr contaning the address for the entry point, or IntPtr.Zero if the specified
+ OpenGL function is not dynamically exported.
+ </returns>
+ <remarks>
+ <para>
+ The Marshal.GetDelegateForFunctionPointer method can be used to turn the return value
+ into a call-able delegate.
+ </para>
+ <para>
+ This function is cross-platform. It determines the underlying platform and uses the
+ correct wgl, glx or agl GetAddress function to retrieve the function pointer.
+ </para>
+ <see cref="M:System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(System.IntPtr,System.Type)"/>
+ </remarks>
</member>
- <member name="M:OpenTK.Math.Vector2.Sub(OpenTK.Math.Vector2@,OpenTK.Math.Vector2@,OpenTK.Math.Vector2@)">
+ <member name="M:Tao.OpenGl.Gl.DetectUnixKernel">
<summary>
- Subtract one Vector from another
+ Executes "uname" which returns a string representing the name of the
+ underlying Unix kernel.
</summary>
- <param name="a">First operand</param>
- <param name="b">Second operand</param>
- <param name="result">Result of subtraction</param>
+ <returns>"Unix", "Linux", "Darwin" or null.</returns>
+ <remarks>Source code from "Mono: A Developer's Notebook"</remarks>
</member>
- <member name="M:OpenTK.Math.Vector2.Mult(OpenTK.Math.Vector2,System.Single)">
+ <member name="M:Tao.OpenGl.Gl.GetExtensionDelegate(System.String,System.Type)">
<summary>
- Multiply a vector and a scalar
+ Creates a System.Delegate that can be used to call a dynamically exported OpenGL function.
</summary>
- <param name="a">Vector operand</param>
- <param name="f">Scalar operand</param>
- <returns>Result of the multiplication</returns>
+ <param name="name">The name of the OpenGL function (eg. "glNewList")</param>
+ <param name="signature">The signature of the OpenGL function.</param>
+ <returns>
+ A System.Delegate that can be used to call this OpenGL function or null
+ if the function is not available in the current OpenGL context.
+ </returns>
</member>
- <member name="M:OpenTK.Math.Vector2.Mult(OpenTK.Math.Vector2@,System.Single,OpenTK.Math.Vector2@)">
+ <member name="T:Tao.OpenGl.Gl.Imports">
<summary>
- Multiply a vector and a scalar
+ Contains DllImports for the core OpenGL functions.
</summary>
- <param name="a">Vector operand</param>
- <param name="f">Scalar operand</param>
- <param name="result">Result of the multiplication</param>
</member>
- <member name="M:OpenTK.Math.Vector2.Div(OpenTK.Math.Vector2,System.Single)">
+ <member name="F:Tao.OpenGl.Gl.Imports.FunctionMap">
<summary>
- Divide a vector by a scalar
+ Build a string->MethodInfo map to speed up extension loading.
</summary>
- <param name="a">Vector operand</param>
- <param name="f">Scalar operand</param>
- <returns>Result of the division</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.Div(OpenTK.Math.Vector2@,System.Single,OpenTK.Math.Vector2@)">
+ <member name="M:OpenTK.Graphics.Text.Glyph.#ctor(System.Char,System.Drawing.Font)">
<summary>
- Divide a vector by a scalar
+ Constructs a new Glyph that represents the given character and Font.
</summary>
- <param name="a">Vector operand</param>
- <param name="f">Scalar operand</param>
- <param name="result">Result of the division</param>
+ <param name="c">The character to represent.</param>
+ <param name="font">The Font of the character.</param>
</member>
- <member name="M:OpenTK.Math.Vector2.ComponentMin(OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="M:OpenTK.Graphics.Text.Glyph.Equals(System.Object)">
<summary>
- Calculate the component-wise minimum of two vectors
+ Checks whether the given object is equal (memberwise) to the current Glyph.
</summary>
- <param name="a">First operand</param>
- <param name="b">Second operand</param>
- <returns>The component-wise minimum</returns>
+ <param name="obj">The obj to check.</param>
+ <returns>True, if the object is identical to the current Glyph.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.ComponentMin(OpenTK.Math.Vector2@,OpenTK.Math.Vector2@,OpenTK.Math.Vector2@)">
+ <member name="M:OpenTK.Graphics.Text.Glyph.ToString">
<summary>
- Calculate the component-wise minimum of two vectors
+ Describes this Glyph object.
</summary>
- <param name="a">First operand</param>
- <param name="b">Second operand</param>
- <param name="result">The component-wise minimum</param>
+ <returns>Returns a System.String describing this Glyph.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.ComponentMax(OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="M:OpenTK.Graphics.Text.Glyph.GetHashCode">
<summary>
- Calculate the component-wise maximum of two vectors
+ Calculates the hashcode for this Glyph.
</summary>
- <param name="a">First operand</param>
- <param name="b">Second operand</param>
- <returns>The component-wise maximum</returns>
+ <returns>A System.Int32 containing a hashcode that uniquely identifies this Glyph.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.ComponentMax(OpenTK.Math.Vector2@,OpenTK.Math.Vector2@,OpenTK.Math.Vector2@)">
+ <member name="P:OpenTK.Graphics.Text.Glyph.Character">
<summary>
- Calculate the component-wise maximum of two vectors
+ Gets the character represented by this Glyph.
</summary>
- <param name="a">First operand</param>
- <param name="b">Second operand</param>
- <param name="result">The component-wise maximum</param>
</member>
- <member name="M:OpenTK.Math.Vector2.Min(OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="P:OpenTK.Graphics.Text.Glyph.Font">
<summary>
- Returns the Vector3 with the minimum magnitude
+ Gets the Font of this Glyph.
</summary>
- <param name="left">Left operand</param>
- <param name="right">Right operand</param>
- <returns>The minimum Vector3</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.Max(OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="T:OpenTK.Graphics.IGraphicsResource">
<summary>
- Returns the Vector3 with the minimum magnitude
+ Defines a common interface to all OpenGL resources.
</summary>
- <param name="left">Left operand</param>
- <param name="right">Right operand</param>
- <returns>The minimum Vector3</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.Clamp(OpenTK.Math.Vector2,OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="P:OpenTK.Graphics.IGraphicsResource.Context">
<summary>
- Clamp a vector to the given minimum and maximum vectors
+ Gets the GraphicsContext that owns this resource.
</summary>
- <param name="vec">Input vector</param>
- <param name="min">Minimum vector</param>
- <param name="max">Maximum vector</param>
- <returns>The clamped vector</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.Clamp(OpenTK.Math.Vector2@,OpenTK.Math.Vector2@,OpenTK.Math.Vector2@,OpenTK.Math.Vector2@)">
+ <member name="P:OpenTK.Graphics.IGraphicsResource.Id">
<summary>
- Clamp a vector to the given minimum and maximum vectors
+ Gets the Id of this IGraphicsResource.
</summary>
- <param name="vec">Input vector</param>
- <param name="min">Minimum vector</param>
- <param name="max">Maximum vector</param>
- <param name="result">The clamped vector</param>
</member>
- <member name="M:OpenTK.Math.Vector2.Normalize(OpenTK.Math.Vector2)">
+ <member name="P:OpenTK.Graphics.Texture2D.Width">
+ <summary>Gets the width of the texture.</summary>
+ </member>
+ <member name="P:OpenTK.Graphics.Texture2D.Height">
+ <summary>Gets the height of the texture.</summary>
+ </member>
+ <member name="T:OpenTK.Compatibility.Properties.Resources">
<summary>
- Scale a vector to unit length
+ A strongly-typed resource class, for looking up localized strings, etc.
</summary>
- <param name="vec">The input vector</param>
- <returns>The normalized vector</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.Normalize(OpenTK.Math.Vector2@,OpenTK.Math.Vector2@)">
+ <member name="P:OpenTK.Compatibility.Properties.Resources.ResourceManager">
<summary>
- Scale a vector to unit length
+ Returns the cached ResourceManager instance used by this class.
</summary>
- <param name="vec">The input vector</param>
- <param name="result">The normalized vector</param>
</member>
- <member name="M:OpenTK.Math.Vector2.NormalizeFast(OpenTK.Math.Vector2)">
+ <member name="P:OpenTK.Compatibility.Properties.Resources.Culture">
<summary>
- Scale a vector to approximately unit length
+ Overrides the current thread's CurrentUICulture property for all
+ resource lookups using this strongly typed resource class.
</summary>
- <param name="vec">The input vector</param>
- <returns>The normalized vector</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.NormalizeFast(OpenTK.Math.Vector2@,OpenTK.Math.Vector2@)">
+ <member name="T:Tao.OpenGl.Glu">
<summary>
- Scale a vector to approximately unit length
+ GLU (OpenGL Utility) binding for .NET, implementing GLU 1.3.
</summary>
- <param name="vec">The input vector</param>
- <param name="result">The normalized vector</param>
+ <remarks>
+ <para>
+ Binds functions and definitions in glu32.dll or libGLU.so.
+ </para>
+ <para>
+ The OpenGL Utility (GLU) library contains several groups of functions that
+ complement the core OpenGL interface by providing support for auxiliary features.
+ These features include: mipmapping, matrix manipulation, polygon tessellation,
+ quadrics, NURBS, and error handling.
+ </para>
+ <para>
+ Mipmapping routines include image scaling and automatic mipmap generation. A
+ variety of matrix manipulation functions build projection and viewing matrices,
+ or project vertices from one coordinate system to another. Polygon tessellation
+ routines convert concave polygons into triangles for easy rendering. Quadrics
+ support renders a few basic quadrics such as spheres and cones. NURBS code maps
+ complicated NURBS curves and trimmed surfaces into simpler OpenGL evaluators.
+ Lastly, an error lookup routine translates OpenGL and GLU error codes into
+ strings. GLU library routines may call OpenGL library routines. Thus, an OpenGL
+ context should be made current before calling any GLU functions. Otherwise an
+ OpenGL error may occur.
+ </para>
+ <para>
+ These utility functions make use of core OpenGL functions, so any OpenGL
+ implementation is guaranteed to support the utility functions.
+ </para>
+ </remarks>
</member>
- <member name="M:OpenTK.Math.Vector2.Dot(OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="F:Tao.OpenGl.Glu.CALLING_CONVENTION">
<summary>
- Calculate the dot (scalar) product of two vectors
+ Specifies the calling convention.
</summary>
- <param name="left">First operand</param>
- <param name="right">Second operand</param>
- <returns>The dot product of the two inputs</returns>
+ <remarks>
+ Specifies <see cref="F:System.Runtime.InteropServices.CallingConvention.Winapi"/> for Windows and
+ Linux, to indicate that the default should be used.
+ </remarks>
</member>
- <member name="M:OpenTK.Math.Vector2.Dot(OpenTK.Math.Vector2@,OpenTK.Math.Vector2@,System.Single@)">
+ <member name="F:Tao.OpenGl.Glu.GLU_VERSION_1_1">
<summary>
- Calculate the dot (scalar) product of two vectors
+ GLU API revision.
</summary>
- <param name="left">First operand</param>
- <param name="right">Second operand</param>
- <param name="result">The dot product of the two inputs</param>
+ <remarks>
+ Specifies GLU 1.1.
+ </remarks>
</member>
- <member name="M:OpenTK.Math.Vector2.Lerp(OpenTK.Math.Vector2,OpenTK.Math.Vector2,System.Single)">
+ <member name="F:Tao.OpenGl.Glu.GLU_VERSION_1_2">
<summary>
- Returns a new Vector that is the linear blend of the 2 given Vectors
+ GLU API revision.
</summary>
- <param name="a">First input vector</param>
- <param name="b">Second input vector</param>
- <param name="blend">The blend factor. a when blend=0, b when blend=1.</param>
- <returns>a when blend=0, b when blend=1, and a linear combination otherwise</returns>
+ <remarks>
+ Specifies GLU 1.2.
+ </remarks>
</member>
- <member name="M:OpenTK.Math.Vector2.Lerp(OpenTK.Math.Vector2@,OpenTK.Math.Vector2@,System.Single,OpenTK.Math.Vector2@)">
+ <member name="F:Tao.OpenGl.Glu.GLU_VERSION_1_3">
<summary>
- Returns a new Vector that is the linear blend of the 2 given Vectors
+ GLU API revision.
</summary>
- <param name="a">First input vector</param>
- <param name="b">Second input vector</param>
- <param name="blend">The blend factor. a when blend=0, b when blend=1.</param>
- <param name="result">a when blend=0, b when blend=1, and a linear combination otherwise</param>
+ <remarks>
+ Specifies GLU 1.3.
+ </remarks>
</member>
- <member name="M:OpenTK.Math.Vector2.BaryCentric(OpenTK.Math.Vector2,OpenTK.Math.Vector2,OpenTK.Math.Vector2,System.Single,System.Single)">
+ <member name="F:Tao.OpenGl.Glu.GLU_INVALID_ENUM">
<summary>
- Interpolate 3 Vectors using Barycentric coordinates
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="a">First input Vector</param>
- <param name="b">Second input Vector</param>
- <param name="c">Third input Vector</param>
- <param name="u">First Barycentric Coordinate</param>
- <param name="v">Second Barycentric Coordinate</param>
- <returns>a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.BaryCentric(OpenTK.Math.Vector2@,OpenTK.Math.Vector2@,OpenTK.Math.Vector2@,System.Single,System.Single,OpenTK.Math.Vector2@)">
- <summary>Interpolate 3 Vectors using Barycentric coordinates</summary>
- <param name="a">First input Vector.</param>
- <param name="b">Second input Vector.</param>
- <param name="c">Third input Vector.</param>
- <param name="u">First Barycentric Coordinate.</param>
- <param name="v">Second Barycentric Coordinate.</param>
- <param name="result">Output Vector. a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise</param>
+ <member name="F:Tao.OpenGl.Glu.GLU_INVALID_VALUE">
+ <summary>
+ Unknown. Unable to locate definitive documentation on this constant.
+ </summary>
</member>
- <member name="M:OpenTK.Math.Vector2.op_Addition(OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="F:Tao.OpenGl.Glu.GLU_OUT_OF_MEMORY">
<summary>
- Adds the specified instances.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="left">Left operand.</param>
- <param name="right">Right operand.</param>
- <returns>Result of addition.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.op_Subtraction(OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="F:Tao.OpenGl.Glu.GLU_INCOMPATIBLE_GL_VERSION">
<summary>
- Subtracts the specified instances.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="left">Left operand.</param>
- <param name="right">Right operand.</param>
- <returns>Result of subtraction.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.op_UnaryNegation(OpenTK.Math.Vector2)">
+ <member name="F:Tao.OpenGl.Glu.GLU_INVALID_OPERATION">
<summary>
- Negates the specified instance.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="vec">Operand.</param>
- <returns>Result of negation.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.op_Multiply(OpenTK.Math.Vector2,System.Single)">
+ <member name="F:Tao.OpenGl.Glu.GLU_VERSION">
<summary>
- Multiplies the specified instance by a scalar.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="vec">Left operand.</param>
- <param name="scale">Right operand.</param>
- <returns>Result of multiplication.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.op_Multiply(System.Single,OpenTK.Math.Vector2)">
+ <member name="F:Tao.OpenGl.Glu.GLU_EXTENSIONS">
<summary>
- Multiplies the specified instance by a scalar.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="scale">Left operand.</param>
- <param name="vec">Right operand.</param>
- <returns>Result of multiplication.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.op_Division(OpenTK.Math.Vector2,System.Single)">
+ <member name="F:Tao.OpenGl.Glu.GLU_TRUE">
<summary>
- Divides the specified instance by a scalar.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="vec">Left operand</param>
- <param name="scale">Right operand</param>
- <returns>Result of the division.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.op_Equality(OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="F:Tao.OpenGl.Glu.GLU_FALSE">
<summary>
- Compares the specified instances for equality.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="left">Left operand.</param>
- <param name="right">Right operand.</param>
- <returns>True if both instances are equal; false otherwise.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.op_Inequality(OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="F:Tao.OpenGl.Glu.GLU_SMOOTH">
<summary>
- Compares the specified instances for inequality.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="left">Left operand.</param>
- <param name="right">Right operand.</param>
- <returns>True if both instances are not equal; false otherwise.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.ToString">
+ <member name="F:Tao.OpenGl.Glu.GLU_FLAT">
<summary>
- Returns a System.String that represents the current Vector2.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <returns></returns>
</member>
- <member name="M:OpenTK.Math.Vector2.GetHashCode">
+ <member name="F:Tao.OpenGl.Glu.GLU_NONE">
<summary>
- Returns the hashcode for this instance.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.Equals(System.Object)">
+ <member name="F:Tao.OpenGl.Glu.GLU_POINT">
<summary>
- Indicates whether this instance and a specified object are equal.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="obj">The object to compare to.</param>
- <returns>True if the instances are equal; false otherwise.</returns>
</member>
- <member name="M:OpenTK.Math.Vector2.Equals(OpenTK.Math.Vector2)">
- <summary>Indicates whether the current vector is equal to another vector.</summary>
- <param name="other">A vector to compare with this vector.</param>
- <returns>true if the current vector is equal to the vector parameter; otherwise, false.</returns>
+ <member name="F:Tao.OpenGl.Glu.GLU_LINE">
+ <summary>
+ Unknown. Unable to locate definitive documentation on this constant.
+ </summary>
</member>
- <member name="P:OpenTK.Math.Vector2.Length">
+ <member name="F:Tao.OpenGl.Glu.GLU_FILL">
<summary>
- Gets the length (magnitude) of the vector.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <see cref="P:OpenTK.Math.Vector2.LengthFast"/>
- <seealso cref="P:OpenTK.Math.Vector2.LengthSquared"/>
</member>
- <member name="P:OpenTK.Math.Vector2.LengthFast">
+ <member name="F:Tao.OpenGl.Glu.GLU_SILHOUETTE">
<summary>
- Gets an approximation of the vector length (magnitude).
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <remarks>
- This property uses an approximation of the square root function to calculate vector magnitude, with
- an upper error bound of 0.001.
- </remarks>
- <see cref="P:OpenTK.Math.Vector2.Length"/>
- <seealso cref="P:OpenTK.Math.Vector2.LengthSquared"/>
</member>
- <member name="P:OpenTK.Math.Vector2.LengthSquared">
+ <member name="F:Tao.OpenGl.Glu.GLU_OUTSIDE">
<summary>
- Gets the square of the vector length (magnitude).
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <remarks>
- This property avoids the costly square root operation required by the Length property. This makes it more suitable
- for comparisons.
- </remarks>
- <see cref="P:OpenTK.Math.Vector2.Length"/>
- <seealso cref="P:OpenTK.Math.Vector2.LengthFast"/>
</member>
- <member name="P:OpenTK.Math.Vector2.PerpendicularRight">
+ <member name="F:Tao.OpenGl.Glu.GLU_INSIDE">
<summary>
- Gets the perpendicular vector on the right side of this vector.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="P:OpenTK.Math.Vector2.PerpendicularLeft">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_MAX_COORD">
<summary>
- Gets the perpendicular vector on the left side of this vector.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="T:OpenTK.Math.BezierCurveQuadric">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_WINDING_RULE">
<summary>
- Represents a quadric bezier curve with two anchor and one control point.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="F:OpenTK.Math.BezierCurveQuadric.StartAnchor">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_BOUNDARY_ONLY">
<summary>
- Start anchor point.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="F:OpenTK.Math.BezierCurveQuadric.EndAnchor">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_TOLERANCE">
<summary>
- End anchor point.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="F:OpenTK.Math.BezierCurveQuadric.ControlPoint">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_WINDING_ODD">
<summary>
- Control point, controls the direction of both endings of the curve.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="F:OpenTK.Math.BezierCurveQuadric.Parallel">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_WINDING_NONZERO">
<summary>
- The parallel value.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <remarks>This value defines whether the curve should be calculated as a
- parallel curve to the original bezier curve. A value of 0.0f represents
- the original curve, 5.0f i.e. stands for a curve that has always a distance
- of 5.f to the orignal curve at any point.</remarks>
</member>
- <member name="M:OpenTK.Math.BezierCurveQuadric.#ctor(OpenTK.Math.Vector2,OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_WINDING_POSITIVE">
<summary>
- Constructs a new <see cref="T:OpenTK.Math.BezierCurveQuadric"/>.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="startAnchor">The start anchor.</param>
- <param name="endAnchor">The end anchor.</param>
- <param name="controlPoint">The control point.</param>
</member>
- <member name="M:OpenTK.Math.BezierCurveQuadric.#ctor(System.Single,OpenTK.Math.Vector2,OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_WINDING_NEGATIVE">
<summary>
- Constructs a new <see cref="T:OpenTK.Math.BezierCurveQuadric"/>.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="parallel">The parallel value.</param>
- <param name="startAnchor">The start anchor.</param>
- <param name="endAnchor">The end anchor.</param>
- <param name="controlPoint">The control point.</param>
</member>
- <member name="M:OpenTK.Math.BezierCurveQuadric.CalculatePoint(System.Single)">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_WINDING_ABS_GEQ_TWO">
<summary>
- Calculates the point with the specified t.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="t">The t value, between 0.0f and 1.0f.</param>
- <returns>Resulting point.</returns>
</member>
- <member name="M:OpenTK.Math.BezierCurveQuadric.CalculatePointOfDerivative(System.Single)">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_BEGIN">
<summary>
- Calculates the point with the specified t of the derivative of this function.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="t">The t, value between 0.0f and 1.0f.</param>
- <returns>Resulting point.</returns>
</member>
- <member name="M:OpenTK.Math.BezierCurveQuadric.CalculateLength(System.Single)">
+ <member name="F:Tao.OpenGl.Glu.GLU_BEGIN">
<summary>
- Calculates the length of this bezier curve.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="precision">The precision.</param>
- <returns>Length of curve.</returns>
- <remarks>The precision gets better when the <paramref name="precision"/>
- value gets smaller.</remarks>
</member>
- <member name="T:OpenTK.Graphics.Glyph">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_VERTEX">
<summary>
- Represents a single character of a specific Font.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="T:OpenTK.IPackable`1">
+ <member name="F:Tao.OpenGl.Glu.GLU_VERTEX">
<summary>
- Represents an item that can be packed with the TexturePacker.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <typeparam name="T">The type of the packable item.</typeparam>
</member>
- <member name="M:OpenTK.Graphics.Glyph.Equals(System.Object)">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_END">
<summary>
- Checks whether the given object is equal (memberwise) to the current Glyph.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="obj">The obj to check.</param>
- <returns>True, if the object is identical to the current Glyph.</returns>
</member>
- <member name="M:OpenTK.Graphics.Glyph.ToString">
+ <member name="F:Tao.OpenGl.Glu.GLU_END">
<summary>
- Describes this Glyph object.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <returns>Returns a System.String describing this Glyph.</returns>
</member>
- <member name="M:OpenTK.Graphics.Glyph.GetHashCode">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_ERROR">
<summary>
- Calculates the hashcode for this Glyph.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <returns>A System.Int32 containing a hashcode that uniquely identifies this Glyph.</returns>
</member>
- <member name="M:OpenTK.Graphics.Glyph.Equals(OpenTK.Graphics.Glyph)">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_EDGE_FLAG">
<summary>
- Compares the current Glyph with the given Glyph.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="other">The Glyph to compare to.</param>
- <returns>True if both Glyphs represent the same character of the same Font, false otherwise.</returns>
</member>
- <member name="P:OpenTK.Graphics.Glyph.Character">
+ <member name="F:Tao.OpenGl.Glu.GLU_EDGE_FLAG">
<summary>
- Gets the character represented by this Glyph.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="P:OpenTK.Graphics.Glyph.Font">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_COMBINE">
<summary>
- Gets the Font of this Glyph.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="P:OpenTK.Graphics.Glyph.Size">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_BEGIN_DATA">
<summary>
- Gets the size of this Glyph.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="P:OpenTK.Graphics.Glyph.Rectangle">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_VERTEX_DATA">
<summary>
- Gets the bounding box of this Glyph.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="P:OpenTK.Graphics.Glyph.Width">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_END_DATA">
<summary>
- Gets an integer representing the width of the Glyph in pixels.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="P:OpenTK.Graphics.Glyph.Height">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_ERROR_DATA">
<summary>
- Gets an integer representing the height of the Glyph in pixels.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="T:OpenTK.Math.BezierCurveCubic">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_EDGE_FLAG_DATA">
<summary>
- Represents a cubic bezier curve with two anchor and two control points.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="F:OpenTK.Math.BezierCurveCubic.StartAnchor">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_COMBINE_DATA">
<summary>
- Start anchor point.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="F:OpenTK.Math.BezierCurveCubic.EndAnchor">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_ERROR1">
<summary>
- End anchor point.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="F:OpenTK.Math.BezierCurveCubic.FirstControlPoint">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_ERROR2">
<summary>
- First control point, controls the direction of the curve start.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="F:OpenTK.Math.BezierCurveCubic.SecondControlPoint">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_ERROR3">
<summary>
- Second control point, controls the direction of the curve end.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
</member>
- <member name="F:OpenTK.Math.BezierCurveCubic.Parallel">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_ERROR4">
<summary>
- Gets or sets the parallel value.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <remarks>This value defines whether the curve should be calculated as a
- parallel curve to the original bezier curve. A value of 0.0f represents
- the original curve, 5.0f i.e. stands for a curve that has always a distance
- of 5.f to the orignal curve at any point.</remarks>
</member>
- <member name="M:OpenTK.Math.BezierCurveCubic.#ctor(OpenTK.Math.Vector2,OpenTK.Math.Vector2,OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_ERROR5">
<summary>
- Constructs a new <see cref="T:OpenTK.Math.BezierCurveCubic"/>.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="startAnchor">The start anchor point.</param>
- <param name="endAnchor">The end anchor point.</param>
- <param name="firstControlPoint">The first control point.</param>
- <param name="secondControlPoint">The second control point.</param>
</member>
- <member name="M:OpenTK.Math.BezierCurveCubic.#ctor(System.Single,OpenTK.Math.Vector2,OpenTK.Math.Vector2,OpenTK.Math.Vector2,OpenTK.Math.Vector2)">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_ERROR6">
<summary>
- Constructs a new <see cref="T:OpenTK.Math.BezierCurveCubic"/>.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="parallel">The parallel value.</param>
- <param name="startAnchor">The start anchor point.</param>
- <param name="endAnchor">The end anchor point.</param>
- <param name="firstControlPoint">The first control point.</param>
- <param name="secondControlPoint">The second control point.</param>
</member>
- <member name="M:OpenTK.Math.BezierCurveCubic.CalculatePoint(System.Single)">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_ERROR7">
<summary>
- Calculates the point with the specified t.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="t">The t value, between 0.0f and 1.0f.</param>
- <returns>Resulting point.</returns>
</member>
- <member name="M:OpenTK.Math.BezierCurveCubic.CalculatePointOfDerivative(System.Single)">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_ERROR8">
<summary>
- Calculates the point with the specified t of the derivative of this function.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="t">The t, value between 0.0f and 1.0f.</param>
- <returns>Resulting point.</returns>
</member>
- <member name="M:OpenTK.Math.BezierCurveCubic.CalculateLength(System.Single)">
+ <member name="F:Tao.OpenGl.Glu.GLU_TESS_MISSING_BEGIN_POLYGON">
<summary>
- Calculates the length of this bezier curve.
+ Unknown. Unable to locate definitive documentation on this constant.
</summary>
- <param name="precision">The precision.</param>
- <returns>Length of the curve.</returns>
- <remarks>The precision gets better when the <paramref name="precision"/>
- value gets smaller.</remarks>
</member>
- <member name="T:OpenTK.Graphics.TextExtents">
+ <member name="F:Tao.OpenG...
[truncated message content] |
|
From: <ka...@us...> - 2009-11-15 23:09:49
|
Revision: 1098
http://agate.svn.sourceforge.net/agate/?rev=1098&view=rev
Author: kanato
Date: 2009-11-15 23:09:42 +0000 (Sun, 15 Nov 2009)
Log Message:
-----------
Include missing Lighting3DTest.cs file.
Added Paths:
-----------
branches/shaders/Tests/Shaders/Lighting3DTest.cs
Added: branches/shaders/Tests/Shaders/Lighting3DTest.cs
===================================================================
--- branches/shaders/Tests/Shaders/Lighting3DTest.cs (rev 0)
+++ branches/shaders/Tests/Shaders/Lighting3DTest.cs 2009-11-15 23:09:42 UTC (rev 1098)
@@ -0,0 +1,117 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib;
+using AgateLib.DisplayLib;
+using AgateLib.DisplayLib.Shaders;
+using AgateLib.InputLib;
+using AgateLib.Geometry;
+
+namespace Tests.Shaders
+{
+ class Lighting3DTest : IAgateTest
+ {
+ #region IAgateTest Members
+
+ public string Name
+ {
+ get { return "Lighting 3D"; }
+ }
+
+ public string Category
+ {
+ get { return "Shaders"; }
+ }
+
+ Vector3 eye = new Vector3(-3, 0, 2);
+ Vector3 up = new Vector3(0, 0, 1);
+ double lookAngle = 0;
+ double angle = 0;
+
+ public void Main(string[] args)
+ {
+ using (var setup = new AgateSetup())
+ {
+ setup.AskUser = true;
+ setup.Initialize(true, false, false);
+ if (setup.WasCanceled)
+ return;
+
+ Surface texture = new Surface("bg-bricks.png");
+ DisplayWindow wind = DisplayWindow.CreateWindowed("Lighting 3D", 640, 480);
+ FontSurface font = new FontSurface("Times", 14);
+
+ AgateLib.Geometry.Builders.CubeBuilder cb = new AgateLib.Geometry.Builders.CubeBuilder();
+ cb.Location = new Vector3();
+ cb.Length = 1;
+ cb.CreateVertexBuffer();
+
+ Keyboard.KeyDown += new InputEventHandler(Keyboard_KeyDown);
+
+ int frameCount = 0;
+
+ while (wind.IsClosed == false)
+ {
+ Display.BeginFrame();
+ Display.Clear(Color.Blue);
+
+ font.DrawText(0, 0, "Location: {0}", eye);
+ font.DrawText(0, font.FontHeight, "Angle: {0}", lookAngle);
+
+
+ var shader = AgateBuiltInShaders.Lighting3D;
+ shader.AmbientLight = Color.White;
+
+ Vector3 dir = LookDir;
+ Vector3 target = eye + dir * 3;
+ target.Z = 0;
+
+ shader.Projection = Matrix4x4.Projection(45, 640 / 480.0f, 1, 200);
+ shader.View = Matrix4x4.ViewLookAt(eye, target, up);
+ shader.World = Matrix4x4.RotateZ(angle);
+ shader.Activate();
+
+ cb.VertexBuffer.Textures[0] = texture;
+ cb.VertexBuffer.DrawIndexed(cb.IndexBuffer);
+
+ AgateBuiltInShaders.Basic2DShader.Activate();
+
+ Display.EndFrame();
+ Core.KeepAlive();
+
+ angle += 1 * Display.DeltaTime / 1000.0f;
+ if (angle > 6 * Math.PI) angle -= 6 * Math.PI;
+
+ frameCount++;
+
+ }
+ }
+ }
+
+ private Vector3 LookDir
+ {
+ get
+ {
+ Vector3 dir = new Vector3(Math.Cos(lookAngle), Math.Sin(lookAngle), 0);
+
+ return dir;
+ }
+ }
+
+ void Keyboard_KeyDown(InputEventArgs e)
+ {
+ const float speed = 3f;
+
+ switch (e.KeyCode)
+ {
+ case KeyCode.Up: eye += (float)(speed * Display.DeltaTime / 1000.0f) * LookDir; break;
+ case KeyCode.Down: eye -= (float)(speed * Display.DeltaTime / 1000.0f) * LookDir; break;
+ case KeyCode.Left: lookAngle += (float)(speed * Display.DeltaTime / 1000.0f); break;
+ case KeyCode.Right: lookAngle -= (float)(speed * Display.DeltaTime / 1000.0f); break;
+ }
+ }
+
+ #endregion
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-15 07:46:03
|
Revision: 1097
http://agate.svn.sourceforge.net/agate/?rev=1097&view=rev
Author: kanato
Date: 2009-11-15 07:45:55 +0000 (Sun, 15 Nov 2009)
Log Message:
-----------
Add PlatformDetection test.
Modified Paths:
--------------
branches/shaders/AgateLib/Core.cs
branches/shaders/AgateLib.sln
branches/shaders/Tests/Tests.csproj
Added Paths:
-----------
branches/shaders/Tests/CoreTests/PlatformDetection/
branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetection.Designer.cs
branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetection.cs
branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetection.resx
branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetector.cs
Removed Paths:
-------------
branches/shaders/Tests/CoreTests/PlatformDetection.Designer.cs
branches/shaders/Tests/CoreTests/PlatformDetection.cs
branches/shaders/Tests/CoreTests/PlatformDetection.resx
Modified: branches/shaders/AgateLib/Core.cs
===================================================================
--- branches/shaders/AgateLib/Core.cs 2009-11-15 06:06:01 UTC (rev 1096)
+++ branches/shaders/AgateLib/Core.cs 2009-11-15 07:45:55 UTC (rev 1097)
@@ -294,7 +294,7 @@
static Core()
{
- Initialize();
+ mPlatform = new Platform();
}
/// <summary>
/// Initializes Core class.
@@ -305,8 +305,6 @@
if (mInititalized)
return;
-
- mPlatform = new Platform();
Drivers.Registrar.Initialize();
@@ -314,8 +312,7 @@
}
/// <summary>
- /// Gets a Platform object which provides information about the current
- /// platform AgateLib is running on.
+ /// Gets an object which describes details about the current platform.
/// </summary>
public static Platform Platform
{
Modified: branches/shaders/AgateLib.sln
===================================================================
--- branches/shaders/AgateLib.sln 2009-11-15 06:06:01 UTC (rev 1096)
+++ branches/shaders/AgateLib.sln 2009-11-15 07:45:55 UTC (rev 1097)
@@ -1,18 +1,18 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateSDL", "Drivers\AgateSDL\AgateSDL.csproj", "{6ED4F92F-7C1F-478C-9AA1-938F47B68F22}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{DC687DB2-90A8-484D-AB99-B3D29FDD8D44}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateOTK", "Drivers\AgateOTK\AgateOTK.csproj", "{3F2BD363-E2D6-4B62-8D57-7727142D6B82}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateSDL", "Drivers\AgateSDL\AgateSDL.csproj", "{00C7FA95-98F4-43D9-9B63-34122B1DB003}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib", "AgateLib\AgateLib.csproj", "{BED5DD5D-13C6-4BA4-80DC-A47478E74F84}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateOTK", "Drivers\AgateOTK\AgateOTK.csproj", "{9E095F03-BA3F-4EAD-A905-2A2647CE4405}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateDrawing", "Drivers\AgateDrawing\AgateDrawing.csproj", "{AAC01466-7370-4464-B1AD-1593A3A3BEC1}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib", "AgateLib\AgateLib.csproj", "{9490B719-829E-43A7-A5FE-8001F8A81759}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.WinForms", "Drivers\AgateLib.WinForms\AgateLib.WinForms.csproj", "{2E6579F9-1F70-4DF9-98A9-22687425A830}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateDrawing", "Drivers\AgateDrawing\AgateDrawing.csproj", "{164A785D-924E-40FB-A517-D7E677F3B53A}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{CCA60063-264F-4B62-9B5D-45B9D0E3D6D8}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.WinForms", "Drivers\AgateLib.WinForms\AgateLib.WinForms.csproj", "{BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateFMOD", "Drivers\AgateFMOD\AgateFMOD.csproj", "{44C7FBC7-BFF6-4DEE-B891-82A043F548BD}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateFMOD", "Drivers\AgateFMOD\AgateFMOD.csproj", "{424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{0CE8B58F-922D-40A6-92E6-2F6913A97049}"
ProjectSection(SolutionItems) = preProject
@@ -27,34 +27,34 @@
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6ED4F92F-7C1F-478C-9AA1-938F47B68F22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6ED4F92F-7C1F-478C-9AA1-938F47B68F22}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6ED4F92F-7C1F-478C-9AA1-938F47B68F22}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6ED4F92F-7C1F-478C-9AA1-938F47B68F22}.Release|Any CPU.Build.0 = Release|Any CPU
- {3F2BD363-E2D6-4B62-8D57-7727142D6B82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3F2BD363-E2D6-4B62-8D57-7727142D6B82}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3F2BD363-E2D6-4B62-8D57-7727142D6B82}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3F2BD363-E2D6-4B62-8D57-7727142D6B82}.Release|Any CPU.Build.0 = Release|Any CPU
- {BED5DD5D-13C6-4BA4-80DC-A47478E74F84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BED5DD5D-13C6-4BA4-80DC-A47478E74F84}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BED5DD5D-13C6-4BA4-80DC-A47478E74F84}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BED5DD5D-13C6-4BA4-80DC-A47478E74F84}.Release|Any CPU.Build.0 = Release|Any CPU
- {AAC01466-7370-4464-B1AD-1593A3A3BEC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AAC01466-7370-4464-B1AD-1593A3A3BEC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AAC01466-7370-4464-B1AD-1593A3A3BEC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AAC01466-7370-4464-B1AD-1593A3A3BEC1}.Release|Any CPU.Build.0 = Release|Any CPU
- {2E6579F9-1F70-4DF9-98A9-22687425A830}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2E6579F9-1F70-4DF9-98A9-22687425A830}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2E6579F9-1F70-4DF9-98A9-22687425A830}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2E6579F9-1F70-4DF9-98A9-22687425A830}.Release|Any CPU.Build.0 = Release|Any CPU
- {CCA60063-264F-4B62-9B5D-45B9D0E3D6D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CCA60063-264F-4B62-9B5D-45B9D0E3D6D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CCA60063-264F-4B62-9B5D-45B9D0E3D6D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CCA60063-264F-4B62-9B5D-45B9D0E3D6D8}.Release|Any CPU.Build.0 = Release|Any CPU
- {44C7FBC7-BFF6-4DEE-B891-82A043F548BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {44C7FBC7-BFF6-4DEE-B891-82A043F548BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {44C7FBC7-BFF6-4DEE-B891-82A043F548BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {44C7FBC7-BFF6-4DEE-B891-82A043F548BD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|Any CPU.Build.0 = Release|Any CPU
+ {164A785D-924E-40FB-A517-D7E677F3B53A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {164A785D-924E-40FB-A517-D7E677F3B53A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {164A785D-924E-40FB-A517-D7E677F3B53A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {164A785D-924E-40FB-A517-D7E677F3B53A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|Any CPU.Build.0 = Release|Any CPU
+ {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Copied: branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetection.Designer.cs (from rev 1089, branches/shaders/Tests/CoreTests/PlatformDetection.Designer.cs)
===================================================================
--- branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetection.Designer.cs (rev 0)
+++ branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetection.Designer.cs 2009-11-15 07:45:55 UTC (rev 1097)
@@ -0,0 +1,85 @@
+namespace Tests.CoreTests.PlatformDetection
+{
+ partial class PlatformDetection
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.lblPlatform = new System.Windows.Forms.Label();
+ this.lblRuntime = new System.Windows.Forms.Label();
+ this.button1 = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // lblPlatform
+ //
+ this.lblPlatform.AutoSize = true;
+ this.lblPlatform.Location = new System.Drawing.Point(12, 9);
+ this.lblPlatform.Name = "lblPlatform";
+ this.lblPlatform.Size = new System.Drawing.Size(45, 13);
+ this.lblPlatform.TabIndex = 0;
+ this.lblPlatform.Text = "Platform";
+ //
+ // lblRuntime
+ //
+ this.lblRuntime.AutoSize = true;
+ this.lblRuntime.Location = new System.Drawing.Point(12, 40);
+ this.lblRuntime.Name = "lblRuntime";
+ this.lblRuntime.Size = new System.Drawing.Size(83, 13);
+ this.lblRuntime.TabIndex = 1;
+ this.lblRuntime.Text = "DotNet Runtime";
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(197, 69);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 2;
+ this.button1.Text = "Close";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // PlatformDetection
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(284, 104);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.lblRuntime);
+ this.Controls.Add(this.lblPlatform);
+ this.Name = "PlatformDetection";
+ this.Text = "Platform Detection";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label lblPlatform;
+ private System.Windows.Forms.Label lblRuntime;
+ private System.Windows.Forms.Button button1;
+ }
+}
\ No newline at end of file
Copied: branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetection.cs (from rev 1089, branches/shaders/Tests/CoreTests/PlatformDetection.cs)
===================================================================
--- branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetection.cs (rev 0)
+++ branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetection.cs 2009-11-15 07:45:55 UTC (rev 1097)
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace Tests.CoreTests.PlatformDetection
+{
+ public partial class PlatformDetection : Form
+ {
+ public PlatformDetection()
+ {
+ InitializeComponent();
+
+ lblPlatform.Text = "Platform: " + AgateLib.Core.Platform.PlatformType.ToString();
+ lblRuntime.Text = "Runtime: " + AgateLib.Core.Platform.Runtime.ToString();
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ this.Close();
+
+ }
+
+ }
+}
Copied: branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetection.resx (from rev 1089, branches/shaders/Tests/CoreTests/PlatformDetection.resx)
===================================================================
--- branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetection.resx (rev 0)
+++ branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetection.resx 2009-11-15 07:45:55 UTC (rev 1097)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
Added: branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetector.cs
===================================================================
--- branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetector.cs (rev 0)
+++ branches/shaders/Tests/CoreTests/PlatformDetection/PlatformDetector.cs 2009-11-15 07:45:55 UTC (rev 1097)
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Tests.CoreTests.PlatformDetection
+{
+ class PlatformDetector: IAgateTest
+ {
+ #region IAgateTest Members
+
+ string IAgateTest.Name
+ {
+ get { return "Platform Detection"; }
+ }
+
+ string IAgateTest.Category
+ {
+ get { return "Core"; }
+ }
+
+ void IAgateTest.Main(string[] args)
+ {
+ new PlatformDetection().ShowDialog();
+ }
+
+ #endregion
+ }
+}
Deleted: branches/shaders/Tests/CoreTests/PlatformDetection.Designer.cs
===================================================================
--- branches/shaders/Tests/CoreTests/PlatformDetection.Designer.cs 2009-11-15 06:06:01 UTC (rev 1096)
+++ branches/shaders/Tests/CoreTests/PlatformDetection.Designer.cs 2009-11-15 07:45:55 UTC (rev 1097)
@@ -1,85 +0,0 @@
-namespace Tests.CoreTests
-{
- partial class PlatformDetection
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.lblPlatform = new System.Windows.Forms.Label();
- this.lblRuntime = new System.Windows.Forms.Label();
- this.button1 = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // lblPlatform
- //
- this.lblPlatform.AutoSize = true;
- this.lblPlatform.Location = new System.Drawing.Point(12, 9);
- this.lblPlatform.Name = "lblPlatform";
- this.lblPlatform.Size = new System.Drawing.Size(45, 13);
- this.lblPlatform.TabIndex = 0;
- this.lblPlatform.Text = "Platform";
- //
- // lblRuntime
- //
- this.lblRuntime.AutoSize = true;
- this.lblRuntime.Location = new System.Drawing.Point(12, 40);
- this.lblRuntime.Name = "lblRuntime";
- this.lblRuntime.Size = new System.Drawing.Size(83, 13);
- this.lblRuntime.TabIndex = 1;
- this.lblRuntime.Text = "DotNet Runtime";
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(197, 69);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(75, 23);
- this.button1.TabIndex = 2;
- this.button1.Text = "Close";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // PlatformDetection
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(284, 104);
- this.Controls.Add(this.button1);
- this.Controls.Add(this.lblRuntime);
- this.Controls.Add(this.lblPlatform);
- this.Name = "PlatformDetection";
- this.Text = "Platform Detection";
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.Label lblPlatform;
- private System.Windows.Forms.Label lblRuntime;
- private System.Windows.Forms.Button button1;
- }
-}
\ No newline at end of file
Deleted: branches/shaders/Tests/CoreTests/PlatformDetection.cs
===================================================================
--- branches/shaders/Tests/CoreTests/PlatformDetection.cs 2009-11-15 06:06:01 UTC (rev 1096)
+++ branches/shaders/Tests/CoreTests/PlatformDetection.cs 2009-11-15 07:45:55 UTC (rev 1097)
@@ -1,44 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-
-namespace Tests.CoreTests
-{
- public partial class PlatformDetection : Form, IAgateTest
- {
- public PlatformDetection()
- {
- InitializeComponent();
- }
-
- private void button1_Click(object sender, EventArgs e)
- {
- this.Close();
-
- }
-
- #region IAgateTest Members
-
- string IAgateTest.Name
- {
- get { return "Platform Detection"; }
- }
-
- string IAgateTest.Category
- {
- get { return "Core"; }
- }
-
- void IAgateTest.Main(string[] args)
- {
- Application.Run(this);
- }
-
- #endregion
- }
-}
Deleted: branches/shaders/Tests/CoreTests/PlatformDetection.resx
===================================================================
--- branches/shaders/Tests/CoreTests/PlatformDetection.resx 2009-11-15 06:06:01 UTC (rev 1096)
+++ branches/shaders/Tests/CoreTests/PlatformDetection.resx 2009-11-15 07:45:55 UTC (rev 1097)
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
-</root>
\ No newline at end of file
Modified: branches/shaders/Tests/Tests.csproj
===================================================================
--- branches/shaders/Tests/Tests.csproj 2009-11-15 06:06:01 UTC (rev 1096)
+++ branches/shaders/Tests/Tests.csproj 2009-11-15 07:45:55 UTC (rev 1097)
@@ -88,12 +88,13 @@
<Compile Include="AgateTestAttribute.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="CoreTests\PlatformDetection.cs">
+ <Compile Include="CoreTests\PlatformDetection\PlatformDetection.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="CoreTests\PlatformDetection.Designer.cs">
+ <Compile Include="CoreTests\PlatformDetection\PlatformDetection.Designer.cs">
<DependentUpon>PlatformDetection.cs</DependentUpon>
</Compile>
+ <Compile Include="CoreTests\PlatformDetection\PlatformDetector.cs" />
<Compile Include="DisplayTests\ClipRect.cs" />
<Compile Include="frmLauncher.cs">
<SubType>Form</SubType>
@@ -319,7 +320,7 @@
<Compile Include="WinFormsTests\Converters.cs">
<SubType>Code</SubType>
</Compile>
- <EmbeddedResource Include="CoreTests\PlatformDetection.resx">
+ <EmbeddedResource Include="CoreTests\PlatformDetection\PlatformDetection.resx">
<DependentUpon>PlatformDetection.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmLauncher.resx">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-15 06:06:11
|
Revision: 1096
http://agate.svn.sourceforge.net/agate/?rev=1096&view=rev
Author: kanato
Date: 2009-11-15 06:06:01 +0000 (Sun, 15 Nov 2009)
Log Message:
-----------
Merge in otkupdate branch.
Modified Paths:
--------------
branches/shaders/AgateLib/Core.cs
branches/shaders/AgateLib/DisplayLib/DisplayCapsInfo.cs
branches/shaders/AgateLib/DisplayLib/PrimitiveType.cs
branches/shaders/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs
branches/shaders/AgateLib/Geometry/Matrix4x4.cs
branches/shaders/Drivers/AgateOTK/AL_Audio.cs
branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
branches/shaders/Drivers/AgateOTK/ArbShader.cs
branches/shaders/Drivers/AgateOTK/ArbShaderCompiler.cs
branches/shaders/Drivers/AgateOTK/GLDrawBuffer.cs
branches/shaders/Drivers/AgateOTK/GLState.cs
branches/shaders/Drivers/AgateOTK/GL_Display.cs
branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs
branches/shaders/Drivers/AgateOTK/GL_GameWindow.cs
branches/shaders/Drivers/AgateOTK/GL_IndexBuffer.cs
branches/shaders/Drivers/AgateOTK/GL_Surface.cs
branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs
branches/shaders/Drivers/AgateOTK/GeoHelper.cs
branches/shaders/Drivers/AgateOTK/GlslShader.cs
branches/shaders/Drivers/AgateOTK/GlslShaderCompiler.cs
branches/shaders/Drivers/AgateOTK/OpenTK.dll
branches/shaders/Drivers/AgateOTK/OpenTK.dll.config
branches/shaders/Drivers/AgateOTK/OpenTK.xml
branches/shaders/Drivers/AgateOTK/Otk_Reporter.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting2D.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs
Added Paths:
-----------
branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.dll
branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.dll.config
branches/shaders/Drivers/AgateOTK/OpenTK.Compatibility.xml
Removed Paths:
-------------
branches/shaders/Drivers/AgateOTK/OpenTK.Utilities.dll
branches/shaders/Drivers/AgateOTK/OpenTK.Utilities.dll.config
branches/shaders/Drivers/AgateOTK/OpenTK.Utilities.xml
Property Changed:
----------------
branches/shaders/
branches/shaders/AgateLib/
branches/shaders/AgateLib/AgateFileProvider.cs
branches/shaders/AgateLib/AgateSetup.cs
branches/shaders/AgateLib/AudioLib/
branches/shaders/AgateLib/AudioLib/Audio.cs
branches/shaders/AgateLib/BitmapFont/FontMetrics.cs
branches/shaders/AgateLib/BitmapFont/GlyphMetrics.cs
branches/shaders/AgateLib/Core.cs
branches/shaders/AgateLib/DisplayLib/
branches/shaders/AgateLib/DisplayLib/Display.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/AgateInternalShader.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/ShaderProgram.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs
branches/shaders/AgateLib/DisplayLib/StringTransformer.cs
branches/shaders/AgateLib/Drivers/AgateDriverReporter.cs
branches/shaders/AgateLib/Drivers/IDesktopDriver.cs
branches/shaders/AgateLib/ImplementationBase/
branches/shaders/AgateLib/ImplementationBase/AudioImpl.cs
branches/shaders/AgateLib/InputLib/
branches/shaders/AgateLib/Meshes/Loaders/OBJFileRepresentation.cs
branches/shaders/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs
branches/shaders/AgateLib/Meshes/Loaders/Obj/TokenTypes.cs
branches/shaders/AgateLib/Resources/AgateResourceCollection.cs
branches/shaders/AgateLib/Resources/AgateResourceLoader.cs
branches/shaders/AgateLib/Resources/BitmapFontResource.cs
branches/shaders/AgateLib/Sprites/Sprite.cs
branches/shaders/AgateLib/Sprites/SpriteFrame.cs
branches/shaders/AgateLib/Timing.cs
branches/shaders/AgateLib/Utility/Platform.cs
branches/shaders/Drivers/
branches/shaders/Drivers/AgateDrawing/Drawing_Reporter.cs
branches/shaders/Drivers/AgateLib.WinForms/
branches/shaders/Drivers/AgateOTK/Shaders/
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting2D.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs
branches/shaders/Drivers/AgateOTK/Shaders/ShaderFactory.cs
branches/shaders/Drivers/AgateSDL/
branches/shaders/Drivers/AgateSDL/Audio/SDL_Audio.cs
branches/shaders/Drivers/AgateSDL/Audio/SDL_Music.cs
branches/shaders/Drivers/AgateSDL/Audio/SDL_SoundBuffer.cs
branches/shaders/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs
branches/shaders/Drivers/AgateSDL/Input/SDL_Input.cs
branches/shaders/Drivers/AgateSDL/Reporter.cs
branches/shaders/Drivers/AgateSDX/Shaders/
branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/
branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs
branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs
branches/shaders/Drivers/AgateSDX/Shaders/ShaderFactory.cs
branches/shaders/Examples/BallBuster.Net/OpenTK.dll.config
branches/shaders/Examples/ShootTheTraps/
branches/shaders/Examples/ShootTheTraps/App.cs
branches/shaders/Examples/ShootTheTraps/Arrow.cs
branches/shaders/Examples/ShootTheTraps/GameObject.cs
branches/shaders/Examples/ShootTheTraps/Particle.cs
branches/shaders/Examples/ShootTheTraps/Properties/
branches/shaders/Examples/ShootTheTraps/Properties/AssemblyInfo.cs
branches/shaders/Examples/ShootTheTraps/ShootTheTraps.csproj
branches/shaders/Examples/ShootTheTraps/ShootTraps.cs
branches/shaders/Examples/ShootTheTraps/Trap.cs
branches/shaders/Examples/ShootTheTraps/Vector.cs
branches/shaders/Tests/CoreTests/
branches/shaders/Tests/DisplayTests/SurfaceTester/SurfaceTester.cs
branches/shaders/Tests/DisplayTests/TestPacker/TestPacker.cs
branches/shaders/Tests/DisplayTests/TestPacker/frmTestPacker.Designer.cs
branches/shaders/Tests/DisplayTests/TestPacker/frmTestPacker.cs
branches/shaders/Tests/DisplayTests/TestPacker/frmTestPacker.resx
branches/shaders/Tests/DisplayTests/TileTester/TileTester.cs
branches/shaders/Tests/DisplayTests/TileTester/frmTileTester.Designer.cs
branches/shaders/Tests/DisplayTests/TileTester/frmTileTester.cs
branches/shaders/Tests/DisplayTests/TileTester/frmTileTester.resx
branches/shaders/Tests/InputTests/Input/
branches/shaders/Tests/InputTests/Input/InputTester.cs
branches/shaders/Tests/InputTests/Input/frmInputTester.Designer.cs
branches/shaders/Tests/InputTests/Input/frmInputTester.cs
branches/shaders/Tests/InputTests/InputState/
branches/shaders/Tests/InputTests/InputState/InputStateTester.cs
branches/shaders/Tools/FontCreator/CreateFont.Designer.cs
branches/shaders/Tools/FontCreator/CreateFont.cs
branches/shaders/Tools/FontCreator/CreateFont.resx
branches/shaders/Tools/FontCreator/EditGlyphs.Designer.cs
branches/shaders/Tools/FontCreator/EditGlyphs.cs
branches/shaders/Tools/FontCreator/EditGlyphs.resx
branches/shaders/Tools/FontCreator/SaveFont.Designer.cs
branches/shaders/Tools/FontCreator/SaveFont.cs
branches/shaders/Tools/FontCreator/SaveFont.resx
branches/shaders/Tools/FontCreator/frmFontCreator.Designer.cs
branches/shaders/Tools/FontCreator/frmFontCreator.cs
branches/shaders/Tools/FontCreator/frmFontCreator.resx
branches/shaders/Tools/PackedSpriteCreator/SpriteEditor.Designer.cs
branches/shaders/Tools/PackedSpriteCreator/SpriteEditor.cs
branches/shaders/Tools/PackedSpriteCreator/SpriteEditor.resx
branches/shaders/Tools/PackedSpriteCreator/SpritePacker.cs
Property changes on: branches/shaders
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d:629-702,840-864
/branches/agate3d-3.2:923-1034
/branches/build:424-517,1081-1084
/branches/font:778-916
/branches/merge-tests:806-810
/branches/registrar:595-599
/branches/sprites:463-513
+ /branches/agate-3d:629-702,840-864
/branches/agate3d-3.2:923-1034
/branches/build:424-517,1081-1084
/branches/font:778-916
/branches/merge-tests:806-810
/branches/otkupdate:1068-1076
/branches/registrar:595-599
/branches/sprites:463-513
Property changes on: branches/shaders/AgateLib
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib:629-702,840-864
/branches/agate3d-3.2/AgateLib:923-1034
/branches/build/AgateLib:447-448,501-517,1081-1084
/branches/font/AgateLib:778-916
/branches/merge-tests/AgateLib:806-810
/branches/registrar/AgateLib:595-599
/branches/sprites/AgateLib:463-513
+ /branches/agate-3d/AgateLib:629-702,840-864
/branches/agate3d-3.2/AgateLib:923-1034
/branches/build/AgateLib:447-448,501-517,1081-1084
/branches/font/AgateLib:778-916
/branches/merge-tests/AgateLib:806-810
/branches/otkupdate/AgateLib:1068-1076
/branches/registrar/AgateLib:595-599
/branches/sprites/AgateLib:463-513
Property changes on: branches/shaders/AgateLib/AgateFileProvider.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate3d-3.2/AgateLib/AgateFileProvider.cs:923-1034
/branches/build/AgateLib/AgateFileProvider.cs:1081-1084
/branches/build/AgateLib/Utility/AgateFileProvider.cs:447-517
/branches/font/AgateLib/AgateFileProvider.cs:778-916
/branches/merge-tests/AgateLib/AgateFileProvider.cs:806-810
/branches/registrar/AgateLib/Utility/AgateFileProvider.cs:595-599
/branches/sprites/AgateLib/Utility/AgateFileProvider.cs:463-513
+ /branches/agate3d-3.2/AgateLib/AgateFileProvider.cs:923-1034
/branches/build/AgateLib/AgateFileProvider.cs:1081-1084
/branches/build/AgateLib/Utility/AgateFileProvider.cs:447-517
/branches/font/AgateLib/AgateFileProvider.cs:778-916
/branches/merge-tests/AgateLib/AgateFileProvider.cs:806-810
/branches/otkupdate/AgateLib/AgateFileProvider.cs:1068-1076
/branches/registrar/AgateLib/Utility/AgateFileProvider.cs:595-599
/branches/sprites/AgateLib/Utility/AgateFileProvider.cs:463-513
Property changes on: branches/shaders/AgateLib/AgateSetup.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/AgateSetup.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/AgateSetup.cs:923-1034
/branches/build/AgateLib/AgateSetup.cs:501-517,1081-1084
/branches/font/AgateLib/AgateSetup.cs:778-916
/branches/merge-tests/AgateLib/AgateSetup.cs:806-810
/branches/registrar/AgateLib/AgateSetup.cs:595-599
/branches/sprites/AgateLib/AgateSetup.cs:463-513
+ /branches/agate-3d/AgateLib/AgateSetup.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/AgateSetup.cs:923-1034
/branches/build/AgateLib/AgateSetup.cs:501-517,1081-1084
/branches/font/AgateLib/AgateSetup.cs:778-916
/branches/merge-tests/AgateLib/AgateSetup.cs:806-810
/branches/otkupdate/AgateLib/AgateSetup.cs:1068-1076
/branches/registrar/AgateLib/AgateSetup.cs:595-599
/branches/sprites/AgateLib/AgateSetup.cs:463-513
Property changes on: branches/shaders/AgateLib/AudioLib
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/AudioLib:629-702,840-864
/branches/agate3d-3.2/AgateLib/AudioLib:923-1034
/branches/build/AgateLib/AudioLib:1081-1084
/branches/font/AgateLib/AudioLib:778-916
/branches/merge-tests/AgateLib/AudioLib:806-810
/branches/registrar/AgateLib/AudioLib:595-599
/branches/sprites/AgateLib/AudioLib:463-513
+ /branches/agate-3d/AgateLib/AudioLib:629-702,840-864
/branches/agate3d-3.2/AgateLib/AudioLib:923-1034
/branches/build/AgateLib/AudioLib:1081-1084
/branches/font/AgateLib/AudioLib:778-916
/branches/merge-tests/AgateLib/AudioLib:806-810
/branches/otkupdate/AgateLib/AudioLib:1068-1076
/branches/registrar/AgateLib/AudioLib:595-599
/branches/sprites/AgateLib/AudioLib:463-513
Property changes on: branches/shaders/AgateLib/AudioLib/Audio.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/AudioLib/Audio.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/AudioLib/Audio.cs:923-1034
/branches/build/AgateLib/AudioLib/Audio.cs:501-517,1081-1084
/branches/font/AgateLib/AudioLib/Audio.cs:778-916
/branches/merge-tests/AgateLib/AudioLib/Audio.cs:806-810
/branches/registrar/AgateLib/AudioLib/Audio.cs:595-599
/branches/sprites/AgateLib/AudioLib/Audio.cs:463-513
+ /branches/agate-3d/AgateLib/AudioLib/Audio.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/AudioLib/Audio.cs:923-1034
/branches/build/AgateLib/AudioLib/Audio.cs:501-517,1081-1084
/branches/font/AgateLib/AudioLib/Audio.cs:778-916
/branches/merge-tests/AgateLib/AudioLib/Audio.cs:806-810
/branches/otkupdate/AgateLib/AudioLib/Audio.cs:1068-1076
/branches/registrar/AgateLib/AudioLib/Audio.cs:595-599
/branches/sprites/AgateLib/AudioLib/Audio.cs:463-513
Property changes on: branches/shaders/AgateLib/BitmapFont/FontMetrics.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/BitmapFont/FontMetrics.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/BitmapFont/FontMetrics.cs:923-1034
/branches/build/AgateLib/BitmapFont/FontMetrics.cs:1081-1084
/branches/font/AgateLib/BitmapFont/FontMetrics.cs:778-916
/branches/merge-tests/AgateLib/BitmapFont/FontMetrics.cs:806-810
+ /branches/agate-3d/AgateLib/BitmapFont/FontMetrics.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/BitmapFont/FontMetrics.cs:923-1034
/branches/build/AgateLib/BitmapFont/FontMetrics.cs:1081-1084
/branches/font/AgateLib/BitmapFont/FontMetrics.cs:778-916
/branches/merge-tests/AgateLib/BitmapFont/FontMetrics.cs:806-810
/branches/otkupdate/AgateLib/BitmapFont/FontMetrics.cs:1068-1076
Property changes on: branches/shaders/AgateLib/BitmapFont/GlyphMetrics.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/BitmapFont/GlyphMetrics.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/BitmapFont/GlyphMetrics.cs:923-1034
/branches/build/AgateLib/BitmapFont/GlyphMetrics.cs:1081-1084
/branches/build/AgateLib/Resources/GlyphMetrics.cs:447-517
/branches/font/AgateLib/BitmapFont/GlyphMetrics.cs:778-916
/branches/merge-tests/AgateLib/BitmapFont/GlyphMetrics.cs:806-810
/branches/registrar/AgateLib/Resources/GlyphMetrics.cs:595-599
/branches/sprites/AgateLib/Resources/GlyphMetrics.cs:463-513
+ /branches/agate-3d/AgateLib/BitmapFont/GlyphMetrics.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/BitmapFont/GlyphMetrics.cs:923-1034
/branches/build/AgateLib/BitmapFont/GlyphMetrics.cs:1081-1084
/branches/build/AgateLib/Resources/GlyphMetrics.cs:447-517
/branches/font/AgateLib/BitmapFont/GlyphMetrics.cs:778-916
/branches/merge-tests/AgateLib/BitmapFont/GlyphMetrics.cs:806-810
/branches/otkupdate/AgateLib/BitmapFont/GlyphMetrics.cs:1068-1076
/branches/registrar/AgateLib/Resources/GlyphMetrics.cs:595-599
/branches/sprites/AgateLib/Resources/GlyphMetrics.cs:463-513
Modified: branches/shaders/AgateLib/Core.cs
===================================================================
--- branches/shaders/AgateLib/Core.cs 2009-11-13 19:34:18 UTC (rev 1095)
+++ branches/shaders/AgateLib/Core.cs 2009-11-15 06:06:01 UTC (rev 1096)
@@ -314,6 +314,15 @@
}
/// <summary>
+ /// Gets a Platform object which provides information about the current
+ /// platform AgateLib is running on.
+ /// </summary>
+ public static Platform Platform
+ {
+ get { return mPlatform; }
+ }
+
+ /// <summary>
/// Gets or sets a bool value which indicates whether or not your
/// app is the focused window. This will be automatically set if
/// you created DisplayWindows by specifying a title and size, but not
Property changes on: branches/shaders/AgateLib/Core.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/Core.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Core.cs:923-1034
/branches/build/AgateLib/Core.cs:501-517,1081-1084
/branches/font/AgateLib/Core.cs:778-916
/branches/merge-tests/AgateLib/Core.cs:806-810
/branches/registrar/AgateLib/Core.cs:595-599
/branches/sprites/AgateLib/Core.cs:463-513
+ /branches/agate-3d/AgateLib/Core.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Core.cs:923-1034
/branches/build/AgateLib/Core.cs:501-517,1081-1084
/branches/font/AgateLib/Core.cs:778-916
/branches/merge-tests/AgateLib/Core.cs:806-810
/branches/otkupdate/AgateLib/Core.cs:1068-1076
/branches/registrar/AgateLib/Core.cs:595-599
/branches/sprites/AgateLib/Core.cs:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/DisplayLib:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib:923-1034
/branches/build/AgateLib/DisplayLib:1081-1084
/branches/font/AgateLib/DisplayLib:778-916
/branches/merge-tests/AgateLib/DisplayLib:806-810
/branches/registrar/AgateLib/DisplayLib:595-599
/branches/sprites/AgateLib/DisplayLib:463-513
+ /branches/agate-3d/AgateLib/DisplayLib:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib:923-1034
/branches/build/AgateLib/DisplayLib:1081-1084
/branches/font/AgateLib/DisplayLib:778-916
/branches/merge-tests/AgateLib/DisplayLib:806-810
/branches/otkupdate/AgateLib/DisplayLib:1068-1076
/branches/registrar/AgateLib/DisplayLib:595-599
/branches/sprites/AgateLib/DisplayLib:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib/Display.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/DisplayLib/Display.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Display.cs:923-1034
/branches/build/AgateLib/DisplayLib/Display.cs:501-517,1081-1084
/branches/font/AgateLib/DisplayLib/Display.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Display.cs:806-810
/branches/registrar/AgateLib/DisplayLib/Display.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Display.cs:463-513
+ /branches/agate-3d/AgateLib/DisplayLib/Display.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Display.cs:923-1034
/branches/build/AgateLib/DisplayLib/Display.cs:501-517,1081-1084
/branches/font/AgateLib/DisplayLib/Display.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Display.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/Display.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/Display.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Display.cs:463-513
Modified: branches/shaders/AgateLib/DisplayLib/DisplayCapsInfo.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/DisplayCapsInfo.cs 2009-11-13 19:34:18 UTC (rev 1095)
+++ branches/shaders/AgateLib/DisplayLib/DisplayCapsInfo.cs 2009-11-15 06:06:01 UTC (rev 1096)
@@ -6,8 +6,15 @@
namespace AgateLib.DisplayLib
{
+ /// <summary>
+ /// Class which can be used to query information about what features are supported
+ /// by the display driver.
+ /// </summary>
public class DisplayCapsInfo
{
+ internal DisplayCapsInfo()
+ { }
+
/// <summary>
/// Indicates whether or not full screen windows can be created.
/// </summary>
Modified: branches/shaders/AgateLib/DisplayLib/PrimitiveType.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/PrimitiveType.cs 2009-11-13 19:34:18 UTC (rev 1095)
+++ branches/shaders/AgateLib/DisplayLib/PrimitiveType.cs 2009-11-15 06:06:01 UTC (rev 1096)
@@ -4,10 +4,24 @@
namespace AgateLib.DisplayLib
{
+ /// <summary>
+ /// Primitive type for types in a vertex buffer.
+ /// </summary>
public enum PrimitiveType
{
+ /// <summary>
+ /// Every three vertices is a separate triangle
+ /// </summary>
TriangleList,
+ /// <summary>
+ /// The vertices indicate a fan; the first point creates a triangle with
+ /// each pair of points after that.
+ /// </summary>
TriangleFan,
+ /// <summary>
+ /// The vertices make a strip of triangles, so each triangle shares a vertex
+ /// with the previous one.
+ /// </summary>
TriangleStrip,
}
}
Modified: branches/shaders/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs 2009-11-13 19:34:18 UTC (rev 1095)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/AgateShaderCompileError.cs 2009-11-15 06:06:01 UTC (rev 1096)
@@ -1,10 +1,31 @@
-using System;
+// The contents of this file are subject to the Mozilla Public License
+// Version 1.1 (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS"
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+// License for the specific language governing rights and limitations
+// under the License.
+//
+// The Original Code is AgateLib.
+//
+// The Initial Developer of the Original Code is Erik Ylvisaker.
+// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009.
+// All Rights Reserved.
+//
+// Contributor(s): Erik Ylvisaker
+//
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AgateLib.DisplayLib.Shaders
{
+ /// <summary>
+ /// Exception thrown when an attempt to compile a shader fails.
+ /// </summary>
[global::System.Serializable]
public class AgateShaderCompilerException : Exception
{
@@ -15,9 +36,21 @@
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp
//
+ /// <summary>
+ /// Constructs an AgateShaderCompilerException object.
+ /// </summary>
public AgateShaderCompilerException() { }
+ /// <summary>
+ /// Constructs an AgateShaderCompilerException object.
+ /// </summary>
public AgateShaderCompilerException(string message) : base(message) { }
+ /// <summary>
+ /// Constructs an AgateShaderCompilerException object.
+ /// </summary>
public AgateShaderCompilerException(string message, Exception inner) : base(message, inner) { }
+ /// <summary>
+ /// Constructs an AgateShaderCompilerException object.
+ /// </summary>
protected AgateShaderCompilerException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/agate-3d/AgateLib/DisplayLib/Shaders/Implementation:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Shaders/Implementation:923-1034
/branches/build/AgateLib/DisplayLib/Shaders/Implementation:1081-1084
/branches/font/AgateLib/DisplayLib/Shaders/Implementation:778-916
/branches/merge-tests/AgateLib/DisplayLib/Shaders/Implementation:806-810
/branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation:1068-1076*
/branches/registrar/AgateLib/DisplayLib/Shaders/Implementation:595-599
/branches/sprites/AgateLib/DisplayLib/Shaders/Implementation:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/AgateInternalShader.cs
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/agate-3d/AgateLib/DisplayLib/Shaders/Implementation/AgateInternalShader.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Shaders/Implementation/AgateInternalShader.cs:923-1034
/branches/build/AgateLib/DisplayLib/Shaders/Implementation/AgateInternalShader.cs:1081-1084
/branches/font/AgateLib/DisplayLib/Shaders/Implementation/AgateInternalShader.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Shaders/Implementation/AgateInternalShader.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation/AgateInternalShader.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/Shaders/Implementation/AgateInternalShader.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Shaders/Implementation/AgateInternalShader.cs:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/agate-3d/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs:923-1034
/branches/build/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs:1081-1084
/branches/font/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderCompileError.cs:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/agate-3d/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs:923-1034
/branches/build/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs:1081-1084
/branches/font/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Shaders/Implementation/AgateShaderImpl.cs:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs:1068-1076
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/agate-3d/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs:923-1034
/branches/build/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs:1081-1084
/branches/font/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Shaders/Implementation/Effect.cs:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/agate-3d/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs:923-1034
/branches/build/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs:1081-1084
/branches/font/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs:1068-1076
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/agate-3d/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs:923-1034
/branches/build/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs:1081-1084
/branches/font/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/agate-3d/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs:923-1034
/branches/build/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs:1081-1084
/branches/font/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/ShaderProgram.cs
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/agate-3d/AgateLib/DisplayLib/Shaders/Implementation/ShaderProgram.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Shaders/Implementation/ShaderProgram.cs:923-1034
/branches/build/AgateLib/DisplayLib/Shaders/Implementation/ShaderProgram.cs:1081-1084
/branches/font/AgateLib/DisplayLib/Shaders/Implementation/ShaderProgram.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Shaders/Implementation/ShaderProgram.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation/ShaderProgram.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/Shaders/Implementation/ShaderProgram.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Shaders/Implementation/ShaderProgram.cs:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/agate-3d/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs:923-1034
/branches/build/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs:1081-1084
/branches/font/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/agate-3d/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs:923-1034
/branches/build/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs:1081-1084
/branches/font/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs:595-599
/branches/sprites/AgateLib/DisplayLib/Shaders/Implementation/UniformState.cs:463-513
Property changes on: branches/shaders/AgateLib/DisplayLib/StringTransformer.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/DisplayLib/StringTransformer.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/StringTransformer.cs:923-1034
/branches/build/AgateLib/DisplayLib/StringTransformer.cs:501-517,1081-1084
/branches/font/AgateLib/DisplayLib/StringTransformer.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/StringTransformer.cs:806-810
/branches/registrar/AgateLib/DisplayLib/StringTransformer.cs:595-599
/branches/sprites/AgateLib/DisplayLib/StringTransformer.cs:463-513
+ /branches/agate-3d/AgateLib/DisplayLib/StringTransformer.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/DisplayLib/StringTransformer.cs:923-1034
/branches/build/AgateLib/DisplayLib/StringTransformer.cs:501-517,1081-1084
/branches/font/AgateLib/DisplayLib/StringTransformer.cs:778-916
/branches/merge-tests/AgateLib/DisplayLib/StringTransformer.cs:806-810
/branches/otkupdate/AgateLib/DisplayLib/StringTransformer.cs:1068-1076
/branches/registrar/AgateLib/DisplayLib/StringTransformer.cs:595-599
/branches/sprites/AgateLib/DisplayLib/StringTransformer.cs:463-513
Property changes on: branches/shaders/AgateLib/Drivers/AgateDriverReporter.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/Drivers/AgateDriverReporter.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Drivers/AgateDriverReporter.cs:923-1034
/branches/build/AgateLib/Drivers/AgateDriverReporter.cs:1081-1084
/branches/font/AgateLib/Drivers/AgateDriverReporter.cs:778-916
/branches/merge-tests/AgateLib/Drivers/AgateDriverReporter.cs:806-810
+ /branches/agate-3d/AgateLib/Drivers/AgateDriverReporter.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Drivers/AgateDriverReporter.cs:923-1034
/branches/build/AgateLib/Drivers/AgateDriverReporter.cs:1081-1084
/branches/font/AgateLib/Drivers/AgateDriverReporter.cs:778-916
/branches/merge-tests/AgateLib/Drivers/AgateDriverReporter.cs:806-810
/branches/otkupdate/AgateLib/Drivers/AgateDriverReporter.cs:1068-1076
Property changes on: branches/shaders/AgateLib/Drivers/IDesktopDriver.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/Drivers/IDesktopDriver.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Drivers/IDesktopDriver.cs:923-1034
/branches/build/AgateLib/Drivers/IDesktopDriver.cs:1081-1084
/branches/font/AgateLib/Drivers/IDesktopDriver.cs:778-916
/branches/merge-tests/AgateLib/Drivers/IDesktopDriver.cs:806-810
+ /branches/agate-3d/AgateLib/Drivers/IDesktopDriver.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Drivers/IDesktopDriver.cs:923-1034
/branches/build/AgateLib/Drivers/IDesktopDriver.cs:1081-1084
/branches/font/AgateLib/Drivers/IDesktopDriver.cs:778-916
/branches/merge-tests/AgateLib/Drivers/IDesktopDriver.cs:806-810
/branches/otkupdate/AgateLib/Drivers/IDesktopDriver.cs:1068-1076
Modified: branches/shaders/AgateLib/Geometry/Matrix4x4.cs
===================================================================
--- branches/shaders/AgateLib/Geometry/Matrix4x4.cs 2009-11-13 19:34:18 UTC (rev 1095)
+++ branches/shaders/AgateLib/Geometry/Matrix4x4.cs 2009-11-15 06:06:01 UTC (rev 1096)
@@ -4,6 +4,9 @@
namespace AgateLib.Geometry
{
+ /// <summary>
+ /// Structure which indicates a 4x4 matrix.
+ /// </summary>
public struct Matrix4x4
{
float m11, m12, m13, m14;
@@ -11,15 +14,32 @@
float m31, m32, m33, m34;
float m41, m42, m43, m44;
+ /// <summary>
+ /// The identity 4x4 matrix.
+ /// </summary>
public static readonly Matrix4x4 Identity = new Matrix4x4(
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1);
+ /// <summary>
+ /// Creates a 4x4 matrix which represents a translation.
+ /// </summary>
+ /// <param name="x"></param>
+ /// <param name="y"></param>
+ /// <param name="z"></param>
+ /// <returns></returns>
public static Matrix4x4 Translation(double x, double y, double z)
{
return Translation((float)x, (float)y, (float)z);
}
+ /// <summary>
+ /// Creates a 4x4 matrix which represents a translation.
+ /// </summary>
+ /// <param name="x"></param>
+ /// <param name="y"></param>
+ /// <param name="z"></param>
+ /// <returns></returns>
public static Matrix4x4 Translation(float x, float y, float z)
{
return new Matrix4x4(
@@ -28,11 +48,23 @@
0, 0, 1, z,
0, 0, 0, 1);
}
+ /// <summary>
+ /// Creates a 4x4 matrix which represents a translation.
+ /// </summary>
+ /// <param name="vec">The translation vector</param>
+ /// <returns></returns>
public static Matrix4x4 Translation(Vector3 vec)
{
return Translation(vec.X, vec.Y, vec.Z);
}
+ /// <summary>
+ /// Creates a 4x4 matrix which represents a scaling operation.
+ /// </summary>
+ /// <param name="x"></param>
+ /// <param name="y"></param>
+ /// <param name="z"></param>
+ /// <returns></returns>
public static Matrix4x4 Scale(float x, float y, float z)
{
return new Matrix4x4(
@@ -41,10 +73,11 @@
0, 0, z, 0,
0, 0, 0, 1);
}
- //public static Matrix4 RotateXDegrees(float angle)
- //{
- // return RotateX(angle * (float)(Math.PI / 180.0));
- //}
+ /// <summary>
+ /// Creates a 4x4 matrix which rotates about the x-axis.
+ /// </summary>
+ /// <param name="angle"></param>
+ /// <returns></returns>
public static Matrix4x4 RotateX(float angle)
{
float cos = (float)Math.Cos(angle);
@@ -56,6 +89,11 @@
0, sin, cos, 0,
0, 0, 0, 1);
}
+ /// <summary>
+ /// Creates a 4x4 matrix which rotates about the y-axis.
+ /// </summary>
+ /// <param name="angle"></param>
+ /// <returns></returns>
public static Matrix4x4 RotateY(float angle)
{
float cos = (float)Math.Cos(angle);
@@ -67,6 +105,11 @@
-sin, 0, cos, 0,
0, 0, 0, 1);
}
+ /// <summary>
+ /// Creates a 4x4 matrix which rotates about the z-axis.
+ /// </summary>
+ /// <param name="angle"></param>
+ /// <returns></returns>
public static Matrix4x4 RotateZ(double angle)
{
return RotateZ((float)angle);
@@ -106,6 +149,13 @@
0, 0,-1, 0,
0, 0, 0, 1);
}
+ /// <summary>
+ /// Creates a view matrix given a camera position, and target to look at and an up direction.
+ /// </summary>
+ /// <param name="eye">The camera position.</param>
+ /// <param name="target">The object being looked at (only the direction of target - eye is relevant)</param>
+ /// <param name="up">Which direction is up.</param>
+ /// <returns></returns>
public static Matrix4x4 ViewLookAt(Vector3 eye, Vector3 target, Vector3 up)
{
// equation from
@@ -156,6 +206,14 @@
0, 0, -(zFar + zNear) / zDiff, -2 * zFar * zNear / zDiff,
0, 0, -1, 0);
}
+ /// <summary>
+ /// Creates a projection matrix for an orthogonal perspective, as is used in
+ /// 2D drawing.
+ /// </summary>
+ /// <param name="r"></param>
+ /// <param name="zNear"></param>
+ /// <param name="zFar"></param>
+ /// <returns></returns>
public static Matrix4x4 Ortho(RectangleF r, float zNear, float zFar)
{
// equation from
@@ -168,6 +226,25 @@
0, 0, 0, 1);
}
+ /// <summary>
+ /// Constructs a 4x4 matrix.
+ /// </summary>
+ /// <param name="a11"></param>
+ /// <param name="a12"></param>
+ /// <param name="a13"></param>
+ /// <param name="a14"></param>
+ /// <param name="a21"></param>
+ /// <param name="a22"></param>
+ /// <param name="a23"></param>
+ /// <param name="a24"></param>
+ /// <param name="a31"></param>
+ /// <param name="a32"></param>
+ /// <param name="a33"></param>
+ /// <param name="a34"></param>
+ /// <param name="a41"></param>
+ /// <param name="a42"></param>
+ /// <param name="a43"></param>
+ /// <param name="a44"></param>
public Matrix4x4(float a11, float a12, float a13, float a14,
float a21, float a22, float a23, float a24,
float a31, float a32, float a33, float a34,
@@ -179,6 +256,12 @@
m41 = a41; m42 = a42; m43 = a43; m44 = a44;
}
+ /// <summary>
+ /// Gets or sets a value in the matrix.
+ /// </summary>
+ /// <param name="row"></param>
+ /// <param name="col"></param>
+ /// <returns></returns>
public float this[int row, int col]
{
get
@@ -187,10 +270,10 @@
switch (row)
{
- case 0: return Select(col, m11, m12, m13, m14);
- case 1: return Select(col, m21, m22, m23, m24);
- case 2: return Select(col, m31, m32, m33, m34);
- case 3: return Select(col, m41, m42, m43, m44);
+ case 0: return SelectValue(col, m11, m12, m13, m14);
+ case 1: return SelectValue(col, m21, m22, m23, m24);
+ case 2: return SelectValue(col, m31, m32, m33, m34);
+ case 3: return SelectValue(col, m41, m42, m43, m44);
default: throw new ArgumentOutOfRangeException("row");
}
}
@@ -201,25 +284,24 @@
switch (row)
{
case 0:
- Set(col, value, ref m11, ref m12, ref m13, ref m14);
+ SetValue(col, value, ref m11, ref m12, ref m13, ref m14);
break;
case 1:
- Set(col, value, ref m21, ref m22, ref m23, ref m24);
+ SetValue(col, value, ref m21, ref m22, ref m23, ref m24);
break;
case 2:
- Set(col, value, ref m31, ref m32, ref m33, ref m34);
+ SetValue(col, value, ref m31, ref m32, ref m33, ref m34);
break;
case 3:
- Set(col, value, ref m41, ref m42, ref m43, ref m44);
+ SetValue(col, value, ref m41, ref m42, ref m43, ref m44);
break;
default:
throw new ArgumentOutOfRangeException("row");
}
}
-
}
- private void Set(int index, float value, ref float v1, ref float v2, ref float v3, ref float v4)
+ private void SetValue(int index, float value, ref float v1, ref float v2, ref float v3, ref float v4)
{
switch (index)
{
@@ -232,7 +314,7 @@
}
}
- private float Select(int index, float v1, float v2, float v3, float v4)
+ private float SelectValue(int index, float v1, float v2, float v3, float v4)
{
switch (index)
{
@@ -245,6 +327,10 @@
}
}
+ /// <summary>
+ /// Returns the transpose of a matrix.
+ /// </summary>
+ /// <returns></returns>
public Matrix4x4 Transpose()
{
return new Matrix4x4(
@@ -272,11 +358,22 @@
return retval;
}
-
+ /// <summary>
+ /// Multiplies two matrices together.
+ /// </summary>
+ /// <param name="left"></param>
+ /// <param name="right"></param>
+ /// <returns></returns>
public static Matrix4x4 operator *(Matrix4x4 left, Matrix4x4 right)
{
return left.Mult(right);
}
+ /// <summary>
+ /// Multiplies a matrix on the left by a column vector on the right.
+ /// </summary>
+ /// <param name="left"></param>
+ /// <param name="right"></param>
+ /// <returns></returns>
public static Vector4 operator *(Matrix4x4 left, Vector4 right)
{
Vector4 retval = new Vector4();
Property changes on: branches/shaders/AgateLib/ImplementationBase
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/ImplementationBase:629-702,840-864
/branches/agate3d-3.2/AgateLib/ImplementationBase:923-1034
/branches/build/AgateLib/ImplementationBase:1081-1084
/branches/font/AgateLib/ImplementationBase:778-916
/branches/merge-tests/AgateLib/ImplementationBase:806-810
/branches/registrar/AgateLib/ImplementationBase:595-599
/branches/sprites/AgateLib/ImplementationBase:463-513
+ /branches/agate-3d/AgateLib/ImplementationBase:629-702,840-864
/branches/agate3d-3.2/AgateLib/ImplementationBase:923-1034
/branches/build/AgateLib/ImplementationBase:1081-1084
/branches/font/AgateLib/ImplementationBase:778-916
/branches/merge-tests/AgateLib/ImplementationBase:806-810
/branches/otkupdate/AgateLib/ImplementationBase:1068-1076
/branches/registrar/AgateLib/ImplementationBase:595-599
/branches/sprites/AgateLib/ImplementationBase:463-513
Property changes on: branches/shaders/AgateLib/ImplementationBase/AudioImpl.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/ImplementationBase/AudioImpl.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/ImplementationBase/AudioImpl.cs:923-1034
/branches/build/AgateLib/ImplementationBase/AudioImpl.cs:501-517,1081-1084
/branches/font/AgateLib/ImplementationBase/AudioImpl.cs:778-916
/branches/merge-tests/AgateLib/ImplementationBase/AudioImpl.cs:806-810
/branches/registrar/AgateLib/ImplementationBase/AudioImpl.cs:595-599
/branches/sprites/AgateLib/ImplementationBase/AudioImpl.cs:463-513
+ /branches/agate-3d/AgateLib/ImplementationBase/AudioImpl.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/ImplementationBase/AudioImpl.cs:923-1034
/branches/build/AgateLib/ImplementationBase/AudioImpl.cs:501-517,1081-1084
/branches/font/AgateLib/ImplementationBase/AudioImpl.cs:778-916
/branches/merge-tests/AgateLib/ImplementationBase/AudioImpl.cs:806-810
/branches/otkupdate/AgateLib/ImplementationBase/AudioImpl.cs:1068-1076
/branches/registrar/AgateLib/ImplementationBase/AudioImpl.cs:595-599
/branches/sprites/AgateLib/ImplementationBase/AudioImpl.cs:463-513
Property changes on: branches/shaders/AgateLib/InputLib
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/InputLib:629-702,840-864
/branches/agate3d-3.2/AgateLib/InputLib:923-1034
/branches/build/AgateLib/InputLib:1081-1084
/branches/font/AgateLib/InputLib:778-916
/branches/merge-tests/AgateLib/InputLib:806-810
/branches/registrar/AgateLib/InputLib:595-599
/branches/sprites/AgateLib/InputLib:463-513
+ /branches/agate-3d/AgateLib/InputLib:629-702,840-864
/branches/agate3d-3.2/AgateLib/InputLib:923-1034
/branches/build/AgateLib/InputLib:1081-1084
/branches/font/AgateLib/InputLib:778-916
/branches/merge-tests/AgateLib/InputLib:806-810
/branches/otkupdate/AgateLib/InputLib:1068-1076
/branches/registrar/AgateLib/InputLib:595-599
/branches/sprites/AgateLib/InputLib:463-513
Property changes on: branches/shaders/AgateLib/Meshes/Loaders/OBJFileRepresentation.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/build/AgateLib/Meshes/Loaders/OBJFileRepresentation.cs:1081-1084
+ /branches/build/AgateLib/Meshes/Loaders/OBJFileRepresentation.cs:1081-1084
/branches/otkupdate/AgateLib/Meshes/Loaders/OBJFileRepresentation.cs:1068-1076
Property changes on: branches/shaders/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs:840-864
/branches/build/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs:1081-1084
+ /branches/agate-3d/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs:840-864
/branches/build/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs:1081-1084
/branches/otkupdate/AgateLib/Meshes/Loaders/Obj/OBJFileRepresentation.cs:1068-1076
Property changes on: branches/shaders/AgateLib/Meshes/Loaders/Obj/TokenTypes.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/Meshes/Loaders/Obj/TokenTypes.cs:840-864
/branches/build/AgateLib/Meshes/Loaders/Obj/TokenTypes.cs:1081-1084
+ /branches/agate-3d/AgateLib/Meshes/Loaders/Obj/TokenTypes.cs:840-864
/branches/build/AgateLib/Meshes/Loaders/Obj/TokenTypes.cs:1081-1084
/branches/otkupdate/AgateLib/Meshes/Loaders/Obj/TokenTypes.cs:1068-1076
Property changes on: branches/shaders/AgateLib/Resources/AgateResourceCollection.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/Resources/AgateResourceCollection.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Resources/AgateResourceCollection.cs:923-1034
/branches/build/AgateLib/Resources/AgateResourceCollection.cs:1081-1084
/branches/build/AgateLib/Resources/AgateResourceManager.cs:447-448,501-517
/branches/font/AgateLib/Resources/AgateResourceCollection.cs:778-916
/branches/merge-tests/AgateLib/Resources/AgateResourceCollection.cs:806-810
/branches/registrar/AgateLib/Resources/AgateResourceCollection.cs:595-599
/branches/sprites/AgateLib/Resources/AgateResourceManager.cs:463-513
+ /branches/agate-3d/AgateLib/Resources/AgateResourceCollection.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Resources/AgateResourceCollection.cs:923-1034
/branches/build/AgateLib/Resources/AgateResourceCollection.cs:1081-1084
/branches/build/AgateLib/Resources/AgateResourceManager.cs:447-448,501-517
/branches/font/AgateLib/Resources/AgateResourceCollection.cs:778-916
/branches/merge-tests/AgateLib/Resources/AgateResourceCollection.cs:806-810
/branches/otkupdate/AgateLib/Resources/AgateResourceCollection.cs:1068-1076
/branches/registrar/AgateLib/Resources/AgateResourceCollection.cs:595-599
/branches/sprites/AgateLib/Resources/AgateResourceManager.cs:463-513
Property changes on: branches/shaders/AgateLib/Resources/AgateResourceLoader.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/Resources/AgateResourceLoader.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Resources/AgateResourceLoader.cs:923-1034
/branches/build/AgateLib/Resources/AgateResourceLoader.cs:1081-1084
/branches/font/AgateLib/Resources/AgateResourceLoader.cs:778-916
/branches/merge-tests/AgateLib/Resources/AgateResourceLoader.cs:806-810
/branches/registrar/AgateLib/Resources/AgateResourceLoader.cs:595-599
+ /branches/agate-3d/AgateLib/Resources/AgateResourceLoader.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Resources/AgateResourceLoader.cs:923-1034
/branches/build/AgateLib/Resources/AgateResourceLoader.cs:1081-1084
/branches/font/AgateLib/Resources/AgateResourceLoader.cs:778-916
/branches/merge-tests/AgateLib/Resources/AgateResourceLoader.cs:806-810
/branches/otkupdate/AgateLib/Resources/AgateResourceLoader.cs:1068-1076
/branches/registrar/AgateLib/Resources/AgateResourceLoader.cs:595-599
Property changes on: branches/shaders/AgateLib/Resources/BitmapFontResource.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/Resources/BitmapFontResource.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Resources/BitmapFontResource.cs:923-1034
/branches/build/AgateLib/Resources/BitmapFontResource.cs:1081-1084
/branches/font/AgateLib/Resources/BitmapFontResource.cs:778-916
/branches/merge-tests/AgateLib/Resources/BitmapFontResource.cs:806-810
+ /branches/agate-3d/AgateLib/Resources/BitmapFontResource.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Resources/BitmapFontResource.cs:923-1034
/branches/build/AgateLib/Resources/BitmapFontResource.cs:1081-1084
/branches/font/AgateLib/Resources/BitmapFontResource.cs:778-916
/branches/merge-tests/AgateLib/Resources/BitmapFontResource.cs:806-810
/branches/otkupdate/AgateLib/Resources/BitmapFontResource.cs:1068-1076
Property changes on: branches/shaders/AgateLib/Sprites/Sprite.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate3d-3.2/AgateLib/Sprites/Sprite.cs:923-1034
/branches/build/AgateLib/Sprites/NewSprite.cs:447-517
/branches/build/AgateLib/Sprites/Sprite.cs:1081-1084
/branches/font/AgateLib/Sprites/Sprite.cs:778-916
/branches/merge-tests/AgateLib/Sprites/Sprite.cs:806-810
/branches/registrar/AgateLib/Sprites/NewSprite.cs:595-599
/branches/sprites/AgateLib/Sprites/NewSprite.cs:463-513
+ /branches/agate3d-3.2/AgateLib/Sprites/Sprite.cs:923-1034
/branches/build/AgateLib/Sprites/NewSprite.cs:447-517
/branches/build/AgateLib/Sprites/Sprite.cs:1081-1084
/branches/font/AgateLib/Sprites/Sprite.cs:778-916
/branches/merge-tests/AgateLib/Sprites/Sprite.cs:806-810
/branches/otkupdate/AgateLib/Sprites/Sprite.cs:1068-1076
/branches/registrar/AgateLib/Sprites/NewSprite.cs:595-599
/branches/sprites/AgateLib/Sprites/NewSprite.cs:463-513
Property changes on: branches/shaders/AgateLib/Sprites/SpriteFrame.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate3d-3.2/AgateLib/Sprites/SpriteFrame.cs:923-1034
/branches/build/AgateLib/Sprites/NewSpriteFrame.cs:447-517
/branches/build/AgateLib/Sprites/SpriteFrame.cs:1081-1084
/branches/font/AgateLib/Sprites/SpriteFrame.cs:778-916
/branches/merge-tests/AgateLib/Sprites/SpriteFrame.cs:806-810
/branches/registrar/AgateLib/Sprites/NewSpriteFrame.cs:595-599
/branches/sprites/AgateLib/Sprites/NewSpriteFrame.cs:463-513
+ /branches/agate3d-3.2/AgateLib/Sprites/SpriteFrame.cs:923-1034
/branches/build/AgateLib/Sprites/NewSpriteFrame.cs:447-517
/branches/build/AgateLib/Sprites/SpriteFrame.cs:1081-1084
/branches/font/AgateLib/Sprites/SpriteFrame.cs:778-916
/branches/merge-tests/AgateLib/Sprites/SpriteFrame.cs:806-810
/branches/otkupdate/AgateLib/Sprites/SpriteFrame.cs:1068-1076
/branches/registrar/AgateLib/Sprites/NewSpriteFrame.cs:595-599
/branches/sprites/AgateLib/Sprites/NewSpriteFrame.cs:463-513
Property changes on: branches/shaders/AgateLib/Timing.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/Timing.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Timing.cs:923-1034
/branches/build/AgateLib/Timing.cs:501-517,1081-1084
/branches/font/AgateLib/Timing.cs:778-916
/branches/merge-tests/AgateLib/Timing.cs:806-810
/branches/registrar/AgateLib/Timing.cs:595-599
/branches/sprites/AgateLib/Timing.cs:463-513
+ /branches/agate-3d/AgateLib/Timing.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Timing.cs:923-1034
/branches/build/AgateLib/Timing.cs:501-517,1081-1084
/branches/font/AgateLib/Timing.cs:778-916
/branches/merge-tests/AgateLib/Timing.cs:806-810
/branches/otkupdate/AgateLib/Timing.cs:1068-1076
/branches/registrar/AgateLib/Timing.cs:595-599
/branches/sprites/AgateLib/Timing.cs:463-513
Property changes on: branches/shaders/AgateLib/Utility/Platform.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/AgateLib/Utility/Platform.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Utility/Platform.cs:923-1034
/branches/build/AgateLib/Utility/Platform.cs:501-517,1081-1084
/branches/font/AgateLib/Utility/Platform.cs:778-916
/branches/merge-tests/AgateLib/Utility/Platform.cs:806-810
/branches/registrar/AgateLib/Utility/Platform.cs:595-599
/branches/sprites/AgateLib/Utility/Platform.cs:463-513
+ /branches/agate-3d/AgateLib/Utility/Platform.cs:629-702,840-864
/branches/agate3d-3.2/AgateLib/Utility/Platform.cs:923-1034
/branches/build/AgateLib/Utility/Platform.cs:501-517,1081-1084
/branches/font/AgateLib/Utility/Platform.cs:778-916
/branches/merge-tests/AgateLib/Utility/Platform.cs:806-810
/branches/otkupdate/AgateLib/Utility/Platform.cs:1068-1076
/branches/registrar/AgateLib/Utility/Platform.cs:595-599
/branches/sprites/AgateLib/Utility/Platform.cs:463-513
Property changes on: branches/shaders/Drivers
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/Drivers:629-702,840-864
/branches/agate3d-3.2/Drivers:923-1034
/branches/build/Drivers:501-517,1081-1084
/branches/font/Drivers:778-916
/branches/merge-tests/Drivers:806-810
/branches/registrar/Drivers:595-599
/branches/sprites/Drivers:463-513
+ /branches/agate-3d/Drivers:629-702,840-864
/branches/agate3d-3.2/Drivers:923-1034
/branches/build/Drivers:501-517,1081-1084
/branches/font/Drivers:778-916
/branches/merge-tests/Drivers:806-810
/branches/otkupdate/Drivers:1068-1076
/branches/registrar/Drivers:595-599
/branches/sprites/Drivers:463-513
Property changes on: branches/shaders/Drivers/AgateDrawing/Drawing_Reporter.cs
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/Drivers/AgateDrawing/Drawing_Reporter.cs:629-702,840-864
/branches/agate3d-3.2/Drivers/AgateDrawing/Drawing_Reporter.cs:923-1034
/branches/build/Drivers/AgateDrawing/Drawing_Reporter.cs:1081-1084
/branches/font/Drivers/AgateDrawing/Drawing_Reporter.cs:778-916
/branches/merge-tests/Drivers/AgateDrawing/Drawing_Reporter.cs:806-810
+ /branches/agate-3d/Drivers/AgateDrawing/Drawing_Reporter.cs:629-702,840-864
/branches/agate3d-3.2/Drivers/AgateDrawing/Drawing_Reporter.cs:923-1034
/branches/build/Drivers/AgateDrawing/Drawing_Reporter.cs:1081-1084
/branches/font/Drivers/AgateDrawing/Drawing_Reporter.cs:778-916
/branches/merge-tests/Drivers/AgateDrawing/Drawing_Reporter.cs:806-810
/branches/otkupdate/Drivers/AgateDrawing/Drawing_Reporter.cs:1068-1076
Property changes on: branches/shaders/Drivers/AgateLib.WinForms
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/agate-3d/Drivers/AgateLib.WinForms:629-702,840-864
/branches/agate3d-3.2/Drivers/AgateLib.WinForms:923-1034
/branches/build/Drivers/AgateLib.WinForms:501,1081-1084
/branches/font/Drivers/AgateLib.WinForms:778-916
/branches/merge-tests/Drivers/AgateLib.WinForms:806-810
/branches/registrar/Drivers/AgateLib.WinForms:595-599
+ /branches/agate-3d/Drivers/AgateLib.WinForms:629-702,840-864
/branches/agate3d-3.2/Drivers/AgateLib.WinForms:923-1034
/branches/build/Drivers/AgateLib.WinForms:501,1081-1084
/branches/font/Drivers/AgateLib.WinForms:778-916
/branches/merge-tests/Drivers/AgateLib.WinForms:806-810
/branches/otkupdate/Drivers/AgateLib.WinForms:1068-1076
/branches/registrar/Drivers/AgateLib.WinForms:595-599
Modified: branches/shaders/Drivers/AgateOTK/AL_Audio.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/AL_Audio.cs 2009-11-13 19:34:18 UTC (rev 1095)
+++ branches/shaders/Drivers/AgateOTK/AL_Audio.cs 2009-11-15 06:06:01 UTC (rev 1096)
@@ -23,6 +23,7 @@
using AgateLib.ImplementationBase;
using AgateLib.Drivers;
using OpenTK.Audio;
+using OpenTK.Audio.OpenAL;
namespace AgateOTK
{
@@ -72,7 +73,11 @@
using (AudioReader reader = new AudioReader(inStream))
{
buffer = AL.GenBuffer();
- AL.BufferData(buffer, reader.ReadToEnd());
+
+ // TODO: Figure out if OpenAL is worth supporting, and if so
+ // figure out how to update this method call.
+ throw new NotImplementedException();
+ //AL.BufferData(buffer, reader.Re...
[truncated message content] |
|
From: <ka...@us...> - 2009-11-13 19:34:26
|
Revision: 1095
http://agate.svn.sourceforge.net/agate/?rev=1095&view=rev
Author: kanato
Date: 2009-11-13 19:34:18 +0000 (Fri, 13 Nov 2009)
Log Message:
-----------
remove OTK_Basic2DShader_FF.cs
Removed Paths:
-------------
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_Basic2DShader_FF.cs
Deleted: branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_Basic2DShader_FF.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_Basic2DShader_FF.cs 2009-11-13 19:18:34 UTC (rev 1094)
+++ branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_Basic2DShader_FF.cs 2009-11-13 19:34:18 UTC (rev 1095)
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using AgateLib.DisplayLib.Shaders;
-using AgateLib.DisplayLib.Shaders.Implementation;
-
-namespace AgateOTK.Shaders.FixedFunction
-{
- class OTK_Basic2DShader_FF : AgateShaderImpl
- {
- public override void Begin()
- {
- }
-
- public override void BeginPass(int passIndex)
- {
- }
-
- public override void End()
- {
- }
-
- public override void EndPass()
- {
- }
-
- public override int Passes
- {
- get { return 1; }
- }
-
- public override void SetTexture(EffectTexture tex, string variableName)
- {
- }
-
- public override void SetVariable(string name, AgateLib.Geometry.Color color)
- {
- }
-
- public override void SetVariable(string name, AgateLib.Geometry.Matrix4x4 matrix)
- {
- }
-
- public override void SetVariable(string name, params int[] v)
- {
- }
-
- public override void SetVariable(string name, params float[] v)
- {
- }
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-13 19:18:43
|
Revision: 1094
http://agate.svn.sourceforge.net/agate/?rev=1094&view=rev
Author: kanato
Date: 2009-11-13 19:18:34 +0000 (Fri, 13 Nov 2009)
Log Message:
-----------
Initial implementation of Lighting3D for D3D and OpenGL.
Move DisplayCapsInfo instance to Display class.
Move MaxSurfaceSize to DisplayCapsInfo class.
Modified Paths:
--------------
branches/shaders/AgateLib/AgateLib.csproj
branches/shaders/AgateLib/AgateSetup.cs
branches/shaders/AgateLib/DisplayLib/Display.cs
branches/shaders/AgateLib/DisplayLib/DisplayCapsInfo.cs
branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs
branches/shaders/AgateLib/Geometry/Matrix4x4.cs
branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs
branches/shaders/AgateLib-Windows.sln
branches/shaders/Drivers/AgateDrawing/Drawing_Display.cs
branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
branches/shaders/Drivers/AgateOTK/GL_Display.cs
branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs
branches/shaders/Drivers/AgateOTK/GL_GameWindow.cs
branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
branches/shaders/Drivers/AgateSDX/AgateSDX.csproj
branches/shaders/Drivers/AgateSDX/HlslEffect.cs
branches/shaders/Drivers/AgateSDX/SDX_Display.cs
branches/shaders/TODO.txt
branches/shaders/Tests/Shaders/Hlsl.cs
branches/shaders/Tests/Tests.csproj
Added Paths:
-----------
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Lighting3D.cs
branches/shaders/Drivers/AgateOTK/GeoHelper.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting2D.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs
branches/shaders/Drivers/AgateSDX/GeoHelper.cs
branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/
branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs
branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs
Modified: branches/shaders/AgateLib/AgateLib.csproj
===================================================================
--- branches/shaders/AgateLib/AgateLib.csproj 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/AgateLib/AgateLib.csproj 2009-11-13 19:18:34 UTC (rev 1094)
@@ -104,7 +104,9 @@
<Compile Include="DisplayLib\Shaders\Implementation\AgateShaderImpl.cs" />
<Compile Include="DisplayLib\Shaders\Implementation\BuiltInShader.cs" />
<Compile Include="DisplayLib\Shaders\Implementation\Lighting2DImpl.cs" />
+ <Compile Include="DisplayLib\Shaders\Implementation\Lighting3DImpl.cs" />
<Compile Include="DisplayLib\Shaders\Lighting2D.cs" />
+ <Compile Include="DisplayLib\Shaders\Lighting3D.cs" />
<Compile Include="IFileProvider.cs">
<SubType>Code</SubType>
</Compile>
Modified: branches/shaders/AgateLib/AgateSetup.cs
===================================================================
--- branches/shaders/AgateLib/AgateSetup.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/AgateLib/AgateSetup.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -170,6 +170,7 @@
/// Automatically selects the driver to use, or asks the user which
/// driver to use if appropriate.
/// </summary>
+ [Obsolete("Use Initialize(bool, bool, bool) overload instead.")]
public void InitializeDisplay()
{
DoAskUser();
@@ -191,6 +192,7 @@
/// Initializes the Audio subsystem.
/// Automatically picks which driver to use.
/// </summary>
+ [Obsolete("Use Initialize(bool, bool, bool) overload instead.")]
public void InitializeAudio()
{
DoAskUser();
@@ -212,6 +214,7 @@
/// Initializes the Input subsystem.
/// Automatically picks which driver to use.
/// </summary>
+ [Obsolete("Use Initialize(bool, bool, bool) overload instead.")]
public void InitializeInput()
{
DoAskUser();
Modified: branches/shaders/AgateLib/DisplayLib/Display.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Display.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/AgateLib/DisplayLib/Display.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -65,6 +65,7 @@
private static Rectangle mCurrentClipRect;
private static Stack<Rectangle> mClipRects = new Stack<Rectangle>();
private static RenderStateAdapter mRenderState = new RenderStateAdapter();
+ private static DisplayCapsInfo mCapsInfo = new DisplayCapsInfo();
/// <summary>
/// Gets the object which handles all of the actual calls to Display functions.
@@ -99,6 +100,7 @@
Shaders.AgateBuiltInShaders.InitializeShaders();
}
+
public static RenderStateAdapter RenderState
{
get { return mRenderState; }
@@ -145,7 +147,7 @@
[Obsolete]
public static Shaders.Effect Effect
{
- get { throw new Exception(); }
+ get { return null; }
set { throw new Exception(); }
}
@@ -294,6 +296,8 @@
throw new AgateException("The current window has been closed, and a new render target has not been set. A render target must be set to continue rendering.");
impl.BeginFrame();
+ AgateBuiltInShaders.Basic2DShader.Activate();
+
mCurrentClipRect = new Rectangle(0, 0, RenderTarget.Width, RenderTarget.Height);
}
/// <summary>
@@ -362,7 +366,7 @@
/// </summary>
public static Size MaxSurfaceSize
{
- get { return impl.MaxSurfaceSize; }
+ get { return Caps.MaxSurfaceSize; }
}
/// <summary>
/// Gets the object which handles packing of all surfaces.
@@ -670,7 +674,7 @@
/// </summary>
public static DisplayCapsInfo Caps
{
- get { return impl.Caps; }
+ get { return mCapsInfo; }
}
internal static void SavePixelBuffer(PixelBuffer pixelBuffer, string filename, ImageFileFormat format)
Modified: branches/shaders/AgateLib/DisplayLib/DisplayCapsInfo.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/DisplayCapsInfo.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/AgateLib/DisplayLib/DisplayCapsInfo.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using AgateLib.Geometry;
namespace AgateLib.DisplayLib
{
@@ -113,8 +114,17 @@
{
get { return Display.Impl.Supports(DisplayBoolCaps.CanCreateBitmapFont); }
}
+
+ public Size MaxSurfaceSize
+ {
+ get { return Display.Impl.CapsSize(DisplaySizeCaps.MaxSurfaceSize); }
+ }
}
+ public enum DisplaySizeCaps
+ {
+ MaxSurfaceSize,
+ }
public enum DisplayBoolCaps
{
/// <summary>
Modified: branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -14,18 +14,20 @@
Basic2DShader = new Basic2DShader();
Lighting2D = new Lighting2D();
+ Lighting3D = new Lighting3D();
-
Basic2DShader.Activate();
}
internal static void DisposeShaders()
{
Basic2DShader = null;
Lighting2D = null;
+ Lighting3D = null;
}
public static Basic2DShader Basic2DShader { get; private set; }
public static Lighting2D Lighting2D { get; private set; }
+ public static Lighting3D Lighting3D { get; private set; }
}
}
Modified: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -27,5 +27,6 @@
{
Basic2DShader,
Lighting2D,
+ Lighting3D,
}
}
Added: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs (rev 0)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting3DImpl.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.Geometry;
+
+namespace AgateLib.DisplayLib.Shaders.Implementation
+{
+ public abstract class Lighting3DImpl : AgateShaderImpl
+ {
+ public abstract Matrix4x4 Projection { get; set; }
+ public abstract Matrix4x4 View { get; set; }
+ public abstract Matrix4x4 World { get; set; }
+
+ public abstract Light[] Lights { get; }
+ public abstract Color AmbientLight { get; set; }
+ }
+}
Added: branches/shaders/AgateLib/DisplayLib/Shaders/Lighting3D.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/Lighting3D.cs (rev 0)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/Lighting3D.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.DisplayLib.Shaders.Implementation;
+using AgateLib.Geometry;
+
+namespace AgateLib.DisplayLib.Shaders
+{
+ public class Lighting3D : Implementation.AgateInternalShader
+ {
+ protected override BuiltInShader BuiltInShaderType
+ {
+ get { return BuiltInShader.Lighting3D; }
+ }
+
+ protected new Lighting3DImpl Impl { get { return (Lighting3DImpl)base.Impl;}}
+
+ public Matrix4x4 Projection { get { return Impl.Projection; } set { Impl.Projection = value; } }
+ public Matrix4x4 View { get { return Impl.View; } set { Impl.View = value; } }
+ public Matrix4x4 World { get { return Impl.World; } set { Impl.World= value; } }
+
+ public Light[] Lights { get { return Impl.Lights; } }
+ public Color AmbientLight { get { return Impl.AmbientLight; } set { Impl.AmbientLight = value; } }
+ }
+}
Modified: branches/shaders/AgateLib/Geometry/Matrix4x4.cs
===================================================================
--- branches/shaders/AgateLib/Geometry/Matrix4x4.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/AgateLib/Geometry/Matrix4x4.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -67,6 +67,10 @@
-sin, 0, cos, 0,
0, 0, 0, 1);
}
+ public static Matrix4x4 RotateZ(double angle)
+ {
+ return RotateZ((float)angle);
+ }
public static Matrix4x4 RotateZ(float angle)
{
float cos = (float)Math.Cos(angle);
@@ -102,7 +106,7 @@
0, 0,-1, 0,
0, 0, 0, 1);
}
- public static Matrix4x4 LookAt(Vector3 eye, Vector3 target, Vector3 up)
+ public static Matrix4x4 ViewLookAt(Vector3 eye, Vector3 target, Vector3 up)
{
// equation from
// http://pyopengl.sourceforge.net/documentation/manual/gluLookAt.3G.xml
@@ -114,6 +118,7 @@
Vector3 s = f.CrossProduct(up);
s /= s.Magnitude;
+ s /= s.Magnitude;
Vector3 u = s.CrossProduct(f);
Modified: branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs
===================================================================
--- branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -35,11 +35,12 @@
public abstract class DisplayImpl : DriverImplBase
{
private double mAlphaThreshold = 5.0 / 255.0;
- private DisplayLib.DisplayCapsInfo mCapsInfo = new DisplayCapsInfo();
private IRenderTarget mRenderTarget;
public abstract bool Supports(DisplayBoolCaps caps);
+ public abstract Size CapsSize(DisplaySizeCaps displaySizeCaps);
+
public abstract IEnumerable<DisplayLib.Shaders.ShaderLanguage> SupportedShaderLanguages { get; }
private static AgateShader mShader;
@@ -322,10 +323,8 @@
}
#endregion
- /// <summary>
- /// Returns the maximum size a surface object can be.
- /// </summary>
- public abstract Size MaxSurfaceSize { get; }
+ [Obsolete("Use Display.Caps instead.", true)]
+ public virtual Size MaxSurfaceSize { get { return Display.Caps.MaxSurfaceSize; } }
#region --- SetClipRect ---
@@ -551,14 +550,6 @@
public abstract void SetOrthoProjection(Rectangle region);
/// <summary>
- /// Gets the capabilities of the Display object.
- /// </summary>
- public DisplayCapsInfo Caps
- {
- get { return mCapsInfo; }
- }
-
- /// <summary>
/// Processes pending events.
/// </summary>
protected internal abstract void ProcessEvents();
@@ -633,13 +624,16 @@
[Obsolete]
public virtual Effect Effect
{
- get { throw new NotSupportedException("The current driver does not support shaders."); }
+ get { return null; }
set { throw new NotSupportedException("The current driver does not support shaders."); }
}
public virtual AgateShader Shader
{
get { return mShader; }
- set {
+ set
+ {
+ FlushDrawBuffer();
+
if (mShader != null)
mShader.End();
@@ -670,10 +664,6 @@
/// </summary>
/// <param name="BuiltInShaderType"></param>
/// <returns></returns>
- protected internal virtual AgateShaderImpl CreateBuiltInShader(AgateLib.DisplayLib.Shaders.Implementation.BuiltInShader BuiltInShaderType)
- {
- // TODO: make this abstract.
- return null;
- }
+ protected internal abstract AgateShaderImpl CreateBuiltInShader(AgateLib.DisplayLib.Shaders.Implementation.BuiltInShader BuiltInShaderType);
}
}
Modified: branches/shaders/AgateLib-Windows.sln
===================================================================
--- branches/shaders/AgateLib-Windows.sln 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/AgateLib-Windows.sln 2009-11-13 19:18:34 UTC (rev 1094)
@@ -6,7 +6,7 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateSDL", "Drivers\AgateSDL\AgateSDL.csproj", "{00C7FA95-98F4-43D9-9B63-34122B1DB003}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateSDX", "Drivers\AgateSDX\AgateSDX.csproj", "{6C4E3198-7D6D-41E5-BFA2-AC28ADDAE2B6}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateSDX", "Drivers\AgateSDX\AgateSDX.csproj", "{EF993B30-D9A9-4962-80BB-6826D39B3465}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{DC687DB2-90A8-484D-AB99-B3D29FDD8D44}"
EndProject
@@ -41,10 +41,10 @@
{00C7FA95-98F4-43D9-9B63-34122B1DB003}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00C7FA95-98F4-43D9-9B63-34122B1DB003}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00C7FA95-98F4-43D9-9B63-34122B1DB003}.Release|Any CPU.Build.0 = Release|Any CPU
- {6C4E3198-7D6D-41E5-BFA2-AC28ADDAE2B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6C4E3198-7D6D-41E5-BFA2-AC28ADDAE2B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6C4E3198-7D6D-41E5-BFA2-AC28ADDAE2B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6C4E3198-7D6D-41E5-BFA2-AC28ADDAE2B6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EF993B30-D9A9-4962-80BB-6826D39B3465}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EF993B30-D9A9-4962-80BB-6826D39B3465}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EF993B30-D9A9-4962-80BB-6826D39B3465}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EF993B30-D9A9-4962-80BB-6826D39B3465}.Release|Any CPU.Build.0 = Release|Any CPU
{DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|Any CPU.ActiveCfg = Release|Any CPU
Modified: branches/shaders/Drivers/AgateDrawing/Drawing_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateDrawing/Drawing_Display.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/Drivers/AgateDrawing/Drawing_Display.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -234,11 +234,6 @@
get { return PixelFormat.BGRA8888; }
}
- public override Geometry.Size MaxSurfaceSize
- {
- get { return new Geometry.Size(1024, 1024); }
- }
-
public override void FlushDrawBuffer()
{
}
@@ -294,7 +289,18 @@
return false;
}
+ public override AgateLib.Geometry.Size CapsSize(DisplaySizeCaps displaySizeCaps)
+ {
+ switch (displaySizeCaps)
+ {
+ case DisplaySizeCaps.MaxSurfaceSize:
+ return new Geometry.Size(1024, 1024);
+ default:
+ return new AgateLib.Geometry.Size(0, 0);
+ }
+ }
+
public override IEnumerable<AgateLib.DisplayLib.Shaders.ShaderLanguage> SupportedShaderLanguages
{
get { yield return AgateLib.DisplayLib.Shaders.ShaderLanguage.None; }
Modified: branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
===================================================================
--- branches/shaders/Drivers/AgateOTK/AgateOTK.csproj 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/Drivers/AgateOTK/AgateOTK.csproj 2009-11-13 19:18:34 UTC (rev 1094)
@@ -128,6 +128,7 @@
<DependentUpon>frmFullScreen.cs</DependentUpon>
<SubType>Code</SubType>
</Compile>
+ <Compile Include="GeoHelper.cs" />
<Compile Include="GLDrawBuffer.cs">
<SubType>Code</SubType>
</Compile>
@@ -174,8 +175,9 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="Shaders\FixedFunction\FixedFunctionShaderFactory.cs" />
- <Compile Include="Shaders\FixedFunction\OTK_Basic2DShader_FF.cs" />
- <Compile Include="Shaders\FixedFunction\OTK_Lighting2D_FF.cs" />
+ <Compile Include="Shaders\FixedFunction\OTK_FF_Basic2DShader.cs" />
+ <Compile Include="Shaders\FixedFunction\OTK_FF_Lighting3D.cs" />
+ <Compile Include="Shaders\FixedFunction\OTK_FF_Lighting2D.cs" />
<Compile Include="Shaders\ShaderFactory.cs" />
<Compile Include="TextureCoordinates.cs">
<SubType>Code</SubType>
Modified: branches/shaders/Drivers/AgateOTK/GL_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -46,6 +46,9 @@
private bool mSupportsShaders;
private decimal mGLVersion;
+ System.Windows.Forms.Form mFakeWindow;
+ DisplayWindow mFakeDisplayWindow;
+
public bool NonPowerOf2Textures
{
get { return mNonPowerOf2Textures; }
@@ -164,11 +167,6 @@
get { return mState; }
}
- // TODO: Make this not hardcoded
- public override Size MaxSurfaceSize
- {
- get { return new Size(1024, 1024); }
- }
// TODO: Test clip rect stuff.
public override void SetClipRect(Rectangle newClipRect)
@@ -227,7 +225,7 @@
private void SetModelview()
{
- OpenTK.Math.Matrix4 modelview = ConvertAgateMatrix(view * world, false);
+ OpenTK.Math.Matrix4 modelview = GeoHelper.ConvertAgateMatrix(view * world, false);
GL.MatrixMode(MatrixMode.Modelview);
GL.LoadIdentity();
@@ -235,24 +233,14 @@
}
private void SetProjection()
{
- OpenTK.Math.Matrix4 otkProjection = ConvertAgateMatrix(projection, false);
+ OpenTK.Math.Matrix4 otkProjection = GeoHelper.ConvertAgateMatrix(projection, false);
GL.MatrixMode(MatrixMode.Projection);
GL.LoadIdentity();
GL.LoadMatrix(ref otkProjection);
}
- private OpenTK.Math.Matrix4 ConvertAgateMatrix(Matrix4x4 matrix, bool invertY)
- {
- int sign = invertY ? -1 : 1;
- return new OpenTK.Math.Matrix4(
- new OpenTK.Math.Vector4(matrix[0, 0], sign * matrix[1, 0], matrix[2, 0], matrix[3, 0]),
- new OpenTK.Math.Vector4(matrix[0, 1], sign * matrix[1, 1], matrix[2, 1], matrix[3, 1]),
- new OpenTK.Math.Vector4(matrix[0, 2], sign * matrix[1, 2], matrix[2, 2], matrix[3, 2]),
- new OpenTK.Math.Vector4(matrix[0, 3], sign * matrix[1, 3], matrix[2, 3], matrix[3, 3]));
- }
-
public override void Clear(Color color)
{
mState.DrawBuffer.Flush();
@@ -379,16 +367,12 @@
public override void Initialize()
{
mState = new GLState();
+ CreateFakeWindow();
Report("OpenTK / OpenGL driver instantiated for display.");
}
-
- bool glInitialized = false;
-
- internal void InitializeGL()
+ public void InitializeCurrentContext()
{
- if (glInitialized)
- return;
GL.ShadeModel(ShadingModel.Smooth); // Enable Smooth Shading
GL.ClearColor(0, 0, 0, 1.0f); // Black Background
@@ -398,18 +382,34 @@
GL.Hint(HintTarget.PerspectiveCorrectionHint, // Really Nice Perspective Calculations
HintMode.Nicest);
+ }
+ private void CreateFakeWindow()
+ {
+ mFakeWindow = new System.Windows.Forms.Form();
+ mFakeDisplayWindow = DisplayWindow.CreateFromControl(mFakeWindow);
+
+ mFakeWindow.Visible = false;
+
string vendor = GL.GetString(StringName.Vendor);
string ext = GL.GetString(StringName.Extensions);
mSupportsShaders = false;
mGLVersion = DetectOpenGLVersion();
- if (mGLVersion >= 2m)
+ mSupportsFramebuffer = GL.SupportsExtension("GL_EXT_FRAMEBUFFER_OBJECT");
+ mNonPowerOf2Textures = GL.SupportsExtension("GL_ARB_NON_POWER_OF_TWO");
+
+ if (mGLVersion >= 3m)
{
mSupportsFramebuffer = true;
mNonPowerOf2Textures = true;
mSupportsShaders = true;
}
+ if (mGLVersion >= 2m)
+ {
+ mNonPowerOf2Textures = true;
+ mSupportsShaders = true;
+ }
else if (mGLVersion >= 1.5m)
{
mSupportsFramebuffer = true;
@@ -417,8 +417,6 @@
}
else
{
- mSupportsFramebuffer = GL.SupportsExtension("GL_EXT_FRAMEBUFFER_OBJECT");
- mNonPowerOf2Textures = GL.SupportsExtension("GL_ARB_NON_POWER_OF_TWO");
}
if (GL.SupportsExtension("GL_ARB_FRAGMENT_PROGRAM"))
@@ -427,9 +425,6 @@
}
InitializeShaders();
-
- glInitialized = true;
-
}
private static decimal DetectOpenGLVersion()
@@ -505,6 +500,8 @@
}
public override void Dispose()
{
+ mFakeDisplayWindow.Dispose();
+ mFakeWindow.Dispose();
}
@@ -526,7 +523,7 @@
protected override ShaderCompilerImpl CreateShaderCompiler()
{
- if (this.Caps.SupportsCustomShaders)
+ if (this.Supports(DisplayBoolCaps.CustomShaders))
{
if (mGLVersion < 2.0m)
return new ArbShaderCompiler();
@@ -587,7 +584,15 @@
return false;
}
+ public override Size CapsSize(DisplaySizeCaps displaySizeCaps)
+ {
+ switch (displaySizeCaps)
+ {
+ case DisplaySizeCaps.MaxSurfaceSize: return new Size(1024, 1024);
+ }
+ return new Size(0, 0);
+ }
public override IEnumerable<AgateLib.DisplayLib.Shaders.ShaderLanguage> SupportedShaderLanguages
{
get { yield return AgateLib.DisplayLib.Shaders.ShaderLanguage.Glsl; }
Modified: branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/Drivers/AgateOTK/GL_DisplayControl.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -85,8 +85,6 @@
CreateContext();
- mDisplay.InitializeGL();
-
AttachEvents();
}
else
@@ -107,11 +105,11 @@
CreateWindowedDisplay();
mDisplay = Display.Impl as GL_Display;
- mDisplay.InitializeGL();
-
}
mDisplay.ProcessEventsEvent += new EventHandler(mDisplay_ProcessEventsEvent);
+ mDisplay.InitializeCurrentContext();
+
}
void mDisplay_ProcessEventsEvent(object sender, EventArgs e)
Modified: branches/shaders/Drivers/AgateOTK/GL_GameWindow.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_GameWindow.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/Drivers/AgateOTK/GL_GameWindow.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -192,9 +192,11 @@
CreateWindowedDisplay();
mDisplay = Display.Impl as GL_Display;
- mDisplay.InitializeGL();
mDisplay.ProcessEventsEvent += new EventHandler(mDisplay_ProcessEventsEvent);
+
+ mDisplay.InitializeCurrentContext();
+
}
bool done = false;
Modified: branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/Drivers/AgateOTK/GL_VertexBuffer.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -108,7 +108,6 @@
mAttributeBuffers[i].Type,
false, 0, IntPtr.Zero);
}*/
- throw new NotImplementedException();
}
@@ -158,45 +157,43 @@
(IntPtr)mLayout.ElementByteIndex(VertexElement.Texture));
}
- /*
- GlslShader shader = Display.Shader as GlslShader;
+
+ //GlslShader shader = Display.Shader as GlslShader;
if (Textures.ActiveTextures > 1)
{
- for (int i = 0; i < Textures.Count; i++)
- {
- GL.ActiveTexture((TextureUnit)(TextureUnit.Texture0 + i));
+ //for (int i = 0; i < Textures.Count; i++)
+ //{
+ // GL.ActiveTexture((TextureUnit)(TextureUnit.Texture0 + i));
- Surface surf = Textures[i];
+ // Surface surf = Textures[i];
- if (surf != null)
- {
- GL_Surface gl_surf = (GL_Surface)Textures[i].Impl;
+ // if (surf != null)
+ // {
+ // GL_Surface gl_surf = (GL_Surface)Textures[i].Impl;
- GL.Enable(EnableCap.Texture2D);
- GL.BindTexture(TextureTarget.Texture2D, gl_surf.GLTextureID);
+ // GL.Enable(EnableCap.Texture2D);
+ // GL.BindTexture(TextureTarget.Texture2D, gl_surf.GLTextureID);
- if (shader != null)
- {
- if (i < shader.Sampler2DUniforms.Count)
- {
- shader.SetUniform(shader.Sampler2DUniforms[i], i);
- }
- }
- }
- else
- {
- GL.Disable(EnableCap.Texture2D);
- GL.BindTexture(TextureTarget.Texture2D, 0);
- }
- }
+ // if (shader != null)
+ // {
+ // if (i < shader.Sampler2DUniforms.Count)
+ // {
+ // shader.SetUniform(shader.Sampler2DUniforms[i], i);
+ // }
+ // }
+ // }
+ // else
+ // {
+ // GL.Disable(EnableCap.Texture2D);
+ // GL.BindTexture(TextureTarget.Texture2D, 0);
+ // }
+ //}
}
else
{
GL.BindTexture(TextureTarget.Texture2D, ((GL_Surface)Textures[0].Impl).GLTextureID);
}
- * */
- throw new NotImplementedException();
}
private BeginMode SelectBeginMode()
Added: branches/shaders/Drivers/AgateOTK/GeoHelper.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GeoHelper.cs (rev 0)
+++ branches/shaders/Drivers/AgateOTK/GeoHelper.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.Geometry;
+
+namespace AgateOTK
+{
+ static class GeoHelper
+ {
+ public static OpenTK.Math.Matrix4 ConvertAgateMatrix(Matrix4x4 matrix, bool invertY)
+ {
+ int sign = invertY ? -1 : 1;
+
+ return new OpenTK.Math.Matrix4(
+ new OpenTK.Math.Vector4(matrix[0, 0], sign * matrix[1, 0], matrix[2, 0], matrix[3, 0]),
+ new OpenTK.Math.Vector4(matrix[0, 1], sign * matrix[1, 1], matrix[2, 1], matrix[3, 1]),
+ new OpenTK.Math.Vector4(matrix[0, 2], sign * matrix[1, 2], matrix[2, 2], matrix[3, 2]),
+ new OpenTK.Math.Vector4(matrix[0, 3], sign * matrix[1, 3], matrix[2, 3], matrix[3, 3]));
+ }
+
+ }
+}
Modified: branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/FixedFunctionShaderFactory.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/FixedFunctionShaderFactory.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -14,10 +14,12 @@
switch (buildInShader)
{
case BuiltInShader.Basic2DShader:
- return new OTK_Basic2DShader_FF();
+ return new OTK_FF_Basic2DShader();
case BuiltInShader.Lighting2D:
- return new OTK_Lighting2D_FF();
-
+ return new OTK_FF_Lighting2D();
+ case BuiltInShader.Lighting3D:
+ return new OTK_FF_Lighting3D();
+
default:
return null;
}
Added: branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs (rev 0)
+++ branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Basic2DShader.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.DisplayLib.Shaders;
+using AgateLib.DisplayLib.Shaders.Implementation;
+
+namespace AgateOTK.Shaders.FixedFunction
+{
+ class OTK_FF_Basic2DShader : AgateShaderImpl
+ {
+ public override void Begin()
+ {
+ }
+
+ public override void BeginPass(int passIndex)
+ {
+ }
+
+ public override void End()
+ {
+ }
+
+ public override void EndPass()
+ {
+ }
+
+ public override int Passes
+ {
+ get { return 1; }
+ }
+
+ public override void SetTexture(EffectTexture tex, string variableName)
+ {
+ }
+
+ public override void SetVariable(string name, AgateLib.Geometry.Color color)
+ {
+ }
+
+ public override void SetVariable(string name, AgateLib.Geometry.Matrix4x4 matrix)
+ {
+ }
+
+ public override void SetVariable(string name, params int[] v)
+ {
+ }
+
+ public override void SetVariable(string name, params float[] v)
+ {
+ }
+ }
+}
Added: branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting2D.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting2D.cs (rev 0)
+++ branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting2D.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -0,0 +1,141 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OpenTK.Graphics;
+using AgateLib.DisplayLib.Shaders;
+using AgateLib.DisplayLib.Shaders.Implementation;
+using AgateLib.Geometry;
+
+namespace AgateOTK.Shaders.FixedFunction
+{
+ class OTK_FF_Lighting2D : Lighting2DImpl
+ {
+ Light[] mLights;
+ Color mAmbientLight;
+
+ public OTK_FF_Lighting2D()
+ {
+ }
+ public override Light[] Lights
+ {
+ get
+ {
+ if (mLights == null)
+ InitializeLightsArray();
+
+ return mLights;
+ }
+ }
+
+ private void InitializeLightsArray()
+ {
+ int maxLights;
+ GL.GetInteger(GetPName.MaxLights, out maxLights);
+
+ mLights = new Light[maxLights];
+ }
+
+ public override Color AmbientLight
+ {
+ get { return mAmbientLight; }
+ set { mAmbientLight = value; }
+ }
+
+ private void SetArray(float[] array, Vector3 vec)
+ {
+ array[0] = vec.X;
+ array[1] = vec.Y;
+ array[2] = vec.Z;
+ }
+ private void SetArray(float[] array, Color color)
+ {
+ array[0] = color.R / 255.0f;
+ array[1] = color.G / 255.0f;
+ array[2] = color.B / 255.0f;
+ array[3] = color.A / 255.0f;
+ }
+
+ public override void Begin()
+ {
+ GL.Enable(EnableCap.Lighting);
+
+ float[] array = new float[4];
+
+ GL.Enable(EnableCap.Lighting);
+
+ SetArray(array, AmbientLight);
+ GL.LightModelv(LightModelParameter.LightModelAmbient, array);
+
+ GL.Enable(EnableCap.ColorMaterial);
+ GL.ColorMaterial(MaterialFace.FrontAndBack,
+ ColorMaterialParameter.AmbientAndDiffuse);
+
+ for (int i = 0; i < mLights.Length; i++)
+ {
+ EnableCap lightID = (EnableCap)((int)EnableCap.Light0 + i);
+ LightName lightName = (LightName)((int)LightName.Light0 + i);
+
+ if (mLights[i] == null || mLights[i].Enabled == false)
+ {
+ GL.Disable(lightID);
+ continue;
+ }
+
+ GL.Enable(lightID);
+
+ SetArray(array, mLights[i].DiffuseColor);
+ GL.Lightv(lightName, LightParameter.Diffuse, array);
+
+ //SetArray(array, mLights[i]);
+ //GL.Lightv(lightName, LightParameter.Ambient, array);
+
+ SetArray(array, mLights[i].Position);
+ GL.Lightv(lightName, LightParameter.Position, array);
+
+ GL.Light(lightName, LightParameter.ConstantAttenuation, mLights[i].AttenuationConstant);
+ GL.Light(lightName, LightParameter.LinearAttenuation, mLights[i].AttenuationLinear);
+ GL.Light(lightName, LightParameter.QuadraticAttenuation, mLights[i].AttenuationQuadratic);
+ }
+ }
+
+ public override void BeginPass(int passIndex)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void End()
+ {
+ GL.Disable(EnableCap.Lighting);
+ }
+
+ public override void EndPass()
+ {
+ }
+
+ public override int Passes
+ {
+ get { return 1; }
+ }
+
+ public override void SetTexture(EffectTexture tex, string variableName)
+ {
+ }
+
+ public override void SetVariable(string name, AgateLib.Geometry.Color color)
+ {
+ }
+
+ public override void SetVariable(string name, AgateLib.Geometry.Matrix4x4 matrix)
+ {
+ }
+
+ public override void SetVariable(string name, params int[] v)
+ {
+ }
+
+ public override void SetVariable(string name, params float[] v)
+ {
+ }
+ }
+}
Added: branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs (rev 0)
+++ branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_FF_Lighting3D.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -0,0 +1,107 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.Geometry;
+using AgateLib.DisplayLib.Shaders;
+using AgateLib.DisplayLib.Shaders.Implementation;
+using OpenTK.Graphics;
+
+namespace AgateOTK.Shaders.FixedFunction
+{
+ class OTK_FF_Lighting3D : Lighting3DImpl
+ {
+ Color mAmbientLight;
+ Matrix4x4 mProjection;
+ Matrix4x4 mView;
+ Matrix4x4 mWorld;
+
+ public override Color AmbientLight
+ {
+ get { return mAmbientLight; }
+ set { mAmbientLight = value; }
+ }
+
+ public override Light[] Lights
+ {
+ get { throw new NotImplementedException(); }
+ }
+
+ public override Matrix4x4 Projection
+ {
+ get { return mProjection; }
+ set { mProjection = value; }
+ }
+
+ public override Matrix4x4 View
+ {
+ get { return mView; }
+ set { mView = value; }
+ }
+
+ public override Matrix4x4 World
+ {
+ get { return mWorld; }
+ set { mWorld = value; }
+ }
+
+ public override void Begin()
+ {
+ OpenTK.Math.Matrix4 modelview = GeoHelper.ConvertAgateMatrix(mView * mWorld, false);
+
+ GL.MatrixMode(MatrixMode.Modelview);
+ GL.LoadIdentity();
+ GL.LoadMatrix(ref modelview);
+
+ OpenTK.Math.Matrix4 otkProjection = GeoHelper.ConvertAgateMatrix(mProjection, false);
+
+ GL.MatrixMode(MatrixMode.Projection);
+ GL.LoadIdentity();
+ GL.LoadMatrix(ref otkProjection);
+ }
+
+ public override void BeginPass(int passIndex)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void End()
+ {
+ }
+
+ public override void EndPass()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override int Passes
+ {
+ get { return 1; }
+ }
+
+ public override void SetTexture(EffectTexture tex, string variableName)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, Color color)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, Matrix4x4 matrix)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, params int[] v)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, params float[] v)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
Modified: branches/shaders/Drivers/AgateSDX/AgateSDX.csproj
===================================================================
--- branches/shaders/Drivers/AgateSDX/AgateSDX.csproj 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/Drivers/AgateSDX/AgateSDX.csproj 2009-11-13 19:18:34 UTC (rev 1094)
@@ -105,6 +105,7 @@
<DependentUpon>frmFullScreen.cs</DependentUpon>
<SubType>Code</SubType>
</Compile>
+ <Compile Include="GeoHelper.cs" />
<Compile Include="HlslCompiler.cs">
<SubType>Code</SubType>
</Compile>
@@ -142,7 +143,8 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="Shaders\FixedFunction\FixedFunctionShaderFactory.cs" />
- <Compile Include="Shaders\FixedFunction\SDX_Basic2DShader.cs" />
+ <Compile Include="Shaders\FixedFunction\SDX_FF_Basic2DShader.cs" />
+ <Compile Include="Shaders\FixedFunction\SDX_FF_Lighting3D.cs" />
<Compile Include="Shaders\ShaderFactory.cs" />
<Compile Include="VertexFormats.cs">
<SubType>Code</SubType>
Added: branches/shaders/Drivers/AgateSDX/GeoHelper.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/GeoHelper.cs (rev 0)
+++ branches/shaders/Drivers/AgateSDX/GeoHelper.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.Geometry;
+using SlimDX;
+
+namespace AgateSDX
+{
+ static class GeoHelper
+ {
+ public static Matrix TransformAgateMatrix(Matrix4x4 value)
+ {
+ Matrix retval = new Matrix();
+
+ retval.M11 = value[0, 0];
+ retval.M21 = value[1, 0];
+ retval.M31 = value[2, 0];
+ retval.M41 = value[3, 0];
+
+ retval.M12 = value[0, 1];
+ retval.M22 = value[1, 1];
+ retval.M32 = value[2, 1];
+ retval.M42 = value[3, 1];
+
+ retval.M13 = value[0, 2];
+ retval.M23 = value[1, 2];
+ retval.M33 = value[2, 2];
+ retval.M43 = value[3, 2];
+
+ retval.M14 = value[0, 3];
+ retval.M24 = value[1, 3];
+ retval.M34 = value[2, 3];
+ retval.M44 = value[3, 3];
+
+ return retval;
+ }
+ }
+}
Modified: branches/shaders/Drivers/AgateSDX/HlslEffect.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/HlslEffect.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/Drivers/AgateSDX/HlslEffect.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -39,7 +39,7 @@
public override void SetVariable(string name, Matrix4x4 matrix)
{
- mEffect.SetValue(name, mDisplay.TransformAgateMatrix(matrix));
+ mEffect.SetValue(name, GeoHelper.TransformAgateMatrix(matrix));
}
public override void SetVariable(string name, params int[] v)
{
Modified: branches/shaders/Drivers/AgateSDX/SDX_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/SDX_Display.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/Drivers/AgateSDX/SDX_Display.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -61,6 +61,9 @@
VertexDeclaration mPosColorDecl;
Format mDepthStencilFormat;
+ System.Windows.Forms.Form mFakeWindow;
+ DisplayWindow mFakeDisplayWindow;
+
#endregion
public Format DepthStencilFormat
@@ -85,9 +88,22 @@
public override void Initialize()
{
mDirect3Dobject = new SlimDX.Direct3D9.Direct3D();
+
+ CreateFakeWindow();
+
Report("SlimDX driver instantiated for display.");
+
}
+
+ private void CreateFakeWindow()
+ {
+ mFakeWindow = new System.Windows.Forms.Form();
+ mFakeDisplayWindow = DisplayWindow.CreateFromControl(mFakeWindow);
+ mFakeWindow.Visible = false;
+ }
+
+
internal void Initialize(SDX_DisplayWindow window)
{
if (mInitialized)
@@ -176,6 +192,9 @@
public override void Dispose()
{
+ mFakeDisplayWindow.Dispose();
+ mFakeWindow.Dispose();
+
mDevice.Dispose();
}
@@ -789,29 +808,12 @@
#endregion
- HlslEffect mCurrentEffect;
-
- public override AgateLib.DisplayLib.Shaders.Effect Effect
- {
- get
- {
- return mCurrentEffect;
- }
- set
- {
- mCurrentEffect = (HlslEffect)value;
- }
- }
-
protected override void ProcessEvents()
{
System.Windows.Forms.Application.DoEvents();
}
- public override Size MaxSurfaceSize
- {
- get { return mDevice.MaxSurfaceSize; }
- }
+ #region --- Pixel Format ---
internal int GetPixelPitch(Format format)
{
@@ -852,6 +854,8 @@
get { return GetPixelFormat(DisplayMode.Format); }
}
+ #endregion
+
public override void FlushDrawBuffer()
{
mDevice.DrawBuffer.Flush();
@@ -896,6 +900,10 @@
return false;
}
+ public override Size CapsSize(DisplaySizeCaps displaySizeCaps)
+ {
+ return mDevice.MaxSurfaceSize;
+ }
public override IEnumerable<AgateLib.DisplayLib.Shaders.ShaderLanguage> SupportedShaderLanguages
{
@@ -920,32 +928,6 @@
return new SDX_IndexBuffer(this, type, size);
}
- internal Matrix TransformAgateMatrix(Matrix4x4 value)
- {
- Matrix retval = new Matrix();
-
- retval.M11 = value[0, 0];
- retval.M21 = value[1, 0];
- retval.M31 = value[2, 0];
- retval.M41 = value[3, 0];
-
- retval.M12 = value[0, 1];
- retval.M22 = value[1, 1];
- retval.M32 = value[2, 1];
- retval.M42 = value[3, 1];
-
- retval.M13 = value[0, 2];
- retval.M23 = value[1, 2];
- retval.M33 = value[2, 2];
- retval.M43 = value[3, 2];
-
- retval.M14 = value[0, 3];
- retval.M24 = value[1, 3];
- retval.M34 = value[2, 3];
- retval.M44 = value[3, 3];
-
- return retval;
- }
public override Matrix4x4 MatrixProjection
{
get
@@ -960,7 +942,7 @@
projection = value;
mDevice.Device.SetTransform(TransformState.Projection,
- TransformAgateMatrix(value));
+ GeoHelper.TransformAgateMatrix(value));
}
}
@@ -975,7 +957,7 @@
view = value;
mDevice.Device.SetTransform(TransformState.View,
- TransformAgateMatrix(value));
+ GeoHelper.TransformAgateMatrix(value));
}
}
public override Matrix4x4 MatrixWorld
@@ -989,13 +971,13 @@
world = value;
mDevice.Device.SetTransform(TransformState.World,
- TransformAgateMatrix(value));
+ GeoHelper.TransformAgateMatrix(value));
}
}
Matrix GetTotalTransform()
{
- return TransformAgateMatrix(MatrixProjection * MatrixView * MatrixWorld);
+ return GeoHelper.TransformAgateMatrix(MatrixProjection * MatrixView * MatrixWorld);
}
#endregion
Added: branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/FixedFunctionShaderFactory.cs (rev 0)
+++ branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/FixedFunctionShaderFactory.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.DisplayLib.Shaders;
+using AgateLib.DisplayLib.Shaders.Implementation;
+
+namespace AgateSDX.Shaders.FixedFunction
+{
+ class FixedFunctionShaderFactory : ShaderFactory
+ {
+ protected override AgateLib.DisplayLib.Shaders.Implementation.AgateShaderImpl CreateBuiltInShaderImpl(AgateLib.DisplayLib.Shaders.Implementation.BuiltInShader BuiltInShaderType)
+ {
+ switch (BuiltInShaderType)
+ {
+ case BuiltInShader.Basic2DShader:
+ return new SDX_FF_Basic2DShader();
+
+ case BuiltInShader.Lighting3D:
+ return new SDX_FF_Lighting3D();
+
+ default:
+ return null;
+ }
+ }
+ }
+}
Added: branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs (rev 0)
+++ branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.DisplayLib.Shaders;
+using AgateLib.DisplayLib.Shaders.Implementation;
+
+namespace AgateSDX.Shaders
+{
+ class SDX_FF_Basic2DShader : AgateShaderImpl
+ {
+ public override void Begin()
+ {
+ SDX_Display mDisplay = (SDX_Display)AgateLib.DisplayLib.Display.Impl;
+
+ mDisplay.D3D_Device.Set2DDrawState();
+ }
+
+ public override void BeginPass(int passIndex)
+ {
+ }
+
+ public override void End()
+ {
+ }
+
+ public override void EndPass()
+ {
+ }
+
+ public override int Passes
+ {
+ get { return 1; }
+ }
+
+ public override void SetTexture(EffectTexture tex, string variableName)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, AgateLib.Geometry.Color color)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, AgateLib.Geometry.Matrix4x4 matrix)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, params int[] v)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, params float[] v)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
Added: branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs (rev 0)
+++ branches/shaders/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Lighting3D.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -0,0 +1,113 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.DisplayLib.Shaders;
+using AgateLib.DisplayLib.Shaders.Implementation;
+using AgateLib.Geometry;
+using SlimDX.Direct3D9;
+
+namespace AgateSDX.Shaders.FixedFunction
+{
+ class SDX_FF_Lighting3D : Lighting3DImpl
+ {
+ Color mAmbientLight;
+ AgateLib.DisplayLib.Shaders.Light[] mLights;
+ Matrix4x4 mProjection;
+ Matrix4x4 mView;
+ Matrix4x4 mWorld;
+
+ SDX_Display mDisplay;
+
+ public SDX_FF_Lighting3D()
+ {
+ mDisplay = (SDX_Display)AgateLib.DisplayLib.Display.Impl;
+ mLights = new AgateLib.DisplayLib.Shaders.Light[mDisplay.D3D_Device.Device.Capabilities.MaxActiveLights];
+ }
+ public override Color AmbientLight
+ {
+ get
+ {
+ return mAmbientLight;
+ }
+ set
+ {
+ mAmbientLight = value;
+ }
+ }
+
+ public override AgateLib.DisplayLib.Shaders.Light[] Lights
+ {
+ get { return mLights; }
+ }
+
+ public override Matrix4x4 Projection
+ {
+ get { return mProjection; }
+ set { mProjection = value; }
+ }
+ public override Matrix4x4 View
+ {
+ get { return mView; }
+ set { mView = value; }
+ }
+ public override Matrix4x4 World
+ {
+ get { return mWorld; }
+ set { mWorld = value; }
+ }
+ public override void Begin()
+ {
+ mDisplay.D3D_Device.Device.SetTransform(
+ TransformState.Projection, GeoHelper.TransformAgateMatrix(mProjection.Transpose()));
+ mDisplay.D3D_Device.Device.SetTransform(
+ TransformState.View, GeoHelper.TransformAgateMatrix(mView.Transpose()));
+ mDisplay.D3D_Device.Device.SetTransform(
+ TransformState.World, GeoHelper.TransformAgateMatrix(mWorld.Transpose()));
+ }
+
+ public override void BeginPass(int passIndex)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void End()
+ {
+ }
+
+ public override void EndPass()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override int Passes
+ {
+ get { return 1; }
+ }
+
+ public override void SetTexture(AgateLib.DisplayLib.Shaders.EffectTexture tex, string variableName)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, Color color)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, Matrix4x4 matrix)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, params int[] v)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void SetVariable(string name, params float[] v)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
Modified: branches/shaders/TODO.txt
===================================================================
--- branches/shaders/TODO.txt 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/TODO.txt 2009-11-13 19:18:34 UTC (rev 1094)
@@ -1,7 +1,16 @@
AgateLib Todo
=============
-Goals for 0.3.1
+General:
+ Remove all OpenGL immediate mode code from AgateOTK.
+ Check GetPixelFormat method in AgateSDX
+ Test / Debug writing pixel buffer to SDX surface.
+ Deal with TODO's in font tests.
+ Implement better Platform.HasWriteAccessToAppDirectory method.
+ Test ClipRects with AgateOTK
+ Test if GL_GameWindow is viable.
+
+Goals for 0.3.2
--------------------------------
General
D Remove all deprecated stuff from AgateLib.
Modified: branches/shaders/Tests/Shaders/Hlsl.cs
===================================================================
--- branches/shaders/Tests/Shaders/Hlsl.cs 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/Tests/Shaders/Hlsl.cs 2009-11-13 19:18:34 UTC (rev 1094)
@@ -140,7 +140,7 @@
Display.Clear(Color.Gray);
Matrix4x4 proj = Matrix4x4.Projection(45f, wind.Width / (float)wind.Height, 1.0f, 1000f); // projection
- Matrix4x4 view = Matrix4x4.LookAt(eye, eye + lookDir, up);
+ Matrix4x4 view = Matrix4x4.ViewLookAt(eye, eye + lookDir, up);
// world transformation
Matrix4x4 world = Matrix4x4.Translation(-size / 2, -size / 2, 0) * Matrix4x4.RotateZ((float)(frequency * time));
Modified: branches/shaders/Tests/Tests.csproj
===================================================================
--- branches/shaders/Tests/Tests.csproj 2009-11-12 18:09:22 UTC (rev 1093)
+++ branches/shaders/Tests/Tests.csproj 2009-11-13 19:18:34 UTC (rev 1094)
@@ -305,6 +305,7 @@
<Compile Include="Shaders\Hlsl.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="Shaders\Lighting3DTest.cs" />
<Compile Include="Shaders\LightingTest\LightingTest.cs">
<SubType>Code</SubType>
</Compile>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-12 18:09:30
|
Revision: 1093
http://agate.svn.sourceforge.net/agate/?rev=1093&view=rev
Author: kanato
Date: 2009-11-12 18:09:22 +0000 (Thu, 12 Nov 2009)
Log Message:
-----------
Add calls to Trace.WriteLine and redirection to output file.
Improve robustness of Registrar.
Modified Paths:
--------------
branches/shaders/AgateLib/Core.cs
branches/shaders/AgateLib/Drivers/AgateSandBoxLoader.cs
branches/shaders/AgateLib/Platform.cs
branches/shaders/Drivers/AgateSDX/AgateSDX.csproj
Modified: branches/shaders/AgateLib/Core.cs
===================================================================
--- branches/shaders/AgateLib/Core.cs 2009-11-09 01:39:35 UTC (rev 1092)
+++ branches/shaders/AgateLib/Core.cs 2009-11-12 18:09:22 UTC (rev 1093)
@@ -213,7 +213,7 @@
filewriter.Write(text);
}
- Console.Write(text);
+ Trace.WriteLine(text);
}
/// <summary>
@@ -262,9 +262,8 @@
"Error message: " + e.Message + "\r\n" +
"Errors cannot be saved to a text file.";
- Console.WriteLine(message);
- System.Diagnostics.Debug.WriteLine(message);
- System.Diagnostics.Trace.WriteLine(message);
+ Debug.WriteLine(message);
+ Trace.WriteLine(message);
return null;
}
Modified: branches/shaders/AgateLib/Drivers/AgateSandBoxLoader.cs
===================================================================
--- branches/shaders/AgateLib/Drivers/AgateSandBoxLoader.cs 2009-11-09 01:39:35 UTC (rev 1092)
+++ branches/shaders/AgateLib/Drivers/AgateSandBoxLoader.cs 2009-11-12 18:09:22 UTC (rev 1093)
@@ -18,6 +18,7 @@
//
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Text;
using System.Reflection;
@@ -47,6 +48,25 @@
{
types = ass.GetTypes();
}
+ catch (ReflectionTypeLoadException e)
+ {
+ string message = string.Format(
+ "Caught ReflectionTypeLoadException in {0}.", file);
+
+ foreach (var ex in e.LoaderExceptions)
+ {
+ message += Environment.NewLine;
+ message += ex.Message;
+ }
+
+ message += Environment.NewLine +
+ "This is probably a sign that the build of the file " + file +
+ " does not match the build of AgateLib.dll.";
+
+ Trace.WriteLine(message);
+
+ return retval.ToArray();
+ }
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(string.Format(
@@ -65,13 +85,23 @@
AgateDriverReporter reporter = (AgateDriverReporter)Activator.CreateInstance(t);
- foreach (AgateDriverInfo info in reporter.ReportDrivers())
+ try
{
- info.AssemblyFile = file;
- info.AssemblyName = ass.FullName;
+ foreach (AgateDriverInfo info in reporter.ReportDrivers())
+ {
+ info.AssemblyFile = file;
+ info.AssemblyName = ass.FullName;
- retval.Add(info);
+ retval.Add(info);
+ }
}
+ catch (Exception e)
+ {
+ Trace.WriteLine(string.Format(
+ "The driver reporter in {0} encountered an error." + Environment.NewLine +
+ "Caught exception {1}." + Environment.NewLine +
+ "{2}", file, e.GetType().Name, e.Message));
+ }
}
return retval.ToArray();
Modified: branches/shaders/AgateLib/Platform.cs
===================================================================
--- branches/shaders/AgateLib/Platform.cs 2009-11-09 01:39:35 UTC (rev 1092)
+++ branches/shaders/AgateLib/Platform.cs 2009-11-12 18:09:22 UTC (rev 1093)
@@ -42,7 +42,10 @@
mRuntime = DetectRuntime();
if (PlatformType != PlatformType.Windows)
+ {
Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
+ Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
+ }
CheckOSVersion();
@@ -51,14 +54,22 @@
SetFolders();
- string debugLog = "debuglog.txt";
+ string debugLog = "agate-debuglog.txt";
+ string traceLog = "debuglog.txt";
if (HasWriteAccessToAppDirectory())
+ {
debugLog = Path.Combine(mAppDir, debugLog);
+ traceLog = Path.Combine(mAppDir, traceLog);
+ }
else
+ {
debugLog = Path.Combine(mAppData, debugLog);
+ traceLog = Path.Combine(mAppData, traceLog);
+ }
Debug.Listeners.Add(new TextWriterTraceListener(new StreamWriter(debugLog)));
+ Trace.Listeners.Add(new TextWriterTraceListener(new StreamWriter(traceLog)));
}
// TODO: Maybe there is a better way to inspect permissions?
@@ -86,7 +97,14 @@
static T GetCustomAttribute<T>(Assembly ass) where T : Attribute
{
- return ass.GetCustomAttributes(typeof(T), false)[0] as T;
+ try
+ {
+ return ass.GetCustomAttributes(typeof(T), false)[0] as T;
+ }
+ catch
+ {
+ return null;
+ }
}
private void SetFolders()
{
@@ -99,14 +117,24 @@
mAppDir = Path.GetDirectoryName(fqn);
Console.WriteLine("App Dir: {0}", mAppDir);
- SetFolderPaths(companyAttribute.Company, nameAttribute.Product);
+ string companyName = companyAttribute != null ? companyAttribute.Company : string.Empty;
+ string product = nameAttribute != null ? nameAttribute.Product : string.Empty;
+
+ SetFolderPaths(companyName, product);
}
public void SetFolderPaths(string companyName, string appName)
{
string combDir = Path.Combine(companyName, appName);
- mAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
+ if (string.IsNullOrEmpty(combDir))
+ {
+ mAppData = mAppDir;
+ Trace.WriteLine("Warning: No assembly level company / product name attributes were found.");
+ }
+ else
+ mAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
+
mDocuments = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
mAppData = Path.Combine(mAppData, combDir);
Modified: branches/shaders/Drivers/AgateSDX/AgateSDX.csproj
===================================================================
--- branches/shaders/Drivers/AgateSDX/AgateSDX.csproj 2009-11-09 01:39:35 UTC (rev 1092)
+++ branches/shaders/Drivers/AgateSDX/AgateSDX.csproj 2009-11-12 18:09:22 UTC (rev 1093)
@@ -3,7 +3,7 @@
<ProjectType>Local</ProjectType>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{6C4E3198-7D6D-41E5-BFA2-AC28ADDAE2B6}</ProjectGuid>
+ <ProjectGuid>{EF993B30-D9A9-4962-80BB-6826D39B3465}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-09 01:39:52
|
Revision: 1092
http://agate.svn.sourceforge.net/agate/?rev=1092&view=rev
Author: kanato
Date: 2009-11-09 01:39:35 +0000 (Mon, 09 Nov 2009)
Log Message:
-----------
Include missing fixed function shaders.
Initial implementation of Lighting2D shader for OpenGL fixed function pipeline.
Modified Paths:
--------------
branches/shaders/AgateLib/AgateLib.csproj
branches/shaders/AgateLib/DisplayLib/Display.cs
branches/shaders/AgateLib/DisplayLib/Shaders/AgateShader.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs
branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs
branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
branches/shaders/Drivers/AgateOTK/GL_Display.cs
branches/shaders/Drivers/AgateSDX/AgateSDX.csproj
branches/shaders/Drivers/AgateSDX/D3DDevice.cs
branches/shaders/Drivers/AgateSDX/SDX_Display.cs
branches/shaders/Tests/Shaders/LightingTest/LightingTest.cs
Added Paths:
-----------
branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs
branches/shaders/AgateLib/DisplayLib/Shaders/Lighting2D.cs
branches/shaders/Drivers/AgateOTK/Shaders/
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_Basic2DShader_FF.cs
branches/shaders/Drivers/AgateOTK/Shaders/ShaderFactory.cs
branches/shaders/Drivers/AgateSDX/Shaders/
branches/shaders/Drivers/AgateSDX/Shaders/ShaderFactory.cs
Removed Paths:
-------------
branches/shaders/AgateLib/DisplayLib/Light.cs
branches/shaders/AgateLib/DisplayLib/LightManager.cs
Modified: branches/shaders/AgateLib/AgateLib.csproj
===================================================================
--- branches/shaders/AgateLib/AgateLib.csproj 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/AgateLib/AgateLib.csproj 2009-11-09 01:39:35 UTC (rev 1092)
@@ -97,11 +97,14 @@
<Compile Include="Core.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="DisplayLib\Shaders\AgateBuiltInShaders.cs" />
<Compile Include="DisplayLib\Shaders\Basic2DShader.cs" />
<Compile Include="DisplayLib\Shaders\AgateShader.cs" />
<Compile Include="DisplayLib\Shaders\Implementation\AgateInternalShader.cs" />
<Compile Include="DisplayLib\Shaders\Implementation\AgateShaderImpl.cs" />
<Compile Include="DisplayLib\Shaders\Implementation\BuiltInShader.cs" />
+ <Compile Include="DisplayLib\Shaders\Implementation\Lighting2DImpl.cs" />
+ <Compile Include="DisplayLib\Shaders\Lighting2D.cs" />
<Compile Include="IFileProvider.cs">
<SubType>Code</SubType>
</Compile>
@@ -161,12 +164,6 @@
<Compile Include="DisplayLib\ISurface.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="DisplayLib\Light.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="DisplayLib\LightManager.cs">
- <SubType>Code</SubType>
- </Compile>
<Compile Include="DisplayLib\Origin.cs">
<SubType>Code</SubType>
</Compile>
Modified: branches/shaders/AgateLib/DisplayLib/Display.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Display.cs 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/AgateLib/DisplayLib/Display.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -673,21 +673,6 @@
get { return impl.Caps; }
}
- /// <summary>
- /// Turns lighting functions off.
- /// </summary>
- [Obsolete("Use shaders instead.")]
- public static void DisableLighting()
- {
- DoLighting(LightManager.Empty);
- }
-
- [Obsolete("Use shaders instead.")]
- internal static void DoLighting(LightManager lights)
- {
- impl.DoLighting(lights);
- }
-
internal static void SavePixelBuffer(PixelBuffer pixelBuffer, string filename, ImageFileFormat format)
{
impl.SavePixelBuffer(pixelBuffer, filename, format);
Deleted: branches/shaders/AgateLib/DisplayLib/Light.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Light.cs 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/AgateLib/DisplayLib/Light.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -1,160 +0,0 @@
-// The contents of this file are subject to the Mozilla Public License
-// Version 1.1 (the "License"); you may not use this file except in
-// compliance with the License. You may obtain a copy of the License at
-// http://www.mozilla.org/MPL/
-//
-// Software distributed under the License is distributed on an "AS IS"
-// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-// License for the specific language governing rights and limitations
-// under the License.
-//
-// The Original Code is AgateLib.
-//
-// The Initial Developer of the Original Code is Erik Ylvisaker.
-// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009.
-// All Rights Reserved.
-//
-// Contributor(s): Erik Ylvisaker
-//
-using System;
-using System.Collections.Generic;
-using System.Text;
-using AgateLib.Geometry;
-
-namespace AgateLib.DisplayLib
-{
- /// <summary>
- /// Class which represents a single light source.
- /// Only point light sources are supported at the moment.
- /// </summary>
- [Obsolete("Use shaders to accomplish lighting instead.")]
- public class Light
- {
- private bool mEnabled = true;
- private Color mAmbient = Color.Black;
- private Color mDiffuse = Color.White;
- private Color mSpecular = Color.Black;
- private Vector3 mPosition = Vector3.Empty;
- private float mConstantAttenuation = 0.01f;
- private float mLinearAttenuation = 0.0f;
- private float mQuadraticAttenuation = 0.00001f;
- private float mRange = 100000;
-
- /// <summary>
- /// The constant value in the Lighting formula
- /// <seealso cref="SetAttenuationModel"/>
- /// </summary>
- public float AttenuationConstant
- {
- get { return mConstantAttenuation; }
- set { mConstantAttenuation = value; }
- }
- /// <summary>
- /// The linear value in the Lighting formula
- /// <seealso cref="SetAttenuationModel"/>
- /// </summary>
- public float AttenuationLinear
- {
- get { return mLinearAttenuation; }
- set { mLinearAttenuation = value; }
- }
- /// <summary>
- /// The quadratic value in the Lighting formula
- /// <seealso cref="SetAttenuationModel"/>
- /// </summary>
- public float AttenuationQuadratic
- {
- get { return mQuadraticAttenuation; }
- set { mQuadraticAttenuation = value; }
- }
- /// <summary>
- /// Sets the three constants in the attenuation model. See remarks for details.
- /// </summary>
- /// <remarks>
- /// Lights decrease in intensity for objects which are farther away from the lights.
- /// This is called attenuation.
- /// Point Lights are attenuated according to the following formula:
- /// <para>
- /// K = C<sub>0</sub> + C<sub>1</sub>*d + C<sub>2</sub>*d<sup>2</sup>
- /// </para>
- /// <para>
- /// A = 1 / K
- /// </para>
- /// where d is the distance from the light the object being rendered is. The Light's
- /// color components are multiplied by A to decrease the intensity of the light on this
- /// object.
- /// </remarks>
- /// <param name="constant"></param>
- /// <param name="linear"></param>
- /// <param name="quadratic"></param>
- public void SetAttenuationModel(float constant, float linear, float quadratic)
- {
- AttenuationConstant = constant;
- AttenuationLinear = linear;
- AttenuationQuadratic = quadratic;
- }
- /// <summary>
- /// Gets or sets the distance at which the rendering API can consider the light
- /// too far away to have any affect.
- /// </summary>
- public float Range
- {
- get { return mRange; }
- set { mRange = value; }
- }
- /// <summary>
- /// Gets or sets whether or not this Light should have any effect on anything which is rendered.
- /// </summary>
- public bool Enabled
- {
- get
- {
- return mEnabled;
- }
- set
- {
- mEnabled = value;
- }
- }
- /// <summary>
- /// Ambient color for the light. Ambient color is not affected by the dot product with the
- /// normal, so it appears to attenuate slower.
- /// <seealso cref="Diffuse"/>
- /// </summary>
- public Color Ambient
- {
- get { return mAmbient; }
- set { mAmbient = value; }
- }
- /// <summary>
- /// Diffuse color for the light. The diffuse color is modulated by the dot product of the
- /// direction to the light with the surface normal (for 2D drawing in AgateLib, surface normals
- /// are always in the negative z direction). So it attenuates faster than the Ambient color does.
- /// </summary>
- public Color Diffuse
- {
- get { return mDiffuse; }
- set { mDiffuse = value; }
- }
- /// <summary>
- /// Specular highlight color, or "shininess." Not currently used.
- /// </summary>
- public Color Specular
- {
- get { return mSpecular; }
- set { mSpecular = value; }
- }
- /// <summary>
- /// The position of the Light source, in 3D space. Normals in AgateLib are in the negative
- /// z direction, so it is recommended to make Position.Z a negative number. How negative
- /// depends on the Attenuation model and what kind of effect you wish to create with the
- /// lighting.
- /// </summary>
- public Vector3 Position
- {
- get { return mPosition; }
- set { mPosition = value; }
- }
-
- }
-}
\ No newline at end of file
Deleted: branches/shaders/AgateLib/DisplayLib/LightManager.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/LightManager.cs 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/AgateLib/DisplayLib/LightManager.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -1,208 +0,0 @@
-// The contents of this file are subject to the Mozilla Public License
-// Version 1.1 (the "License"); you may not use this file except in
-// compliance with the License. You may obtain a copy of the License at
-// http://www.mozilla.org/MPL/
-//
-// Software distributed under the License is distributed on an "AS IS"
-// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-// License for the specific language governing rights and limitations
-// under the License.
-//
-// The Original Code is AgateLib.
-//
-// The Initial Developer of the Original Code is Erik Ylvisaker.
-// Portions created by Erik Ylvisaker are Copyright (C) 2006-2009.
-// All Rights Reserved.
-//
-// Contributor(s): Erik Ylvisaker
-//
-using System;
-using System.Collections.Generic;
-using System.Text;
-using AgateLib.Geometry;
-
-namespace AgateLib.DisplayLib
-{
- /// <summary>
- /// The LightManager class keeps a list of Light objects which can be used
- /// to setup the lighting in the rendering API.
- /// </summary>
- [Obsolete("Use shaders to accomplish lighting instead.")]
- public class LightManager : IList<Light>
- {
- List<Light> mLights = new List<Light>();
- bool mEnabled = true;
- Color mAmbient = Color.Black;
-
- internal static readonly LightManager Empty;
-
- static LightManager()
- {
- Empty = new LightManager();
- Empty.Enabled = false;
- }
-
- /// <summary>
- /// Adds a point light to the specified position with the given diffuse color.
- /// </summary>
- /// <param name="position"></param>
- /// <param name="diffuse"></param>
- /// <returns></returns>
- public int AddPointLight(Vector3 position, Color diffuse)
- {
- return AddPointLight(position, diffuse, Color.Black);
- }
- /// <summary>
- /// Adds a point light to the specified position with the given diffuse and ambient colors.
- /// </summary>
- /// <param name="position"></param>
- /// <param name="diffuse"></param>
- /// <param name="ambient"></param>
- /// <returns></returns>
- public int AddPointLight(Vector3 position, Color diffuse, Color ambient)
- {
- mLights.Add(new Light());
-
- int retval = mLights.Count - 1;
-
- mLights[retval].Position = position;
- mLights[retval].Diffuse = diffuse;
- mLights[retval].Ambient = ambient;
-
- return retval;
- }
- /// <summary>
- /// This tells the Display to start use the Lights in this LightManager structure for
- /// lighting.
- /// </summary>
- public void DoLighting()
- {
- Display.DoLighting(this);
- }
- /// <summary>
- /// Gets or sets a flag indicating whether or not lighting calculations should be performed.
- /// </summary>
- public bool Enabled
- {
- get { return mEnabled; }
- set { mEnabled = value; }
- }
- /// <summary>
- /// Gets or sets the global ambient light color. This light color is applied to
- /// all objects rendered, regardless of their position.
- /// </summary>
- public Color Ambient
- {
- get { return mAmbient; }
- set { mAmbient = value; }
- }
-
- #region --- IList<Light> Members ---
-
- /// <summary>
- /// Gets or sets a Light in the list.
- /// </summary>
- /// <param name="index"></param>
- /// <returns></returns>
- public Light this[int index]
- {
- get
- {
- return mLights[index];
- }
- set
- {
- mLights[index] = value;
- }
- }
- /// <summary>
- /// Removes a particular light.
- /// </summary>
- /// <param name="index"></param>
- public void RemoveAt(int index)
- {
- mLights.RemoveAt(index);
- }
-
- int IList<Light>.IndexOf(Light item)
- {
- return mLights.IndexOf(item);
- }
- void IList<Light>.Insert(int index, Light item)
- {
- mLights.Insert(index, item);
- }
-
- #endregion
- #region --- ICollection<Light> Members ---
-
- /// <summary>
- /// Adds a Light to the list. If there are more lights than possible, an exception is thrown.
- /// </summary>
- /// <param name="item"></param>
- public void Add(Light item)
- {
- if (mLights.Count >= Display.Caps.MaxLights)
- {
- throw new InvalidOperationException("Too many lights!");
- }
-
- mLights.Add(item);
- }
- /// <summary>
- /// Removes all Lights from the list.
- /// </summary>
- public void Clear()
- {
- mLights.Clear();
- }
- /// <summary>
- /// Gets the number of Lights in the list.
- /// </summary>
- public int Count
- {
- get { return mLights.Count; }
- }
-
- bool ICollection<Light>.Contains(Light item)
- {
- return mLights.Contains(item);
- }
- void ICollection<Light>.CopyTo(Light[] array, int arrayIndex)
- {
- mLights.CopyTo(array, arrayIndex);
- }
-
-
- bool ICollection<Light>.IsReadOnly
- {
- get { return false; }
- }
- bool ICollection<Light>.Remove(Light item)
- {
- return mLights.Remove(item);
- }
-
- #endregion
- #region --- IEnumerable<Light> Members ---
-
- /// <summary>
- /// Enumerates the Lights in the list.
- /// </summary>
- /// <returns></returns>
- public IEnumerator<Light> GetEnumerator()
- {
- return mLights.GetEnumerator();
- }
-
- #endregion
- #region --- IEnumerable Members ---
-
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- #endregion
- }
-}
Added: branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs (rev 0)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/AgateBuiltInShaders.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AgateLib.DisplayLib.Shaders
+{
+ public static class AgateBuiltInShaders
+ {
+ internal static void InitializeShaders()
+ {
+ if (Basic2DShader != null)
+ throw new InvalidOperationException();
+
+ Basic2DShader = new Basic2DShader();
+ Lighting2D = new Lighting2D();
+
+
+ Basic2DShader.Activate();
+ }
+ internal static void DisposeShaders()
+ {
+ Basic2DShader = null;
+ Lighting2D = null;
+ }
+
+ public static Basic2DShader Basic2DShader { get; private set; }
+ public static Lighting2D Lighting2D { get; private set; }
+
+ }
+}
Modified: branches/shaders/AgateLib/DisplayLib/Shaders/AgateShader.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/AgateShader.cs 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/AgateShader.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -37,6 +37,11 @@
this.impl = impl;
}
+ protected AgateShaderImpl Impl
+ {
+ get { return impl; }
+ }
+
public int Passes
{
get { return impl.Passes; }
@@ -109,24 +114,4 @@
}
- public static class AgateBuiltInShaders
- {
- internal static void InitializeShaders()
- {
- if (Basic2DShader != null)
- throw new InvalidOperationException();
-
- Basic2DShader = new Basic2DShader();
-
-
- Basic2DShader.Activate();
- }
- internal static void DisposeShaders()
- {
- Basic2DShader = null;
- }
-
- public static Basic2DShader Basic2DShader { get; private set; }
-
- }
}
Modified: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/BuiltInShader.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -26,5 +26,6 @@
public enum BuiltInShader
{
Basic2DShader,
+ Lighting2D,
}
}
Added: branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs (rev 0)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/Implementation/Lighting2DImpl.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.Geometry;
+
+namespace AgateLib.DisplayLib.Shaders.Implementation
+{
+ public abstract class Lighting2DImpl : AgateShaderImpl
+ {
+ public abstract Light[] Lights { get; }
+ public abstract Color AmbientLight { get; set; }
+
+ }
+}
Added: branches/shaders/AgateLib/DisplayLib/Shaders/Lighting2D.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Shaders/Lighting2D.cs (rev 0)
+++ branches/shaders/AgateLib/DisplayLib/Shaders/Lighting2D.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.DisplayLib.Shaders.Implementation;
+using AgateLib.Geometry;
+
+namespace AgateLib.DisplayLib.Shaders
+{
+ public class Lighting2D : AgateInternalShader
+ {
+ protected override BuiltInShader BuiltInShaderType
+ {
+ get { return BuiltInShader.Lighting2D; }
+ }
+
+ protected new Lighting2DImpl Impl
+ {
+ get { return (Lighting2DImpl)base.Impl; }
+ }
+
+ public Light[] Lights
+ {
+ get { return Impl.Lights; }
+ }
+ public Color AmbientLight
+ {
+ get { return Impl.AmbientLight; }
+ }
+
+
+ public void AddLight(Light ptLight)
+ {
+ for (int i = 0; i < Lights.Length; i++)
+ {
+ if (Lights[i] == null)
+ {
+ Lights[i] = ptLight;
+ return;
+ }
+ }
+
+ for (int i = 0; i < Lights.Length; i++)
+ {
+ if (Lights[i].Enabled == false)
+ {
+ Lights[i] = ptLight;
+ return;
+ }
+ }
+ }
+ }
+
+ public class Light
+ {
+ public Light()
+ {
+ Enabled = true;
+ }
+
+ public bool Enabled { get; set; }
+ public Vector3 Position { get; set; }
+ public Color DiffuseColor { get; set; }
+ public Color SpecularColor { get; set; }
+ public Color AmbientColor { get; set; }
+
+ public float AttenuationConstant { get; set; }
+ public float AttenuationLinear { get; set; }
+ public float AttenuationQuadratic { get; set; }
+ }
+
+}
Modified: branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs
===================================================================
--- branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -559,16 +559,6 @@
}
/// <summary>
- /// Gets all the light settings from the LightManager.
- /// </summary>
- /// <param name="lights"></param>
- [Obsolete()]
- public virtual void DoLighting(LightManager lights)
- {
- throw new NotImplementedException("DoLighting is not implemented, and also deprecated.");
- }
-
- /// <summary>
/// Processes pending events.
/// </summary>
protected internal abstract void ProcessEvents();
@@ -640,6 +630,7 @@
throw new NotSupportedException("The current driver does not support shaders.");
}
+ [Obsolete]
public virtual Effect Effect
{
get { throw new NotSupportedException("The current driver does not support shaders."); }
Modified: branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
===================================================================
--- branches/shaders/Drivers/AgateOTK/AgateOTK.csproj 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/Drivers/AgateOTK/AgateOTK.csproj 2009-11-09 01:39:35 UTC (rev 1092)
@@ -175,6 +175,7 @@
</Compile>
<Compile Include="Shaders\FixedFunction\FixedFunctionShaderFactory.cs" />
<Compile Include="Shaders\FixedFunction\OTK_Basic2DShader_FF.cs" />
+ <Compile Include="Shaders\FixedFunction\OTK_Lighting2D_FF.cs" />
<Compile Include="Shaders\ShaderFactory.cs" />
<Compile Include="TextureCoordinates.cs">
<SubType>Code</SubType>
Modified: branches/shaders/Drivers/AgateOTK/GL_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -507,65 +507,7 @@
{
}
- public override void DoLighting(LightManager lights)
- {
- FlushDrawBuffer();
- if (lights.Enabled == false)
- {
- GL.Disable(EnableCap.Lighting);
- return;
- }
-
- float[] array = new float[4];
-
- GL.Enable(EnableCap.Lighting);
-
- SetArray(array, lights.Ambient);
- GL.LightModelv(LightModelParameter.LightModelAmbient, array);
-
- GL.Enable(EnableCap.ColorMaterial);
- GL.ColorMaterial(MaterialFace.FrontAndBack,
- ColorMaterialParameter.AmbientAndDiffuse);
-
- for (int i = 0; i < lights.Count || i < mMaxLightsUsed; i++)
- {
- EnableCap lightID = (EnableCap)((int)EnableCap.Light0 + i);
- LightName lightName = (LightName)((int)LightName.Light0 + i);
-
- if (i >= lights.Count)
- {
- GL.Disable(lightID);
- continue;
- }
-
- if (lights[i].Enabled == false)
- {
- GL.Disable(lightID);
- continue;
- }
-
- GL.Enable(lightID);
-
- SetArray(array, lights[i].Diffuse);
- GL.Lightv(lightName, LightParameter.Diffuse, array);
-
- SetArray(array, lights[i].Ambient);
- GL.Lightv(lightName, LightParameter.Ambient, array);
-
- SetArray(array, lights[i].Position);
- GL.Lightv(lightName, LightParameter.Position, array);
-
- GL.Light(lightName, LightParameter.ConstantAttenuation, lights[i].AttenuationConstant);
- GL.Light(lightName, LightParameter.LinearAttenuation, lights[i].AttenuationLinear);
- GL.Light(lightName, LightParameter.QuadraticAttenuation, lights[i].AttenuationQuadratic);
-
- }
-
- mMaxLightsUsed = lights.Count;
-
- }
-
private void SetArray(float[] array, Vector3 vec)
{
array[0] = vec.X;
Added: branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/FixedFunctionShaderFactory.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/FixedFunctionShaderFactory.cs (rev 0)
+++ branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/FixedFunctionShaderFactory.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.DisplayLib.Shaders;
+using AgateLib.DisplayLib.Shaders.Implementation;
+
+namespace AgateOTK.Shaders.FixedFunction
+{
+ class FixedFunctionShaderFactory : ShaderFactory
+ {
+ protected override AgateShaderImpl CreateBuiltInShaderImpl(BuiltInShader buildInShader)
+ {
+ switch (buildInShader)
+ {
+ case BuiltInShader.Basic2DShader:
+ return new OTK_Basic2DShader_FF();
+ case BuiltInShader.Lighting2D:
+ return new OTK_Lighting2D_FF();
+
+ default:
+ return null;
+ }
+ }
+ }
+}
Added: branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_Basic2DShader_FF.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_Basic2DShader_FF.cs (rev 0)
+++ branches/shaders/Drivers/AgateOTK/Shaders/FixedFunction/OTK_Basic2DShader_FF.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.DisplayLib.Shaders;
+using AgateLib.DisplayLib.Shaders.Implementation;
+
+namespace AgateOTK.Shaders.FixedFunction
+{
+ class OTK_Basic2DShader_FF : AgateShaderImpl
+ {
+ public override void Begin()
+ {
+ }
+
+ public override void BeginPass(int passIndex)
+ {
+ }
+
+ public override void End()
+ {
+ }
+
+ public override void EndPass()
+ {
+ }
+
+ public override int Passes
+ {
+ get { return 1; }
+ }
+
+ public override void SetTexture(EffectTexture tex, string variableName)
+ {
+ }
+
+ public override void SetVariable(string name, AgateLib.Geometry.Color color)
+ {
+ }
+
+ public override void SetVariable(string name, AgateLib.Geometry.Matrix4x4 matrix)
+ {
+ }
+
+ public override void SetVariable(string name, params int[] v)
+ {
+ }
+
+ public override void SetVariable(string name, params float[] v)
+ {
+ }
+ }
+}
Added: branches/shaders/Drivers/AgateOTK/Shaders/ShaderFactory.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/Shaders/ShaderFactory.cs (rev 0)
+++ branches/shaders/Drivers/AgateOTK/Shaders/ShaderFactory.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.DisplayLib.Shaders;
+using AgateLib.DisplayLib.Shaders.Implementation;
+
+namespace AgateOTK.Shaders
+{
+ abstract class ShaderFactory
+ {
+ static ShaderFactory inst = new FixedFunction.FixedFunctionShaderFactory();
+
+ public static AgateShaderImpl CreateBuiltInShader(BuiltInShader buildInShader)
+ {
+ return inst.CreateBuiltInShaderImpl(buildInShader);
+ }
+
+ protected abstract AgateShaderImpl CreateBuiltInShaderImpl(BuiltInShader buildInShader);
+ }
+}
Modified: branches/shaders/Drivers/AgateSDX/AgateSDX.csproj
===================================================================
--- branches/shaders/Drivers/AgateSDX/AgateSDX.csproj 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/Drivers/AgateSDX/AgateSDX.csproj 2009-11-09 01:39:35 UTC (rev 1092)
@@ -141,7 +141,8 @@
<Compile Include="SDX_VertexBuffer.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="Shaders\SDX_Basic2DShader.cs" />
+ <Compile Include="Shaders\FixedFunction\FixedFunctionShaderFactory.cs" />
+ <Compile Include="Shaders\FixedFunction\SDX_Basic2DShader.cs" />
<Compile Include="Shaders\ShaderFactory.cs" />
<Compile Include="VertexFormats.cs">
<SubType>Code</SubType>
Modified: branches/shaders/Drivers/AgateSDX/D3DDevice.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/D3DDevice.cs 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/Drivers/AgateSDX/D3DDevice.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -311,7 +311,7 @@
//}
-
+ /*
internal void DoLighting(LightManager lights)
{
if (lights.Enabled == false)
@@ -371,5 +371,6 @@
mMaxLightsUsed = lights.Count;
}
+ * */
}
}
\ No newline at end of file
Modified: branches/shaders/Drivers/AgateSDX/SDX_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/SDX_Display.cs 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/Drivers/AgateSDX/SDX_Display.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -860,12 +860,6 @@
{
mDevice.SetOrthoProjection(region);
}
- [Obsolete]
- public override void DoLighting(LightManager lights)
- {
- FlushDrawBuffer();
- mDevice.DoLighting(lights);
- }
protected override void SavePixelBuffer(PixelBuffer pixelBuffer, string filename, ImageFileFormat format)
{
Added: branches/shaders/Drivers/AgateSDX/Shaders/ShaderFactory.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/Shaders/ShaderFactory.cs (rev 0)
+++ branches/shaders/Drivers/AgateSDX/Shaders/ShaderFactory.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AgateLib.DisplayLib.Shaders;
+using AgateLib.DisplayLib.Shaders.Implementation;
+
+namespace AgateSDX.Shaders
+{
+ abstract class ShaderFactory
+ {
+ static ShaderFactory inst = new FixedFunction.FixedFunctionShaderFactory();
+
+ public static AgateShaderImpl CreateBuiltInShader(BuiltInShader BuiltInShaderType)
+ {
+ return inst.CreateBuiltInShaderImpl(BuiltInShaderType);
+ }
+
+ protected abstract AgateShaderImpl CreateBuiltInShaderImpl(BuiltInShader BuiltInShaderType);
+
+ }
+}
Modified: branches/shaders/Tests/Shaders/LightingTest/LightingTest.cs
===================================================================
--- branches/shaders/Tests/Shaders/LightingTest/LightingTest.cs 2009-11-07 22:02:43 UTC (rev 1091)
+++ branches/shaders/Tests/Shaders/LightingTest/LightingTest.cs 2009-11-09 01:39:35 UTC (rev 1092)
@@ -14,7 +14,7 @@
{
#region IAgateTest Members
- public string Name { get { return "Lighting (Direct3D only)"; } }
+ public string Name { get { return "Lighting"; } }
public string Category { get { return "Shaders"; } }
#endregion
@@ -24,16 +24,16 @@
using (AgateSetup setup = new AgateSetup(args))
{
setup.AskUser = true;
- setup.PreferredDisplay = AgateLib.Drivers.DisplayTypeID.Direct3D9_SDX;
+ setup.PreferredDisplay = AgateLib.Drivers.DisplayTypeID.OpenGL;
setup.Initialize(true, false, false);
if (setup.WasCanceled)
return;
- if (Display.Caps.SupportsCustomShaders == false)
- {
- MessageBox.Show("You must have a driver that supports shaders.", "Lighting Test");
- return;
- }
+ //if (Display.Caps.SupportsCustomShaders == false)
+ //{
+ // MessageBox.Show("You must have a driver that supports shaders.", "Lighting Test");
+ // return;
+ //}
LightingTestForm frm = new LightingTestForm();
frm.Show();
@@ -47,28 +47,33 @@
image.SetScale(2.0, 2.0);
ball.DisplayAlignment = OriginAlignment.Center;
- Effect fx = ShaderCompiler.CompileEffect(ShaderLanguage.Hlsl,
- System.IO.File.ReadAllText("Data/shaders/hlsl/Lighting.fx"));
+ //Effect fx = ShaderCompiler.CompileEffect(ShaderLanguage.Hlsl,
+ // System.IO.File.ReadAllText("Data/shaders/hlsl/Lighting.fx"));
- //LightManager lights = new LightManager();
- //lights.Enabled = true;
- //lights.AddPointLight(new Vector3(0, 0, -1), Color.White);
- //lights.AddPointLight(new Vector3(0, 0, -1), Color.Yellow);
+ var lights = AgateBuiltInShaders.Lighting2D;
- fx.SetVariable("lightColor", Color.White);
+ Light lt1 = new Light();
+ lt1.Position = new Vector3(0, 0, -1);
+ lt1.DiffuseColor = Color.White;
- Display.RenderState.WaitForVerticalBlank = false;
+ Light lt2 = new Light();
+ lt2.Position = new Vector3(0, 0, -1);
+ lt2.DiffuseColor = Color.Yellow;
- //lights[0].Ambient = Color.White;
- //lights[1].AttenuationConstant = 0.01f;
- //lights[1].AttenuationQuadratic = 5e-7f;
+ lights.AddLight(lt1);
+ lights.AddLight(lt2);
- fx.SetVariable("attenuation", 0.5f, 0, 5e-4f);
- fx.SetTexture(EffectTexture.Texture0, "texture0");
+ lt1.AttenuationConstant = 0.01f;
+ lt1.AttenuationQuadratic = 5e-7f;
+ lt2.AttenuationConstant = 0.01f;
+ lt2.AttenuationLinear = 1e-4f;
+
+ Display.RenderState.WaitForVerticalBlank = false;
+
Mouse.MouseMove += delegate(InputEventArgs e)
{
- fx.SetVariable("lightPos", (float) e.MousePosition.X, e.MousePosition.Y);
+ lt2.Position = new Vector3(e.MousePosition.X, e.MousePosition.Y, -1);
};
while (frm.Visible == true)
@@ -76,29 +81,29 @@
if (frm.chkMoveLight.Checked)
time += Display.DeltaTime / 1000.0;
-
ballPt = new Point((int)(120 + 110 * Math.Cos(time)),
(int)(120 + 110 * Math.Sin(time)));
- //lights[0].Position = new Vector3(ballPt.X, ballPt.Y, -1);
- //lights[0].Ambient = Color.FromArgb(frm.btnAmbient.BackColor.ToArgb());
- //lights[0].Diffuse = Color.FromArgb(frm.btnDiffuse.BackColor.ToArgb());
+ lt1.Position = new Vector3(ballPt.X, ballPt.Y, -1);
+
image.RotationAngleDegrees = (double)frm.nudAngle.Value;
Display.BeginFrame();
Display.Clear(Color.DarkRed);
+ lights.Activate();
+
//lights.Enabled = frm.enableLightingCheck.Checked;
//lights.DoLighting();
- fx.SetVariable("worldViewProj", wnd.OrthoProjection);
+ //fx.SetVariable("worldViewProj", wnd.OrthoProjection);
- if (frm.enableShader.Checked)
- {
- Display.Effect = fx;
- }
- else
- Display.Effect = null;
+ //if (frm.enableShader.Checked)
+ //{
+ // Display.Effect = fx;
+ //}
+ //else
+ // Display.Effect = null;
if (frm.chkSurfaceGradient.Checked)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-07 22:02:54
|
Revision: 1091
http://agate.svn.sourceforge.net/agate/?rev=1091&view=rev
Author: kanato
Date: 2009-11-07 22:02:43 +0000 (Sat, 07 Nov 2009)
Log Message:
-----------
Implement Basic2DShader for OTK and SDX.
Modified Paths:
--------------
branches/shaders/AgateLib/DisplayLib/Display.cs
branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs
branches/shaders/Drivers/AgateDrawing/DrawingBasic2DShader.cs
branches/shaders/Drivers/AgateDrawing/Drawing_Display.cs
branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
branches/shaders/Drivers/AgateOTK/GL_Display.cs
branches/shaders/Drivers/AgateSDX/AgateSDX.csproj
branches/shaders/Drivers/AgateSDX/SDX_Display.cs
Modified: branches/shaders/AgateLib/DisplayLib/Display.cs
===================================================================
--- branches/shaders/AgateLib/DisplayLib/Display.cs 2009-11-07 22:02:09 UTC (rev 1090)
+++ branches/shaders/AgateLib/DisplayLib/Display.cs 2009-11-07 22:02:43 UTC (rev 1091)
@@ -21,6 +21,7 @@
using System.IO;
using System.Text;
+using AgateLib.DisplayLib.Shaders;
using AgateLib.Drivers;
using AgateLib.Geometry;
using AgateLib.ImplementationBase;
Modified: branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs
===================================================================
--- branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs 2009-11-07 22:02:09 UTC (rev 1090)
+++ branches/shaders/AgateLib/ImplementationBase/DisplayImpl.cs 2009-11-07 22:02:43 UTC (rev 1091)
@@ -42,6 +42,7 @@
public abstract bool Supports(DisplayBoolCaps caps);
public abstract IEnumerable<DisplayLib.Shaders.ShaderLanguage> SupportedShaderLanguages { get; }
+ private static AgateShader mShader;
/// <summary>
/// Gets or sets the current render target.
@@ -646,8 +647,14 @@
}
public virtual AgateShader Shader
{
- get { throw new NotSupportedException("The current driver does not support shaders."); }
- set { throw new NotSupportedException("The current driver does not support shaders."); }
+ get { return mShader; }
+ set {
+ if (mShader != null)
+ mShader.End();
+
+ mShader = value;
+ mShader.Begin();
+ }
}
protected void InitializeShaders()
Modified: branches/shaders/Drivers/AgateDrawing/DrawingBasic2DShader.cs
===================================================================
--- branches/shaders/Drivers/AgateDrawing/DrawingBasic2DShader.cs 2009-11-07 22:02:09 UTC (rev 1090)
+++ branches/shaders/Drivers/AgateDrawing/DrawingBasic2DShader.cs 2009-11-07 22:02:43 UTC (rev 1091)
@@ -40,22 +40,18 @@
public override void Begin()
{
- throw new NotImplementedException();
}
public override void BeginPass(int passIndex)
{
- throw new NotImplementedException();
}
public override void EndPass()
{
- throw new NotImplementedException();
}
public override void End()
{
- throw new NotImplementedException();
}
}
}
Modified: branches/shaders/Drivers/AgateDrawing/Drawing_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateDrawing/Drawing_Display.cs 2009-11-07 22:02:09 UTC (rev 1090)
+++ branches/shaders/Drivers/AgateDrawing/Drawing_Display.cs 2009-11-07 22:02:43 UTC (rev 1091)
@@ -46,7 +46,6 @@
private Drawing_IRenderTarget mRenderTarget;
private bool mInFrame = false;
- AgateShader mShader;
#endregion
@@ -244,14 +243,6 @@
{
}
- public override AgateLib.DisplayLib.Shaders.AgateShader Shader
- {
- get { return mShader; }
- set
- {
- mShader = value;
- }
- }
protected override AgateShaderImpl CreateBuiltInShader(AgateLib.DisplayLib.Shaders.Implementation.BuiltInShader BuiltInShaderType)
{
switch (BuiltInShaderType)
Modified: branches/shaders/Drivers/AgateOTK/AgateOTK.csproj
===================================================================
--- branches/shaders/Drivers/AgateOTK/AgateOTK.csproj 2009-11-07 22:02:09 UTC (rev 1090)
+++ branches/shaders/Drivers/AgateOTK/AgateOTK.csproj 2009-11-07 22:02:43 UTC (rev 1091)
@@ -173,6 +173,9 @@
<Compile Include="Otk_Reporter.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="Shaders\FixedFunction\FixedFunctionShaderFactory.cs" />
+ <Compile Include="Shaders\FixedFunction\OTK_Basic2DShader_FF.cs" />
+ <Compile Include="Shaders\ShaderFactory.cs" />
<Compile Include="TextureCoordinates.cs">
<SubType>Code</SubType>
</Compile>
Modified: branches/shaders/Drivers/AgateOTK/GL_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-07 22:02:09 UTC (rev 1090)
+++ branches/shaders/Drivers/AgateOTK/GL_Display.cs 2009-11-07 22:02:43 UTC (rev 1091)
@@ -82,6 +82,11 @@
{
get { return PixelFormat.RGBA8888; }
}
+
+ protected override AgateLib.DisplayLib.Shaders.Implementation.AgateShaderImpl CreateBuiltInShader(AgateLib.DisplayLib.Shaders.Implementation.BuiltInShader BuiltInShaderType)
+ {
+ return Shaders.ShaderFactory.CreateBuiltInShader(BuiltInShaderType);
+ }
public override DisplayWindowImpl CreateDisplayWindow(CreateWindowParams windowParams)
{
return new GL_DisplayControl(windowParams);
Modified: branches/shaders/Drivers/AgateSDX/AgateSDX.csproj
===================================================================
--- branches/shaders/Drivers/AgateSDX/AgateSDX.csproj 2009-11-07 22:02:09 UTC (rev 1090)
+++ branches/shaders/Drivers/AgateSDX/AgateSDX.csproj 2009-11-07 22:02:43 UTC (rev 1091)
@@ -141,6 +141,8 @@
<Compile Include="SDX_VertexBuffer.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="Shaders\SDX_Basic2DShader.cs" />
+ <Compile Include="Shaders\ShaderFactory.cs" />
<Compile Include="VertexFormats.cs">
<SubType>Code</SubType>
</Compile>
Modified: branches/shaders/Drivers/AgateSDX/SDX_Display.cs
===================================================================
--- branches/shaders/Drivers/AgateSDX/SDX_Display.cs 2009-11-07 22:02:09 UTC (rev 1090)
+++ branches/shaders/Drivers/AgateSDX/SDX_Display.cs 2009-11-07 22:02:43 UTC (rev 1091)
@@ -237,6 +237,10 @@
#region --- Creation of objects ---
+ protected override AgateLib.DisplayLib.Shaders.Implementation.AgateShaderImpl CreateBuiltInShader(AgateLib.DisplayLib.Shaders.Implementation.BuiltInShader BuiltInShaderType)
+ {
+ return Shaders.ShaderFactory.CreateBuiltInShader(BuiltInShaderType);
+ }
public override DisplayWindowImpl CreateDisplayWindow(CreateWindowParams windowParams)
{
return new SDX_DisplayWindow(windowParams);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-07 22:02:19
|
Revision: 1090
http://agate.svn.sourceforge.net/agate/?rev=1090&view=rev
Author: kanato
Date: 2009-11-07 22:02:09 +0000 (Sat, 07 Nov 2009)
Log Message:
-----------
Implementation of platform version detection.
Modified Paths:
--------------
branches/shaders/AgateLib/Core.cs
branches/shaders/AgateLib/Platform.cs
branches/shaders/AgateLib/PlatformType.cs
Modified: branches/shaders/AgateLib/Core.cs
===================================================================
--- branches/shaders/AgateLib/Core.cs 2009-11-06 01:24:51 UTC (rev 1089)
+++ branches/shaders/AgateLib/Core.cs 2009-11-07 22:02:09 UTC (rev 1090)
@@ -98,7 +98,6 @@
public static class ErrorReporting
{
-
private static string mErrorFile = "errorlog.txt";
private static bool mAutoStackTrace = false;
private static bool mWroteHeader = false;
@@ -296,6 +295,7 @@
static Core()
{
+ Initialize();
}
/// <summary>
/// Initializes Core class.
@@ -306,10 +306,10 @@
if (mInititalized)
return;
+
mPlatform = new Platform();
Drivers.Registrar.Initialize();
- Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
mInititalized = true;
}
Modified: branches/shaders/AgateLib/Platform.cs
===================================================================
--- branches/shaders/AgateLib/Platform.cs 2009-11-06 01:24:51 UTC (rev 1089)
+++ branches/shaders/AgateLib/Platform.cs 2009-11-07 22:02:09 UTC (rev 1090)
@@ -19,8 +19,10 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
+using System.IO;
using System.Linq;
using System.Text;
+using System.Reflection;
using System.Runtime.InteropServices;
namespace AgateLib
@@ -29,13 +31,92 @@
{
PlatformType mType;
DotNetRuntime mRuntime;
+ WindowsVersion mWindowsVersion;
+ string mDocuments;
+ string mAppData;
+ string mAppDir;
- internal Platform()
+ internal Platform()
{
mType = DetectPlatformType();
mRuntime = DetectRuntime();
+
+ if (PlatformType != PlatformType.Windows)
+ Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
+
+ CheckOSVersion();
+
+ if (mType == PlatformType.Windows)
+ mWindowsVersion = DetectWindowsVersion();
+
+ SetFolders();
+
+ string debugLog = "debuglog.txt";
+
+ if (HasWriteAccessToAppDirectory())
+ debugLog = Path.Combine(mAppDir, debugLog);
+ else
+ debugLog = Path.Combine(mAppData, debugLog);
+
+ Debug.Listeners.Add(new TextWriterTraceListener(new StreamWriter(debugLog)));
}
+ // TODO: Maybe there is a better way to inspect permissions?
+ private bool HasWriteAccessToAppDirectory()
+ {
+ string filename = Path.GetTempFileName();
+
+ try
+ {
+ string targetFile = Path.Combine(mAppDir, Path.GetFileName(filename));
+
+ using (var w = new StreamWriter(targetFile))
+ {
+ w.WriteLine("x");
+ }
+
+ File.Delete(targetFile);
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ static T GetCustomAttribute<T>(Assembly ass) where T : Attribute
+ {
+ return ass.GetCustomAttributes(typeof(T), false)[0] as T;
+ }
+ private void SetFolders()
+ {
+ Assembly entryPt = Assembly.GetEntryAssembly();
+ string fqn = entryPt.GetLoadedModules()[0].FullyQualifiedName;
+
+ var companyAttribute = GetCustomAttribute<AssemblyCompanyAttribute>(entryPt);
+ var nameAttribute = GetCustomAttribute<AssemblyProductAttribute>(entryPt);
+
+ mAppDir = Path.GetDirectoryName(fqn);
+ Console.WriteLine("App Dir: {0}", mAppDir);
+
+ SetFolderPaths(companyAttribute.Company, nameAttribute.Product);
+ }
+
+ public void SetFolderPaths(string companyName, string appName)
+ {
+ string combDir = Path.Combine(companyName, appName);
+
+ mAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
+ mDocuments = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
+
+ mAppData = Path.Combine(mAppData, combDir);
+ mDocuments = Path.Combine(mDocuments, combDir);
+
+ Console.WriteLine("App Data: {0}", mAppData);
+ Console.WriteLine("Documents: {0}", mDocuments);
+
+ }
+
private DotNetRuntime DetectRuntime()
{
DotNetRuntime runtime = DotNetRuntime.MicrosoftDotNet;
@@ -46,6 +127,22 @@
return runtime;
}
+ /// <summary>
+ /// Returns the version of windows being used, if the current platform is Windows.
+ /// An exception is thrown if this property is checked when the platform is not Windows.
+ /// </summary>
+ public WindowsVersion WindowsVersion
+ {
+ get
+ {
+ if (PlatformType != PlatformType.Windows)
+ throw new AgateCrossPlatformException(
+ "Current platform is not Windows, but the WindowsVersion propety was checked.");
+
+ return mWindowsVersion;
+ }
+ }
+
public PlatformType PlatformType
{
get { return mType; }
@@ -137,5 +234,45 @@
#endregion
+
+ private void CheckOSVersion()
+ {
+ var version = System.Environment.OSVersion.Version;
+
+ Debug.Print("OS Version: {0}", System.Environment.OSVersion.VersionString);
+ Debug.IndentLevel++;
+ Debug.Print("Major: {0}", version.Major);
+ Debug.Print("Major revision: {0}", version.MajorRevision);
+ Debug.Print("Minor: {0}", version.Minor);
+ Debug.Print("Minor revision: {0}", version.MinorRevision);
+ Debug.Print("Revision: {0}", version.Revision);
+ Debug.Print("Build: {0}", version.Build);
+ Debug.Print("Service Pack: {0}", System.Environment.OSVersion.ServicePack);
+ Debug.IndentLevel--;
+ }
+
+ private WindowsVersion DetectWindowsVersion()
+ {
+ WindowsVersion retval = WindowsVersion.WindowsVista;
+
+ switch (System.Environment.OSVersion.Version.Major)
+ {
+ case 4:
+ retval = WindowsVersion.Windows98;
+ break;
+ case 5:
+ retval = WindowsVersion.WindowsXP;
+ break;
+ case 6:
+ retval = WindowsVersion.WindowsVista;
+ break;
+ case 7:
+ retval = WindowsVersion.Windows7;
+ break;
+ }
+
+ return retval;
+ }
+
}
}
Modified: branches/shaders/AgateLib/PlatformType.cs
===================================================================
--- branches/shaders/AgateLib/PlatformType.cs 2009-11-06 01:24:51 UTC (rev 1089)
+++ branches/shaders/AgateLib/PlatformType.cs 2009-11-07 22:02:09 UTC (rev 1090)
@@ -56,6 +56,14 @@
Gp2x,
}
+ public enum WindowsVersion
+ {
+ Windows98,
+ WindowsXP,
+ WindowsVista,
+ Windows7,
+ }
+
/// <summary>
/// Enum indicating which .NET runtime is currently in use.
/// </summary>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-06 01:25:01
|
Revision: 1089
http://agate.svn.sourceforge.net/agate/?rev=1089&view=rev
Author: kanato
Date: 2009-11-06 01:24:51 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
Add platform files.
Added Paths:
-----------
branches/shaders/AgateLib/Platform.cs
branches/shaders/AgateLib/PlatformType.cs
Added: branches/shaders/AgateLib/Platform.cs
===================================================================
--- branches/shaders/AgateLib/Platform.cs (rev 0)
+++ branches/shaders/AgateLib/Platform.cs 2009-11-06 01:24:51 UTC (rev 1089)
@@ -0,0 +1,141 @@
+// The contents of this file are subject to the Mozilla Public License
+// Version 1.1 (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS"
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+// License for the specific language governing rights and limitations
+// under the License.
+//
+// The Original Code is AgateLib.
+//
+// The Initial Developer of the Original Code is Erik Ylvisaker.
+// Portions created by Erik Ylvisaker are Copyright (C) 2009.
+// All Rights Reserved.
+//
+// Contributor(s): Erik Ylvisaker
+//
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace AgateLib
+{
+ public class Platform
+ {
+ PlatformType mType;
+ DotNetRuntime mRuntime;
+
+ internal Platform()
+ {
+ mType = DetectPlatformType();
+ mRuntime = DetectRuntime();
+ }
+
+ private DotNetRuntime DetectRuntime()
+ {
+ DotNetRuntime runtime = DotNetRuntime.MicrosoftDotNet;
+
+ if (Type.GetType("Mono.Runtime") != null)
+ runtime = DotNetRuntime.Mono;
+
+ return runtime;
+ }
+
+ public PlatformType PlatformType
+ {
+ get { return mType; }
+ }
+ public DotNetRuntime Runtime
+ {
+ get { return mRuntime; }
+ }
+
+ PlatformType DetectPlatformType()
+ {
+ switch (Environment.OSVersion.Platform)
+ {
+ case PlatformID.WinCE:
+ case PlatformID.Win32NT:
+ case PlatformID.Win32S:
+ case PlatformID.Win32Windows:
+ return AgateLib.PlatformType.Windows;
+
+ case PlatformID.Unix:
+ string kernel = DetectUnixKernel();
+
+ if (kernel == "Darwin")
+ return PlatformType.MacOS;
+ else
+ return PlatformType.Linux;
+
+ case PlatformID.MacOSX:
+ return PlatformType.MacOS;
+
+ case PlatformID.Xbox:
+ return PlatformType.XBox360;
+ }
+
+ return PlatformType.Unknown;
+ }
+
+ #region private static string DetectUnixKernel()
+
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+ struct utsname
+ {
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
+ public string sysname;
+
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
+ public string nodename;
+
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
+ public string release;
+
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
+ public string version;
+
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
+ public string machine;
+
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
+ public string extraJustInCase;
+
+ }
+
+ /// <summary>
+ /// Detects the unix kernel by p/invoking the uname call in libc.
+ /// </summary>
+ /// <returns></returns>
+ private static string DetectUnixKernel()
+ {
+ Debug.Print("Size: {0}", Marshal.SizeOf(typeof(utsname)).ToString());
+ Debug.Flush();
+
+ utsname uts = new utsname();
+ uname(out uts);
+
+ Debug.WriteLine("System:");
+ Debug.Indent();
+ Debug.WriteLine(uts.sysname);
+ Debug.WriteLine(uts.nodename);
+ Debug.WriteLine(uts.release);
+ Debug.WriteLine(uts.version);
+ Debug.WriteLine(uts.machine);
+ Debug.Unindent();
+
+ return uts.sysname.ToString();
+ }
+
+ [DllImport("libc")]
+ private static extern void uname(out utsname uname_struct);
+
+ #endregion
+
+ }
+}
Added: branches/shaders/AgateLib/PlatformType.cs
===================================================================
--- branches/shaders/AgateLib/PlatformType.cs (rev 0)
+++ branches/shaders/AgateLib/PlatformType.cs 2009-11-06 01:24:51 UTC (rev 1089)
@@ -0,0 +1,82 @@
+// The contents of this file are subject to the Mozilla Public License
+// Version 1.1 (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://www.mozilla.org/MPL/
+//
+// Software distributed under the License is distributed on an "AS IS"
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+// License for the specific language governing rights and limitations
+// under the License.
+//
+// The Original Code is AgateLib.
+//
+// The Initial Developer of the Original Code is Erik Ylvisaker.
+// Portions created by Erik Ylvisaker are Copyright (C) 2009.
+// All Rights Reserved.
+//
+// Contributor(s): Erik Ylvisaker
+//
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace AgateLib
+{
+ /// <summary>
+ /// Enumeration listing the known platform types.
+ /// </summary>
+ public enum PlatformType
+ {
+ /// <summary>
+ /// Default value.
+ /// </summary>
+ Unknown,
+
+ /// <summary>
+ /// The Windows platform, including Windows 98, Windows NT, Windows XP, Windows Vista, etc.
+ /// </summary>
+ Windows,
+ /// <summary>
+ /// Some Linux / Unix platform, typically running with an X windowing system.
+ /// </summary>
+ Linux,
+ /// <summary>
+ /// Mac OS 10.3 or later.
+ /// </summary>
+ MacOS,
+
+ /// <summary>
+ /// Microsoft's XBox 360 console.
+ /// </summary>
+ XBox360,
+ /// <summary>
+ /// The portable GP2x handheld, or compatible.
+ /// </summary>
+ Gp2x,
+ }
+
+ /// <summary>
+ /// Enum indicating which .NET runtime is currently in use.
+ /// </summary>
+ public enum DotNetRuntime
+ {
+ /// <summary>
+ /// An unknown runtime.
+ /// </summary>
+ Unknown,
+
+ /// <summary>
+ /// Microsoft's runtime.
+ /// </summary>
+ MicrosoftDotNet = 1,
+ /// <summary>
+ /// The runtime of the Mono project
+ /// </summary>
+ Mono,
+ /// <summary>
+ /// The DotGnu / Portable.NET runtime.
+ /// </summary>
+ DotGnu,
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-11-06 01:19:20
|
Revision: 1088
http://agate.svn.sourceforge.net/agate/?rev=1088&view=rev
Author: kanato
Date: 2009-11-06 01:19:05 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
Add PlatformDetection tester.
Added Paths:
-----------
branches/shaders/Tests/CoreTests/PlatformDetection.Designer.cs
branches/shaders/Tests/CoreTests/PlatformDetection.cs
branches/shaders/Tests/CoreTests/PlatformDetection.resx
Added: branches/shaders/Tests/CoreTests/PlatformDetection.Designer.cs
===================================================================
--- branches/shaders/Tests/CoreTests/PlatformDetection.Designer.cs (rev 0)
+++ branches/shaders/Tests/CoreTests/PlatformDetection.Designer.cs 2009-11-06 01:19:05 UTC (rev 1088)
@@ -0,0 +1,85 @@
+namespace Tests.CoreTests
+{
+ partial class PlatformDetection
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.lblPlatform = new System.Windows.Forms.Label();
+ this.lblRuntime = new System.Windows.Forms.Label();
+ this.button1 = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // lblPlatform
+ //
+ this.lblPlatform.AutoSize = true;
+ this.lblPlatform.Location = new System.Drawing.Point(12, 9);
+ this.lblPlatform.Name = "lblPlatform";
+ this.lblPlatform.Size = new System.Drawing.Size(45, 13);
+ this.lblPlatform.TabIndex = 0;
+ this.lblPlatform.Text = "Platform";
+ //
+ // lblRuntime
+ //
+ this.lblRuntime.AutoSize = true;
+ this.lblRuntime.Location = new System.Drawing.Point(12, 40);
+ this.lblRuntime.Name = "lblRuntime";
+ this.lblRuntime.Size = new System.Drawing.Size(83, 13);
+ this.lblRuntime.TabIndex = 1;
+ this.lblRuntime.Text = "DotNet Runtime";
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(197, 69);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 2;
+ this.button1.Text = "Close";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // PlatformDetection
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(284, 104);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.lblRuntime);
+ this.Controls.Add(this.lblPlatform);
+ this.Name = "PlatformDetection";
+ this.Text = "Platform Detection";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label lblPlatform;
+ private System.Windows.Forms.Label lblRuntime;
+ private System.Windows.Forms.Button button1;
+ }
+}
\ No newline at end of file
Added: branches/shaders/Tests/CoreTests/PlatformDetection.cs
===================================================================
--- branches/shaders/Tests/CoreTests/PlatformDetection.cs (rev 0)
+++ branches/shaders/Tests/CoreTests/PlatformDetection.cs 2009-11-06 01:19:05 UTC (rev 1088)
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace Tests.CoreTests
+{
+ public partial class PlatformDetection : Form, IAgateTest
+ {
+ public PlatformDetection()
+ {
+ InitializeComponent();
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ this.Close();
+
+ }
+
+ #region IAgateTest Members
+
+ string IAgateTest.Name
+ {
+ get { return "Platform Detection"; }
+ }
+
+ string IAgateTest.Category
+ {
+ get { return "Core"; }
+ }
+
+ void IAgateTest.Main(string[] args)
+ {
+ Application.Run(this);
+ }
+
+ #endregion
+ }
+}
Added: branches/shaders/Tests/CoreTests/PlatformDetection.resx
===================================================================
--- branches/shaders/Tests/CoreTests/PlatformDetection.resx (rev 0)
+++ branches/shaders/Tests/CoreTests/PlatformDetection.resx 2009-11-06 01:19:05 UTC (rev 1088)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|