Thread: [Agate-svn-commit] SF.net SVN: agate:[974] branches/agate3d-3.2/Drivers/AgateSDX
Status: Alpha
Brought to you by:
kanato
|
From: <ka...@us...> - 2009-05-11 06:31:03
|
Revision: 974
http://agate.svn.sourceforge.net/agate/?rev=974&view=rev
Author: kanato
Date: 2009-05-11 06:30:52 +0000 (Mon, 11 May 2009)
Log Message:
-----------
Correct detection and use of display pixel format
Modified Paths:
--------------
branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs
branches/agate3d-3.2/Drivers/AgateSDX/SDX_Surface.cs
Added Paths:
-----------
branches/agate3d-3.2/Drivers/AgateSDX/AgateSDX.csproj
Added: branches/agate3d-3.2/Drivers/AgateSDX/AgateSDX.csproj
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/AgateSDX.csproj (rev 0)
+++ branches/agate3d-3.2/Drivers/AgateSDX/AgateSDX.csproj 2009-05-11 06:30:52 UTC (rev 974)
@@ -0,0 +1,162 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{819F5358-7F15-4ED2-986E-94B0A2BCCDDF}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ApplicationIcon>
+ </ApplicationIcon>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
+ <AssemblyName>AgateSDX</AssemblyName>
+ <DefaultClientScript>JScript</DefaultClientScript>
+ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
+ <DefaultTargetSchema>IE50</DefaultTargetSchema>
+ <DelaySign>false</DelaySign>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>
+ </AppDesignerFolder>
+ <RootNamespace>AgateSDX</RootNamespace>
+ <StartupObject>
+ </StartupObject>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>DEBUG;TRACE;</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>True</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <Optimize>False</Optimize>
+ <OutputPath>..\..\Binaries\Debug\Drivers\</OutputPath>
+ <RegisterForComInterop>False</RegisterForComInterop>
+ <RemoveIntegerChecks>False</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>
+ </NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>TRACE;</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>False</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <Optimize>True</Optimize>
+ <OutputPath>..\..\Binaries\Release\Drivers\</OutputPath>
+ <RegisterForComInterop>False</RegisterForComInterop>
+ <RemoveIntegerChecks>False</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>
+ </NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="SlimDX">
+ <Name>SlimDX</Name>
+ </Reference>
+ <Reference Include="System">
+ <Name>System</Name>
+ </Reference>
+ <Reference Include="System.Core">
+ <Name>System.Core</Name>
+ </Reference>
+ <Reference Include="System.Data">
+ <Name>System.Data</Name>
+ </Reference>
+ <Reference Include="System.Drawing">
+ <Name>System.Drawing</Name>
+ </Reference>
+ <Reference Include="System.Windows.Forms">
+ <Name>System.Windows.Forms</Name>
+ </Reference>
+ <Reference Include="System.Xml">
+ <Name>System.Xml</Name>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\AgateLib\AgateLib.csproj">
+ <Name>AgateLib</Name>
+ <Project>{C9CD5A49-13B1-4B31-8EB4-5EDBF6C3811D}</Project>
+ <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
+ </ProjectReference>
+ <ProjectReference Include="..\AgateLib.WinForms\AgateLib.WinForms.csproj">
+ <Name>AgateLib.WinForms</Name>
+ <Project>{451F5273-F4D3-42BC-B29B-CC719523CE78}</Project>
+ <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="D3DDevice.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="DrawBuffer.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="frmFullScreen.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="frmFullScreen.Designer.cs">
+ <DependentUpon>frmFullScreen.cs</DependentUpon>
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="HlslCompiler.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="HlslShaderProgram.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="PositionColorNormalTexture.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Reporter.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="SDX_Display.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="SDX_DisplayWindow.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="SDX_IndexBuffer.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="SDX_IRenderTarget.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="SDX_Surface.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="SDX_VertexBuffer.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <EmbeddedResource Include="frmFullScreen.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>frmFullScreen.cs</DependentUpon>
+ </EmbeddedResource>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
+ <PropertyGroup>
+ <PreBuildEvent>
+ </PreBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs 2009-05-11 06:29:57 UTC (rev 973)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs 2009-05-11 06:30:52 UTC (rev 974)
@@ -88,7 +88,7 @@
mInitialized = true;
// ok, create D3D device
- PresentParameters present = CreateWindowedPresentParameters(window, 0, 0);
+ PresentParameters present = CreateWindowedPresentParameters(window, 0, 0, 32);
DeviceType dtype = DeviceType.Hardware;
@@ -495,7 +495,8 @@
{
if (fullScreen == true)
{
- PresentParameters present = CreateFullScreenPresentParameters(displayWindow, width, height, bpp);
+ PresentParameters present =
+ CreateFullScreenPresentParameters(displayWindow, width, height, bpp);
OnDeviceAboutToReset();
@@ -507,7 +508,8 @@
}
else
{
- PresentParameters present = CreateWindowedPresentParameters(displayWindow, width, height);
+ PresentParameters present =
+ CreateWindowedPresentParameters(displayWindow, width, height, bpp);
if (displayWindow.mSwap != null && displayWindow.IsFullScreen == true)
{
@@ -524,7 +526,7 @@
System.Diagnostics.Debug.Print("{0} Windowed mode success.", DateTime.Now);
- present = CreateWindowedPresentParameters(displayWindow, width, height);
+ present = CreateWindowedPresentParameters(displayWindow, width, height, bpp);
}
@@ -535,7 +537,7 @@
private PresentParameters CreateFullScreenPresentParameters(SDX_DisplayWindow displayWindow,
int width, int height, int bpp)
{
- PresentParameters present = CreateBasePresentParams(displayWindow);
+ PresentParameters present = CreateBasePresentParams(displayWindow, bpp);
present.SwapEffect = SwapEffect.Flip;
present.Windowed = false;
@@ -546,14 +548,14 @@
}
private PresentParameters CreateWindowedPresentParameters(SDX_DisplayWindow displayWindow,
- int width, int height)
+ int width, int height, int bpp)
{
- PresentParameters present = CreateBasePresentParams(displayWindow);
+ PresentParameters present = CreateBasePresentParams(displayWindow, bpp);
return present;
}
- private PresentParameters CreateBasePresentParams(SDX_DisplayWindow displayWindow)
+ private PresentParameters CreateBasePresentParams(SDX_DisplayWindow displayWindow, int bpp)
{
PresentParameters present = new PresentParameters();
@@ -563,7 +565,7 @@
present.DeviceWindowHandle = displayWindow.RenderTarget.Handle;
present.BackBufferWidth = displayWindow.Width;
present.BackBufferHeight = displayWindow.Height;
- present.BackBufferFormat = Format.Unknown;
+ present.BackBufferFormat = GetDisplayModeTrialPixelFormat(bpp);
present.SwapEffect = SwapEffect.Discard;
present.Windowed = true;
@@ -797,6 +799,10 @@
case Format.R8G8B8:
return 3;
+ case Format.R5G6B5:
+ case Format.X1R5G5B5:
+ return 2;
+
default:
throw new NotSupportedException("Format not supported.");
}
@@ -817,7 +823,7 @@
}
public override PixelFormat DefaultSurfaceFormat
{
- get { return PixelFormat.RGBA8888; }
+ get { return GetPixelFormat(DisplayMode.Format); }
}
public override void FlushDrawBuffer()
@@ -925,13 +931,13 @@
get { return AgateLib.DisplayLib.Shaders.ShaderLanguage.Hlsl; }
}
- #endregion
-
bool IDisplayCaps.CanCreateBitmapFont
{
get { return true; }
}
+ #endregion
+
#region --- 3D stuff ---
Matrix4 projection = Matrix4.Identity;
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_Surface.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_Surface.cs 2009-05-11 06:29:57 UTC (rev 973)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_Surface.cs 2009-05-11 06:30:52 UTC (rev 974)
@@ -207,7 +207,7 @@
//mTexture = new Texture(mDevice, bitmap, Usage.None, Pool.Managed);
Format format;
-
+
switch (mDisplay.DisplayMode.Format)
{
case Format.X8R8G8B8:
@@ -525,7 +525,7 @@
throw new NotImplementedException();
//SurfaceLoader.Save(frameFile, d3dformat, surf, Interop.Convert(mSrcRect));
-
+
}
#endregion
@@ -606,7 +606,6 @@
rect.X += mSrcRect.X;
rect.Y += mSrcRect.Y;
- int stride;
int pixelPitch = mDisplay.GetPixelPitch(surf.Description.Format);
PixelFormat pixelFormat = mDisplay.GetPixelFormat(surf.Description.Format);
@@ -614,7 +613,7 @@
if (format == PixelFormat.Any)
format = pixelFormat;
- var stm = surf.LockRectangle(
+ DataRectangle stm = surf.LockRectangle(
new Drawing.Rectangle(0, 0, mTextureSize.Width, mTextureSize.Height),
LockFlags.ReadOnly);
@@ -622,26 +621,24 @@
int length = SurfaceWidth * pixelPitch;
int index = 0;
- throw new NotImplementedException();
- //unsafe
- //{
- // DataStream st = stm.Data;
- // byte* ptr = (byte*)stm.Data.Read(;
+ unsafe
+ {
+ byte* ptr = (byte*)stm.Data.DataPointer;
- // for (int i = rect.Top; i < rect.Bottom; i++)
- // {
- // // hack if the size requested is too large.
- // if (i >= mTextureSize.Height)
- // break;
+ for (int i = rect.Top; i < rect.Bottom; i++)
+ {
+ // hack if the size requested is too large.
+ if (i >= mTextureSize.Height)
+ break;
- // //IntPtr ptr = (IntPtr)((int)stm.InternalData + i * stride + rect.Left * pixelPitch);
- // IntPtr mptr = (IntPtr)(ptr + i * stride + rect.Left * pixelPitch);
+ //IntPtr ptr = (IntPtr)((int)stm.InternalData + i * stride + rect.Left * pixelPitch);
+ IntPtr mptr = (IntPtr)(ptr + i * stm.Pitch + rect.Left * pixelPitch);
- // Marshal.Copy(mptr, array, index, length);
+ Marshal.Copy(mptr, array, index, length);
- // index += length;
- // }
- //}
+ index += length;
+ }
+ }
surf.UnlockRectangle();
surf.Dispose();
@@ -654,31 +651,28 @@
{
Direct3D.Surface surf = mTexture.Value.GetSurfaceLevel(0);
- int pitch;
int pixelPitch = mDisplay.GetPixelPitch(surf.Description.Format);
PixelFormat pixelFormat = mDisplay.GetPixelFormat(surf.Description.Format);
surf.Dispose();
- throw new NotImplementedException();
+ DataRectangle stm = mTexture.Value.LockRectangle(0, 0);
- //GraphicsStream stm = mTexture.Value.LockRectangle(0, 0, out pitch);
+ if (buffer.PixelFormat != pixelFormat)
+ buffer = buffer.ConvertTo(pixelFormat);
- //if (buffer.PixelFormat != pixelFormat)
- // buffer = buffer.ConvertTo(pixelFormat);
+ unsafe
+ {
+ for (int i = 0; i < SurfaceHeight; i++)
+ {
+ int startIndex = buffer.GetPixelIndex(0, i);
+ int rowStride = buffer.RowStride;
+ IntPtr dest = (IntPtr)((byte*)stm.Data.DataPointer + i * stm.Pitch);
- //unsafe
- //{
- // for (int i = 0; i < SurfaceHeight; i++)
- // {
- // int startIndex = buffer.GetPixelIndex(0, i);
- // int rowStride = buffer.RowStride;
- // IntPtr dest = (IntPtr)((byte*)stm.InternalData + i * pitch);
+ Marshal.Copy(buffer.Data, startIndex, dest, rowStride);
+ }
+ }
- // Marshal.Copy(buffer.Data, startIndex, dest, rowStride);
- // }
- //}
-
mTexture.Value.UnlockRectangle(0);
}
@@ -688,29 +682,29 @@
Direct3D.Surface surf = mTexture.Value.GetSurfaceLevel(0);
Rectangle updateRect = new Rectangle(startPoint, buffer.Size);
- int pitch;
int pixelPitch = mDisplay.GetPixelPitch(surf.Description.Format);
PixelFormat pixelFormat = mDisplay.GetPixelFormat(surf.Description.Format);
surf.Dispose();
- throw new NotImplementedException();
- //GraphicsStream stm = mTexture.Value.LockRectangle(0, Interop.Convert(updateRect), 0, out pitch);
+ DataRectangle stm = mTexture.Value.LockRectangle
+ (0, Interop.Convert(updateRect), LockFlags.Discard);
- //if (buffer.PixelFormat != pixelFormat)
- // buffer = buffer.ConvertTo(pixelFormat);
+ if (buffer.PixelFormat != pixelFormat)
+ buffer = buffer.ConvertTo(pixelFormat);
- //unsafe
- //{
- // for (int i = updateRect.Top; i < updateRect.Bottom; i++)
- // {
- // int startIndex = buffer.GetPixelIndex(0, i);
- // int rowStride = buffer.RowStride;
- // IntPtr dest = (IntPtr)((byte*)stm.InternalData + i * pitch + updateRect.Left * pixelPitch);
+ unsafe
+ {
+ for (int i = updateRect.Top; i < updateRect.Bottom; i++)
+ {
+ int startIndex = buffer.GetPixelIndex(0, i);
+ int rowStride = buffer.RowStride;
+ IntPtr dest = (IntPtr)
+ ((byte*)stm.Data.DataPointer + i * stm.Pitch + updateRect.Left * pixelPitch);
- // Marshal.Copy(buffer.Data, startIndex, dest, rowStride);
- // }
- //}
+ Marshal.Copy(buffer.Data, startIndex, dest, rowStride);
+ }
+ }
mTexture.Value.UnlockRectangle(0);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-05-11 14:22:34
|
Revision: 978
http://agate.svn.sourceforge.net/agate/?rev=978&view=rev
Author: kanato
Date: 2009-05-11 14:22:20 +0000 (Mon, 11 May 2009)
Log Message:
-----------
Remove use of Discard flag on locking vertex and index buffers, since Direct3D doesn't like it.
Modified Paths:
--------------
branches/agate3d-3.2/Drivers/AgateSDX/SDX_IndexBuffer.cs
branches/agate3d-3.2/Drivers/AgateSDX/SDX_VertexBuffer.cs
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_IndexBuffer.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_IndexBuffer.cs 2009-05-11 14:21:03 UTC (rev 977)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_IndexBuffer.cs 2009-05-11 14:22:20 UTC (rev 978)
@@ -61,7 +61,7 @@
public override void WriteIndices(int[] indices)
{
- var data = mBuffer.Lock(0, 0, SlimDX.Direct3D9.LockFlags.Discard);
+ var data = mBuffer.Lock(0, 0, 0);
data.WriteRange(indices);
mBuffer.Unlock();
@@ -70,7 +70,7 @@
public override void WriteIndices(short[] indices)
{
- var data = mBuffer.Lock(0, 0, SlimDX.Direct3D9.LockFlags.Discard);
+ var data = mBuffer.Lock(0, 0, 0);
data.WriteRange(indices);
mBuffer.Unlock();
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_VertexBuffer.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_VertexBuffer.cs 2009-05-11 14:21:03 UTC (rev 977)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_VertexBuffer.cs 2009-05-11 14:22:20 UTC (rev 978)
@@ -238,7 +238,7 @@
public override void Write<T>(T[] vertices)
{
- var stream = mBuffer.Lock(0, 0, SlimDX.Direct3D9.LockFlags.Discard);
+ var stream = mBuffer.Lock(0, 0, 0);
stream.WriteRange(vertices);
mBuffer.Unlock();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-05-11 15:17:13
|
Revision: 979
http://agate.svn.sourceforge.net/agate/?rev=979&view=rev
Author: kanato
Date: 2009-05-11 15:17:03 +0000 (Mon, 11 May 2009)
Log Message:
-----------
SlimDX Audio implementation initial commit. Correct namespace to be AgateSDX.
Modified Paths:
--------------
branches/agate3d-3.2/Drivers/AgateSDX/AgateSDX.csproj
branches/agate3d-3.2/Drivers/AgateSDX/D3DDevice.cs
branches/agate3d-3.2/Drivers/AgateSDX/DrawBuffer.cs
branches/agate3d-3.2/Drivers/AgateSDX/HlslCompiler.cs
branches/agate3d-3.2/Drivers/AgateSDX/HlslShaderProgram.cs
branches/agate3d-3.2/Drivers/AgateSDX/PositionColorNormalTexture.cs
branches/agate3d-3.2/Drivers/AgateSDX/Reporter.cs
branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs
branches/agate3d-3.2/Drivers/AgateSDX/SDX_DisplayWindow.cs
branches/agate3d-3.2/Drivers/AgateSDX/SDX_IRenderTarget.cs
branches/agate3d-3.2/Drivers/AgateSDX/SDX_IndexBuffer.cs
branches/agate3d-3.2/Drivers/AgateSDX/SDX_Input.cs
branches/agate3d-3.2/Drivers/AgateSDX/SDX_Surface.cs
branches/agate3d-3.2/Drivers/AgateSDX/SDX_VertexBuffer.cs
branches/agate3d-3.2/Drivers/AgateSDX/frmFullScreen.Designer.cs
branches/agate3d-3.2/Drivers/AgateSDX/frmFullScreen.cs
Added Paths:
-----------
branches/agate3d-3.2/Drivers/AgateSDX/SDX_Audio.cs
Modified: branches/agate3d-3.2/Drivers/AgateSDX/AgateSDX.csproj
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/AgateSDX.csproj 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/AgateSDX.csproj 2009-05-11 15:17:03 UTC (rev 979)
@@ -120,6 +120,8 @@
<Compile Include="HlslShaderProgram.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="SDX_Input.cs" />
+ <Compile Include="SDX_Audio.cs" />
<Compile Include="PositionColorNormalTexture.cs">
<SubType>Code</SubType>
</Compile>
Modified: branches/agate3d-3.2/Drivers/AgateSDX/D3DDevice.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/D3DDevice.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/D3DDevice.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -27,7 +27,7 @@
using AgateLib.Geometry;
using AgateLib.WinForms;
-namespace AgateMDX
+namespace AgateSDX
{
public class D3DDevice : IDisposable
{
Modified: branches/agate3d-3.2/Drivers/AgateSDX/DrawBuffer.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/DrawBuffer.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/DrawBuffer.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -25,7 +25,7 @@
using Direct3D = SlimDX.Direct3D9;
using AgateLib.DisplayLib;
-namespace AgateMDX
+namespace AgateSDX
{
/// <summary>
/// Perhaps at some point this should be converted to use a vertex buffer
Modified: branches/agate3d-3.2/Drivers/AgateSDX/HlslCompiler.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/HlslCompiler.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/HlslCompiler.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -6,7 +6,7 @@
using AgateLib.ImplementationBase;
using Direct3D = SlimDX.Direct3D9;
-namespace AgateMDX
+namespace AgateSDX
{
class HlslCompiler : ShaderCompilerImpl
{
Modified: branches/agate3d-3.2/Drivers/AgateSDX/HlslShaderProgram.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/HlslShaderProgram.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/HlslShaderProgram.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -6,7 +6,7 @@
using AgateLib.DisplayLib.Shaders;
using Direct3D = SlimDX.Direct3D9;
-namespace AgateMDX
+namespace AgateSDX
{
class HlslShaderProgram : ShaderProgram
{
Modified: branches/agate3d-3.2/Drivers/AgateSDX/PositionColorNormalTexture.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/PositionColorNormalTexture.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/PositionColorNormalTexture.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -23,7 +23,7 @@
using SlimDX;
using SlimDX.Direct3D9;
-namespace AgateMDX
+namespace AgateSDX
{
[StructLayout(LayoutKind.Sequential)]
public struct PositionColorNormalTexture
Modified: branches/agate3d-3.2/Drivers/AgateSDX/Reporter.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/Reporter.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/Reporter.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -21,7 +21,7 @@
using System.Text;
using AgateLib.Drivers;
-namespace AgateMDX
+namespace AgateSDX
{
class Reporter : AgateDriverReporter
{
@@ -33,11 +33,11 @@
"SlimDX - Direct3D 9",
500);
- //yield return new AgateDriverInfo(
- // AudioTypeID.DirectSound,
- // typeof(MDX1_Audio),
- // "SlimDX - DirectSound",
- // 100);
+ yield return new AgateDriverInfo(
+ AudioTypeID.XAudio2,
+ typeof(SDX_Audio),
+ "SlimDX - DirectSound",
+ 100);
yield return new AgateDriverInfo(
InputTypeID.DirectInput,
Copied: branches/agate3d-3.2/Drivers/AgateSDX/SDX_Audio.cs (from rev 922, branches/agate3d-3.2/Drivers/AgateMDX/MDX1_Audio.cs)
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_Audio.cs (rev 0)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_Audio.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -0,0 +1,434 @@
+// 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.IO;
+using System.Text;
+using SlimDX.XAudio2;
+using SlimDX.Multimedia;
+using AgateLib.AudioLib;
+using AgateLib.Drivers;
+using AgateLib.ImplementationBase;
+
+namespace AgateSDX
+{
+ public class SDX_Audio : AudioImpl
+ {
+ XAudio2 mDevice;
+
+ public XAudio2 Device
+ {
+ get { return mDevice; }
+ }
+
+ public SDX_Audio()
+ {
+
+ }
+
+ public override void Initialize()
+ {
+ Report("SlimDX XAudio2 driver instantiated for audio.");
+
+ mDevice = new XAudio2();
+ MasteringVoice masteringVoice = new MasteringVoice(mDevice);
+
+ }
+ public override void Dispose()
+ {
+ mDevice.Dispose();
+ }
+
+ public override SoundBufferImpl CreateSoundBuffer(Stream inStream)
+ {
+ return new SDX_SoundBuffer(this, inStream);
+ }
+ public override MusicImpl CreateMusic(System.IO.Stream musicStream)
+ {
+ CheckCoop();
+
+ return new SDX_Music(this, musicStream);
+ }
+ public override MusicImpl CreateMusic(string filename)
+ {
+ CheckCoop();
+
+ return new SDX_Music(this, filename);
+ }
+ public override SoundBufferImpl CreateSoundBuffer(string filename)
+ {
+ CheckCoop();
+
+ return new SDX_SoundBuffer(this, filename);
+ }
+ public override SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferImpl buffer)
+ {
+ CheckCoop();
+
+ return new SDX_SoundBufferSession(this, buffer as SDX_SoundBuffer);
+ }
+
+
+ /// <summary>
+ /// hack to make sure the cooperative level is set after a window is created.
+ /// Is this necessary with XAudio2?
+ /// </summary>
+ private void CheckCoop()
+ {
+ if (System.Windows.Forms.Form.ActiveForm != null)
+ {
+ //mDSobject.SetCooperativeLevel(System.Windows.Forms.Form.ActiveForm.Handle,
+ // CooperativeLevel.Priority);
+ }
+ }
+ }
+
+ public class SDX_SoundBuffer : SoundBufferImpl
+ {
+ SDX_Audio mAudio;
+ AudioBuffer mBuffer;
+ double mVolume;
+ WaveFormat mFormat;
+
+ public SDX_SoundBuffer(SDX_Audio audio, Stream inStream)
+ {
+ mAudio = audio;
+
+ WaveStream stream = new WaveStream(inStream);
+
+ mBuffer = new AudioBuffer();
+ mBuffer.AudioData = stream;
+ mBuffer.AudioBytes = (int)inStream.Length;
+ mBuffer.Flags = BufferFlags.EndOfStream;
+
+ mFormat = stream.Format;
+
+ }
+ public SDX_SoundBuffer(SDX_Audio audio, string filename)
+ : this(audio, File.OpenRead(filename))
+ {
+
+ }
+ public override void Dispose()
+ {
+ mBuffer.Dispose();
+ }
+
+ public AudioBuffer Buffer
+ {
+ get { return mBuffer; }
+ }
+ public WaveFormat Format
+ {
+ get { return mFormat; }
+ }
+
+ public override double Volume
+ {
+ get { return mVolume; }
+ set { mVolume = value; }
+ }
+ }
+ public class SDX_SoundBufferSession : SoundBufferSessionImpl
+ {
+ SDX_Audio mAudio;
+ AudioBuffer mBuffer;
+ SourceVoice mVoice;
+ double mVolume;
+ double mPan;
+
+ public SDX_SoundBufferSession(SDX_Audio audio, SDX_SoundBuffer source)
+ {
+ mAudio = audio;
+ mBuffer = source.Buffer;
+
+ mVoice = new SourceVoice(mAudio.Device, source.Format);
+ mVoice.SubmitSourceBuffer(mBuffer);
+ mVoice.Start();
+
+ mVolume = source.Volume;
+ }
+ public override void Dispose()
+ {
+ mVoice.Dispose();
+ }
+
+ public override void Play()
+ {
+ mVoice.Start();
+ }
+
+ public override void Stop()
+ {
+ mVoice.Stop();
+ }
+
+ public override double Volume
+ {
+ get { return mVolume; }
+ set
+ {
+ mVoice.Volume = (float)value;
+ mVolume = value;
+ }
+ }
+
+ public override bool IsPlaying
+ {
+ get
+ {
+ //return mVoice.State.
+ return false;
+ }
+ }
+
+ float[] channelVolumes = new float[2];
+ public override double Pan
+ {
+ get { return mPan; }
+ set
+ {
+ mPan = value;
+ mVoice.SetChannelVolumes(2, GetChannelVolumes((float)value));
+ }
+ }
+
+ private float[] GetChannelVolumes(float pan)
+ {
+ if (pan < 0)
+ {
+ channelVolumes[0] = 1;
+ channelVolumes[1] = 1 + pan;
+ }
+ else
+ {
+ channelVolumes[0] = 1 - pan;
+ channelVolumes[1] = 1;
+ }
+
+ return channelVolumes;
+ }
+
+ }
+ public class SDX_Music : MusicImpl
+ {
+ SDX_Audio mAudio;
+
+ public SDX_Music(SDX_Audio audio, string filename)
+ {
+ mAudio = audio;
+
+ if (System.IO.Path.GetExtension(filename) == ".mp3")
+ throw new Exception("MP3 files cannot be played due to license restrictions.");
+
+ //LoadMusic(filename);
+ }
+
+ public SDX_Music(SDX_Audio audio, Stream infile)
+ {
+ mAudio = audio;
+
+ //string tempfile = Path.GetTempFileName();
+ //using (FileStream writer = File.OpenWrite(tempfile))
+ //{
+ // ReadWriteStream(infile, writer);
+ //}
+
+ //try
+ //{
+ // LoadMusic(tempfile);
+ //}
+ //catch (Microsoft.DirectX.DirectXException e)
+ //{
+ // throw new AgateLib.AgateException(
+ // "Could not load the music file. The file format may be unsupported by DirectX.", e);
+ //}
+ //finally
+ //{
+ // File.Delete(tempfile);
+ //}
+ }
+ /*
+ private void LoadMusic(string filename)
+ {
+ mAVAudio = new Microsoft.DirectX.AudioVideoPlayback.Audio(filename);
+ mAVAudio.Ending += new EventHandler(mAVAudio_Ending);
+ }
+
+ private void ReadWriteStream(Stream readStream, Stream writeStream)
+ {
+ int Length = 256;
+ Byte[] buffer = new Byte[Length];
+ int bytesRead = readStream.Read(buffer, 0, Length);
+ // write the required bytes
+ while (bytesRead > 0)
+ {
+ writeStream.Write(buffer, 0, bytesRead);
+ bytesRead = readStream.Read(buffer, 0, Length);
+ }
+ readStream.Close();
+ writeStream.Close();
+ }
+
+ public override void Dispose()
+ {
+ mAVAudio.Dispose();
+ }
+
+
+ protected override void OnSetLoop(bool value)
+ {
+ if (value == true)
+ mAVAudio.Ending += mAVAudio_Ending;
+ else
+ mAVAudio.Ending -= mAVAudio_Ending;
+ }
+
+ public override void Play()
+ {
+ mAVAudio.Play();
+ }
+
+ public override void Stop()
+ {
+ mAVAudio.Stop();
+ }
+
+ /// <summary>
+ /// </summary>
+ public override double Volume
+ {
+ get
+ {
+ try
+ {
+ /// The DirectX AudioVideoPlayback object takes volume in the range of
+ /// -10000 to 0, indicating the number of hundredths of decibels the volume
+ /// is attenuated by, so we convert to zero to 1.
+
+ double vol = (double)(mAVAudio.Volume + 10000) / 10000;
+ // logarithmic volume control
+ return Audio.TransformByExp(vol);
+ }
+ catch (Microsoft.DirectX.DirectXException e)
+ {
+ System.Diagnostics.Debug.WriteLine("Failed to read volume.");
+ System.Diagnostics.Debug.WriteLine(e.Message);
+ return 1.0;
+ }
+ }
+ set
+ {
+ // do a logarithmic volume control
+ try
+ {
+ mAVAudio.Volume = (int)(Audio.TransformByLog(value) * 10000.0 - 10000.0);
+ }
+ catch (Microsoft.DirectX.DirectXException e)
+ {
+ System.Diagnostics.Debug.WriteLine("Failed to set volume.");
+ System.Diagnostics.Debug.WriteLine(e.Message);
+ }
+ }
+ }
+
+
+ void mAVAudio_Ending(object sender, EventArgs e)
+ {
+ if (IsLooping)
+ {
+ mAVAudio.CurrentPosition = 0;
+ }
+ }
+
+ public override bool IsPlaying
+ {
+ get { return mAVAudio.Playing; }
+ }
+
+ public override double Pan
+ {
+ get
+ {
+ return mAVAudio.Balance / (double)10000.0;
+ }
+ set
+ {
+ try
+ {
+ mAVAudio.Balance = (int)(value * 10000.0);
+ }
+ catch (Microsoft.DirectX.DirectXException e)
+ {
+ if (e.ErrorCode != -2147220909)
+ throw e;
+ }
+ }
+ }
+ * */
+ public override void Dispose()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override bool IsPlaying
+ {
+ get { throw new NotImplementedException(); }
+ }
+
+ protected override void OnSetLoop(bool value)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override double Pan
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ set
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ public override void Play()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void Stop()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override double Volume
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ set
+ {
+ throw new NotImplementedException();
+ }
+ }
+ }
+}
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -33,7 +33,7 @@
using Vector2 = SlimDX.Vector2;
using ImageFileFormat = AgateLib.DisplayLib.ImageFileFormat;
-namespace AgateMDX
+namespace AgateSDX
{
public class SDX_Display : DisplayImpl, IDisplayCaps, AgateLib.PlatformSpecific.IPlatformServices
{
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_DisplayWindow.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_DisplayWindow.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_DisplayWindow.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -32,7 +32,7 @@
using AgateLib.InputLib;
using AgateLib.WinForms;
-namespace AgateMDX
+namespace AgateSDX
{
public class SDX_DisplayWindow : DisplayWindowImpl, SDX_IRenderTarget
{
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_IRenderTarget.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_IRenderTarget.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_IRenderTarget.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -21,7 +21,7 @@
using System.Text;
using AgateLib.ImplementationBase;
-namespace AgateMDX
+namespace AgateSDX
{
public interface SDX_IRenderTarget : IRenderTargetImpl
{
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_IndexBuffer.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_IndexBuffer.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_IndexBuffer.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -6,7 +6,7 @@
using AgateLib.ImplementationBase;
using Direct3D = SlimDX.Direct3D9;
-namespace AgateMDX
+namespace AgateSDX
{
class SDX_IndexBuffer : IndexBufferImpl
{
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_Input.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_Input.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_Input.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -24,7 +24,7 @@
using AgateLib.Drivers;
using AgateLib.ImplementationBase;
-namespace AgateMDX
+namespace AgateSDX
{
public class SDX_Input : InputImpl
{
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_Surface.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_Surface.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_Surface.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -36,7 +36,7 @@
using Direct3D = SlimDX.Direct3D9;
using Surface = AgateLib.DisplayLib.Surface;
-namespace AgateMDX
+namespace AgateSDX
{
public class SDX_Surface : SurfaceImpl, SDX_IRenderTarget
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_VertexBuffer.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_VertexBuffer.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_VertexBuffer.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -8,7 +8,7 @@
using AgateLib.ImplementationBase;
using Direct3D = SlimDX.Direct3D9;
-namespace AgateMDX
+namespace AgateSDX
{
class SDX_VertexBuffer : VertexBufferImpl
{
Modified: branches/agate3d-3.2/Drivers/AgateSDX/frmFullScreen.Designer.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/frmFullScreen.Designer.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/frmFullScreen.Designer.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -16,7 +16,7 @@
//
// Contributor(s): Erik Ylvisaker
//
-namespace AgateMDX
+namespace AgateSDX
{
partial class frmFullScreen
{
Modified: branches/agate3d-3.2/Drivers/AgateSDX/frmFullScreen.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/frmFullScreen.cs 2009-05-11 14:22:20 UTC (rev 978)
+++ branches/agate3d-3.2/Drivers/AgateSDX/frmFullScreen.cs 2009-05-11 15:17:03 UTC (rev 979)
@@ -24,7 +24,7 @@
using System.Text;
using System.Windows.Forms;
-namespace AgateMDX
+namespace AgateSDX
{
public partial class frmFullScreen : Form
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-05-20 03:43:23
|
Revision: 996
http://agate.svn.sourceforge.net/agate/?rev=996&view=rev
Author: kanato
Date: 2009-05-20 03:43:15 +0000 (Wed, 20 May 2009)
Log Message:
-----------
SDX_Display: mark vsync as obsolete.
Remove references to VertexFormat.
Modified Paths:
--------------
branches/agate3d-3.2/Drivers/AgateSDX/D3DDevice.cs
branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs
branches/agate3d-3.2/Drivers/AgateSDX/SDX_VertexBuffer.cs
Modified: branches/agate3d-3.2/Drivers/AgateSDX/D3DDevice.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/D3DDevice.cs 2009-05-20 03:37:24 UTC (rev 995)
+++ branches/agate3d-3.2/Drivers/AgateSDX/D3DDevice.cs 2009-05-20 03:43:15 UTC (rev 996)
@@ -159,18 +159,6 @@
{
get { return mDrawBuffer; }
}
- public VertexFormat VertexFormat
- {
- get { return mVertexFormat; }
- set
- {
- if (mVertexFormat != value)
- {
- mVertexFormat = value;
- mDevice.VertexFormat = value;
- }
- }
- }
public bool AlphaBlend
{
get { return mAlphaBlend; }
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs 2009-05-20 03:37:24 UTC (rev 995)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs 2009-05-20 03:43:15 UTC (rev 996)
@@ -831,6 +831,7 @@
{
mDevice.SetOrthoProjection(region);
}
+ [Obsolete]
public override void DoLighting(LightManager lights)
{
FlushDrawBuffer();
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_VertexBuffer.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_VertexBuffer.cs 2009-05-20 03:37:24 UTC (rev 995)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_VertexBuffer.cs 2009-05-20 03:43:15 UTC (rev 996)
@@ -201,7 +201,6 @@
mDisplay.D3D_Device.AlphaArgument1 = Direct3D.TextureArgument.Texture;
- mDisplay.D3D_Device.VertexFormat = SlimDX.Direct3D9.VertexFormat.None;
mDisplay.D3D_Device.Device.VertexDeclaration = mDeclaration;
mDisplay.D3D_Device.Device.Indices = indexbuffer.DeviceIndexBuffer;
mDisplay.D3D_Device.Device.SetStreamSource(0, mBuffer, 0, mLayout.VertexSize);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2009-08-29 00:51:31
|
Revision: 1023
http://agate.svn.sourceforge.net/agate/?rev=1023&view=rev
Author: kanato
Date: 2009-08-29 00:51:23 +0000 (Sat, 29 Aug 2009)
Log Message:
-----------
Correct matrix transpose in HLSL implementation.
Modified Paths:
--------------
branches/agate3d-3.2/Drivers/AgateSDX/HlslEffect.cs
branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs
Modified: branches/agate3d-3.2/Drivers/AgateSDX/HlslEffect.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/HlslEffect.cs 2009-08-24 18:18:38 UTC (rev 1022)
+++ branches/agate3d-3.2/Drivers/AgateSDX/HlslEffect.cs 2009-08-29 00:51:23 UTC (rev 1023)
@@ -39,7 +39,7 @@
{
var param = GetParameter(name);
- mEffect.SetValue<SlimDX.Matrix>(param.Handle, mDisplay.TransformAgateMatrix(matrix));
+ mEffect.SetValue(name, mDisplay.TransformAgateMatrix(matrix));
}
public override void SetUniform(string name, params int[] v)
Modified: branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs
===================================================================
--- branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs 2009-08-24 18:18:38 UTC (rev 1022)
+++ branches/agate3d-3.2/Drivers/AgateSDX/SDX_Display.cs 2009-08-29 00:51:23 UTC (rev 1023)
@@ -355,14 +355,14 @@
var device = mDevice.Device;
- device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, color.ToArgb(), 1.0f, 0);
+ //device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, color.ToArgb(), 1.0f, 0);
- device.Clear(ClearFlags.Target, color.ToArgb(), 0, 0);
- device.Clear(ClearFlags.ZBuffer, 0, 1.0f, 0);
+ //device.Clear(ClearFlags.Target, color.ToArgb(), 0, 0);
+ //device.Clear(ClearFlags.ZBuffer, 0, 1.0f, 0);
- System.Drawing.Rectangle[] rect = new System.Drawing.Rectangle[1];
- rect[0] = new System.Drawing.Rectangle(0, 0, 800, 600);
- device.Clear(ClearFlags.ZBuffer, color.ToArgb(), 1.0f, 0, rect);
+ //System.Drawing.Rectangle[] rect = new System.Drawing.Rectangle[1];
+ //rect[0] = new System.Drawing.Rectangle(0, 0, 800, 600);
+ //device.Clear(ClearFlags.ZBuffer, color.ToArgb(), 1.0f, 0, rect);
}
public override void Clear(Color color, Rectangle rect)
@@ -957,23 +957,23 @@
Matrix retval = new Matrix();
retval.M11 = value[0, 0];
- retval.M12 = value[1, 0];
- retval.M13 = value[2, 0];
- retval.M14 = value[3, 0];
+ retval.M21 = value[1, 0];
+ retval.M31 = value[2, 0];
+ retval.M41 = value[3, 0];
- retval.M21 = value[0, 1];
+ retval.M12 = value[0, 1];
retval.M22 = value[1, 1];
- retval.M23 = value[2, 1];
- retval.M24 = value[3, 1];
+ retval.M32 = value[2, 1];
+ retval.M42 = value[3, 1];
- retval.M31 = value[0, 2];
- retval.M32 = value[1, 2];
+ retval.M13 = value[0, 2];
+ retval.M23 = value[1, 2];
retval.M33 = value[2, 2];
- retval.M34 = value[3, 2];
+ retval.M43 = value[3, 2];
- retval.M41 = value[0, 3];
- retval.M42 = value[1, 3];
- retval.M43 = value[2, 3];
+ retval.M14 = value[0, 3];
+ retval.M24 = value[1, 3];
+ retval.M34 = value[2, 3];
retval.M44 = value[3, 3];
return retval;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|