- Added INativeIndexBuffer and INativeVertexBuffer

- All methods in Vertex and IndexBuffer now call the native methods
- Nearly all methods in Texture2D now call the native methods
This commit is contained in:
SND\AstrorEnales_cp 2012-02-19 13:41:02 +00:00
parent 9e0bdcd9dc
commit 7546ff78d0
29 changed files with 932 additions and 452 deletions

View File

@ -441,6 +441,8 @@
<Compile Include="NonXNA\RenderSystem\INativeTexture.cs" />
<Compile Include="NonXNA\RenderSystem\INativeTexture2D.cs" />
<Compile Include="NonXNA\RenderSystem\INativeEffectPass.cs" />
<Compile Include="NonXNA\RenderSystem\INativeVertexBuffer.cs" />
<Compile Include="NonXNA\RenderSystem\INativeIndexBuffer.cs" />
<Compile Include="NonXNA\RenderSystem\PreDefinedShader.cs" />
<Compile Include="NonXNA\RenderSystem\INativeBlendState.cs" />
<Compile Include="NonXNA\RenderSystem\INativeBuffer.cs" />

View File

@ -1,10 +1,7 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ANX.Framework.NonXNA;
using System.Runtime.InteropServices;
using ANX.Framework.NonXNA;
#endregion // Using Statements

View File

@ -1,12 +1,4 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ANX.Framework.NonXNA;
using ANX.Framework.Graphics;
#endregion // Using Statements
using System;
#region License
@ -57,22 +49,21 @@ using ANX.Framework.Graphics;
namespace ANX.Framework.Graphics
{
public sealed class DeviceLostException : Exception
{
public DeviceLostException()
: base()
{
}
public sealed class DeviceLostException : Exception
{
public DeviceLostException()
: base()
{
}
public DeviceLostException(string message)
: base(message)
{
}
public DeviceLostException(string message)
: base(message)
{
}
public DeviceLostException(string message, Exception innerException)
: base(message, innerException)
{
}
}
public DeviceLostException(string message, Exception innerException)
: base(message, innerException)
{
}
}
}

View File

@ -1,12 +1,4 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ANX.Framework.NonXNA;
using ANX.Framework.Graphics;
#endregion // Using Statements
using System;
#region License
@ -57,22 +49,21 @@ using ANX.Framework.Graphics;
namespace ANX.Framework.Graphics
{
public sealed class DeviceNotResetException : Exception
{
public DeviceNotResetException()
: base()
{
}
public sealed class DeviceNotResetException : Exception
{
public DeviceNotResetException()
: base()
{
}
public DeviceNotResetException(string message)
: base(message)
{
}
public DeviceNotResetException(string message)
: base(message)
{
}
public DeviceNotResetException(string message, Exception innerException)
: base(message, innerException)
{
}
}
public DeviceNotResetException(string message, Exception innerException)
: base(message, innerException)
{
}
}
}

View File

@ -1,12 +1,8 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ANX.Framework.NonXNA;
using System;
using System.Runtime.InteropServices;
#endregion // Using Statements
using ANX.Framework.NonXNA;
using ANX.Framework.NonXNA.Development;
using ANX.Framework.NonXNA.RenderSystem;
#region License
@ -57,172 +53,190 @@ using System.Runtime.InteropServices;
namespace ANX.Framework.Graphics
{
public class IndexBuffer : GraphicsResource, IGraphicsResource
{
private int indexCount;
private BufferUsage bufferUsage;
private IndexElementSize indexElementSize;
private INativeBuffer nativeIndexBuffer;
public IndexBuffer(GraphicsDevice graphicsDevice, IndexElementSize indexElementSize, int indexCount, BufferUsage usage)
: base(graphicsDevice)
{
this.indexElementSize = indexElementSize;
this.indexCount = indexCount;
this.bufferUsage = usage;
base.GraphicsDevice.ResourceCreated += GraphicsDevice_ResourceCreated;
base.GraphicsDevice.ResourceDestroyed += GraphicsDevice_ResourceDestroyed;
CreateNativeBuffer();
}
public IndexBuffer(GraphicsDevice graphicsDevice, Type indexType, int indexCount, BufferUsage usage)
: base(graphicsDevice)
{
if (indexType == typeof(int) || indexType == typeof(uint))
{
this.indexElementSize = Graphics.IndexElementSize.ThirtyTwoBits;
}
else if (indexType == typeof(short) || indexType == typeof(ushort))
{
this.indexElementSize = Graphics.IndexElementSize.SixteenBits;
}
else
{
throw new Exception("can't use IndexType " + indexType.ToString());
}
this.indexCount = indexCount;
this.bufferUsage = usage;
CreateNativeBuffer();
}
~IndexBuffer()
{
Dispose();
base.GraphicsDevice.ResourceCreated -= GraphicsDevice_ResourceCreated;
base.GraphicsDevice.ResourceDestroyed -= GraphicsDevice_ResourceDestroyed;
}
private void GraphicsDevice_ResourceDestroyed(object sender, ResourceDestroyedEventArgs e)
{
if (this.nativeIndexBuffer != null)
{
this.nativeIndexBuffer.Dispose();
this.nativeIndexBuffer = null;
}
}
private void GraphicsDevice_ResourceCreated(object sender, ResourceCreatedEventArgs e)
{
if (nativeIndexBuffer != null)
{
nativeIndexBuffer.Dispose();
nativeIndexBuffer = null;
}
CreateNativeBuffer();
}
private void CreateNativeBuffer()
{
this.nativeIndexBuffer =
AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateIndexBuffer(GraphicsDevice, this, indexElementSize, indexCount, bufferUsage);
}
public void GetData<T>(int offsetInBytes, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data) where T : struct
{
GetData<T>(0, data, 0, data.Length);
}
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
GetData<T>(0, data, startIndex, elementCount);
}
public void SetData<T>(int offsetInBytes, T[] data, int startIndex, int elementCount) where T : struct
{
if (nativeIndexBuffer == null)
{
CreateNativeBuffer();
}
this.nativeIndexBuffer.SetData<T>(GraphicsDevice, offsetInBytes, data, startIndex, elementCount);
}
public void SetData<T>(T[] data) where T : struct
{
if (nativeIndexBuffer == null)
{
CreateNativeBuffer();
}
this.nativeIndexBuffer.SetData<T>(GraphicsDevice, data);
}
public void SetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
SetData<T>(0, data, startIndex, elementCount);
}
public override void Dispose()
{
if (this.nativeIndexBuffer != null)
{
this.nativeIndexBuffer.Dispose();
this.nativeIndexBuffer = null;
}
}
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Untested)]
public class IndexBuffer : GraphicsResource, IGraphicsResource
{
#region Private
private int indexCount;
private BufferUsage bufferUsage;
private IndexElementSize indexElementSize;
private INativeIndexBuffer nativeIndexBuffer;
#endregion
#region Public
// This is now internal because via befriending the assemblies
// it's usable in the modules but doesn't confuse the enduser.
internal INativeBuffer NativeIndexBuffer
{
get
{
if (nativeIndexBuffer == null)
{
CreateNativeBuffer();
}
internal INativeIndexBuffer NativeIndexBuffer
{
get
{
if (nativeIndexBuffer == null)
{
CreateNativeBuffer();
}
return this.nativeIndexBuffer;
}
}
return this.nativeIndexBuffer;
}
}
public BufferUsage BufferUsage
{
get
{
return this.bufferUsage;
}
}
public BufferUsage BufferUsage
{
get
{
return this.bufferUsage;
}
}
public int IndexCount
{
get
{
return this.indexCount;
}
}
public int IndexCount
{
get
{
return this.indexCount;
}
}
public IndexElementSize IndexElementSize
{
get
{
return this.indexElementSize;
}
}
public IndexElementSize IndexElementSize
{
get
{
return this.indexElementSize;
}
}
#endregion
protected override void Dispose([MarshalAs(UnmanagedType.U1)] bool disposeManaged)
{
throw new NotImplementedException();
}
}
#region Constructor
public IndexBuffer(GraphicsDevice graphicsDevice, IndexElementSize indexElementSize, int indexCount, BufferUsage usage)
: base(graphicsDevice)
{
this.indexElementSize = indexElementSize;
this.indexCount = indexCount;
this.bufferUsage = usage;
base.GraphicsDevice.ResourceCreated += GraphicsDevice_ResourceCreated;
base.GraphicsDevice.ResourceDestroyed += GraphicsDevice_ResourceDestroyed;
CreateNativeBuffer();
}
public IndexBuffer(GraphicsDevice graphicsDevice, Type indexType, int indexCount, BufferUsage usage)
: base(graphicsDevice)
{
if (indexType == typeof(int) ||
indexType == typeof(uint))
{
this.indexElementSize = IndexElementSize.ThirtyTwoBits;
}
else if (indexType == typeof(short) ||
indexType == typeof(ushort))
{
this.indexElementSize = IndexElementSize.SixteenBits;
}
else
{
throw new Exception("can't use IndexType " + indexType.ToString());
}
this.indexCount = indexCount;
this.bufferUsage = usage;
CreateNativeBuffer();
}
~IndexBuffer()
{
Dispose();
base.GraphicsDevice.ResourceCreated -= GraphicsDevice_ResourceCreated;
base.GraphicsDevice.ResourceDestroyed -= GraphicsDevice_ResourceDestroyed;
}
#endregion
#region GraphicsDevice_ResourceDestroyed
private void GraphicsDevice_ResourceDestroyed(object sender, ResourceDestroyedEventArgs e)
{
if (this.nativeIndexBuffer != null)
{
this.nativeIndexBuffer.Dispose();
this.nativeIndexBuffer = null;
}
}
#endregion
#region GraphicsDevice_ResourceCreated
private void GraphicsDevice_ResourceCreated(object sender, ResourceCreatedEventArgs e)
{
if (nativeIndexBuffer != null)
{
nativeIndexBuffer.Dispose();
nativeIndexBuffer = null;
}
CreateNativeBuffer();
}
#endregion
#region CreateNativeBuffer
private void CreateNativeBuffer()
{
this.nativeIndexBuffer =
AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateIndexBuffer(GraphicsDevice, this, indexElementSize, indexCount, bufferUsage);
}
#endregion
#region GetData
public void GetData<T>(int offsetInBytes, T[] data, int startIndex,
int elementCount) where T : struct
{
NativeIndexBuffer.GetData(offsetInBytes, data, startIndex, elementCount);
}
public void GetData<T>(T[] data) where T : struct
{
NativeIndexBuffer.GetData(data);
}
public void GetData<T>(T[] data, int startIndex, int elementCount)
where T : struct
{
NativeIndexBuffer.GetData(data, startIndex, elementCount);
}
#endregion
#region SetData
public void SetData<T>(int offsetInBytes, T[] data, int startIndex,
int elementCount) where T : struct
{
NativeIndexBuffer.SetData(GraphicsDevice, offsetInBytes, data,
startIndex, elementCount);
}
public void SetData<T>(T[] data) where T : struct
{
NativeIndexBuffer.SetData(GraphicsDevice, data);
}
public void SetData<T>(T[] data, int startIndex, int elementCount)
where T : struct
{
NativeIndexBuffer.SetData(GraphicsDevice, data, startIndex, elementCount);
}
#endregion
#region Dispose
public override void Dispose()
{
Dispose(true);
}
protected override void Dispose(
[MarshalAs(UnmanagedType.U1)] bool disposeManaged)
{
if (this.nativeIndexBuffer != null)
{
this.nativeIndexBuffer.Dispose();
this.nativeIndexBuffer = null;
}
}
#endregion
}
}

View File

@ -1,9 +1,9 @@
#region Using Statements
using System;
using System.IO;
using ANX.Framework.NonXNA.RenderSystem;
using ANX.Framework.NonXNA;
using System.Runtime.InteropServices;
using ANX.Framework.NonXNA;
using ANX.Framework.NonXNA.RenderSystem;
#endregion // Using Statements
@ -63,6 +63,18 @@ namespace ANX.Framework.Graphics
protected internal int height;
private INativeTexture2D nativeTexture2D;
private INativeTexture2D NativeTexture2D
{
get
{
if (nativeTexture2D == null)
{
CreateNativeTextureSurface();
}
return nativeTexture2D;
}
}
#endregion
#region Public
@ -91,7 +103,7 @@ namespace ANX.Framework.Graphics
}
#endregion
#region Constructor
#region Constructor (TODO)
internal Texture2D(GraphicsDevice graphicsDevice)
: base(graphicsDevice)
{
@ -109,7 +121,8 @@ namespace ANX.Framework.Graphics
CreateNativeTextureSurface();
}
public Texture2D(GraphicsDevice graphicsDevice, int width, int height, [MarshalAsAttribute(UnmanagedType.U1)] bool mipMap, SurfaceFormat format)
public Texture2D(GraphicsDevice graphicsDevice, int width, int height,
[MarshalAsAttribute(UnmanagedType.U1)] bool mipMap, SurfaceFormat format)
: base(graphicsDevice)
{
this.width = width;
@ -123,38 +136,43 @@ namespace ANX.Framework.Graphics
#endregion
#region FromStream (TODO)
public static Texture2D FromStream(GraphicsDevice graphicsDevice, Stream stream)
public static Texture2D FromStream(GraphicsDevice graphicsDevice,
Stream stream)
{
throw new NotImplementedException();
}
public static Texture2D FromStream(GraphicsDevice graphicsDevice, Stream stream, int width, int height, [MarshalAsAttribute(UnmanagedType.U1)] bool zoom)
public static Texture2D FromStream(GraphicsDevice graphicsDevice,
Stream stream, int width, int height,
[MarshalAsAttribute(UnmanagedType.U1)] bool zoom)
{
throw new NotImplementedException();
}
#endregion
#region GetData (TODO)
public void GetData<T>(int level, Nullable<Rectangle> rect, T[] data, int startIndex, int elementCount) where T : struct
#region GetData
public void GetData<T>(int level, Nullable<Rectangle> rect, T[] data,
int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
NativeTexture2D.GetData(level, rect, data, startIndex, elementCount);
}
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
{
NativeTexture.GetData(data);
}
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
NativeTexture.GetData(data, startIndex, elementCount);
}
#endregion
#region SetData (TODO)
public void SetData<T>(int level, Nullable<Rectangle> rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
#region SetData
public void SetData<T>(int level, Nullable<Rectangle> rect, T[] data,
int startIndex, int elementCount) where T : struct
{
NativeTexture2D.SetData(level, rect, data, startIndex, elementCount);
}
public void SetData<T>(T[] data) where T : struct
@ -171,14 +189,14 @@ namespace ANX.Framework.Graphics
#region SaveAsJpeg
public void SaveAsJpeg(Stream stream, int width, int height)
{
nativeTexture2D.SaveAsJpeg(stream, width, height);
NativeTexture2D.SaveAsJpeg(stream, width, height);
}
#endregion
#region SaveAsPng
public void SaveAsPng(Stream stream, int width, int height)
{
nativeTexture2D.SaveAsPng(stream, width, height);
NativeTexture2D.SaveAsPng(stream, width, height);
}
#endregion

View File

@ -1,9 +1,8 @@
#region Using Statements
using System;
using System;
using System.Runtime.InteropServices;
using ANX.Framework.NonXNA;
#endregion // Using Statements
using ANX.Framework.NonXNA.Development;
using ANX.Framework.NonXNA.RenderSystem;
#region License
@ -54,183 +53,192 @@ using ANX.Framework.NonXNA;
namespace ANX.Framework.Graphics
{
public class VertexBuffer : GraphicsResource, IGraphicsResource
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Untested)]
public class VertexBuffer : GraphicsResource, IGraphicsResource
{
#region Private
private VertexDeclaration vertexDeclaration;
private int vertexCount;
private BufferUsage bufferUsage;
private INativeVertexBuffer nativeVertexBuffer;
#endregion
#region Public
// This is now internal because via befriending the assemblies
// it's usable in the modules but doesn't confuse the enduser.
internal INativeVertexBuffer NativeVertexBuffer
{
#region Private
private VertexDeclaration vertexDeclaration;
private int vertexCount;
private BufferUsage bufferUsage;
private INativeBuffer nativeVertexBuffer;
#endregion
#region Constructor
// This is now internal because via befriending the assemblies
// it's usable in the modules but doesn't confuse the enduser.
internal INativeBuffer NativeVertexBuffer
get
{
if (this.nativeVertexBuffer == null)
{
get
{
if (this.nativeVertexBuffer == null)
{
CreateNativeBuffer();
}
return this.nativeVertexBuffer;
}
CreateNativeBuffer();
}
public BufferUsage BufferUsage
{
get
{
return this.bufferUsage;
}
}
return this.nativeVertexBuffer;
}
}
public int VertexCount
{
get
{
return this.vertexCount;
}
}
public BufferUsage BufferUsage
{
get
{
return this.bufferUsage;
}
}
public VertexDeclaration VertexDeclaration
{
get
{
return this.vertexDeclaration;
}
}
#endregion
public int VertexCount
{
get
{
return this.vertexCount;
}
}
#region Constructor
public VertexBuffer(GraphicsDevice graphicsDevice, Type vertexType, int vertexCount, BufferUsage usage)
: this(graphicsDevice, VertexBuffer.TypeToVertexDeclaration(vertexType), vertexCount, usage)
{
}
public VertexDeclaration VertexDeclaration
{
get
{
return this.vertexDeclaration;
}
}
#endregion
public VertexBuffer(GraphicsDevice graphicsDevice, VertexDeclaration vertexDeclaration, int vertexCount, BufferUsage usage)
: base(graphicsDevice)
{
this.vertexCount = vertexCount;
this.vertexDeclaration = vertexDeclaration;
this.bufferUsage = usage;
#region Constructor
public VertexBuffer(GraphicsDevice graphicsDevice, Type vertexType,
int vertexCount, BufferUsage usage)
: this(graphicsDevice, VertexBuffer.TypeToVertexDeclaration(vertexType),
vertexCount, usage)
{
}
base.GraphicsDevice.ResourceCreated += GraphicsDevice_ResourceCreated;
base.GraphicsDevice.ResourceDestroyed += GraphicsDevice_ResourceDestroyed;
public VertexBuffer(GraphicsDevice graphicsDevice,
VertexDeclaration vertexDeclaration, int vertexCount, BufferUsage usage)
: base(graphicsDevice)
{
this.vertexCount = vertexCount;
this.vertexDeclaration = vertexDeclaration;
this.bufferUsage = usage;
CreateNativeBuffer();
}
base.GraphicsDevice.ResourceCreated += GraphicsDevice_ResourceCreated;
base.GraphicsDevice.ResourceDestroyed += GraphicsDevice_ResourceDestroyed;
~VertexBuffer()
{
Dispose();
base.GraphicsDevice.ResourceCreated -= GraphicsDevice_ResourceCreated;
base.GraphicsDevice.ResourceDestroyed -= GraphicsDevice_ResourceDestroyed;
}
#endregion
CreateNativeBuffer();
}
#region GraphicsDevice_ResourceDestroyed
private void GraphicsDevice_ResourceDestroyed(object sender, ResourceDestroyedEventArgs e)
{
if (nativeVertexBuffer != null)
{
nativeVertexBuffer.Dispose();
nativeVertexBuffer = null;
}
}
#endregion
~VertexBuffer()
{
Dispose();
base.GraphicsDevice.ResourceCreated -= GraphicsDevice_ResourceCreated;
base.GraphicsDevice.ResourceDestroyed -= GraphicsDevice_ResourceDestroyed;
}
#endregion
#region GraphicsDevice_ResourceCreated
private void GraphicsDevice_ResourceCreated(object sender, ResourceCreatedEventArgs e)
{
if (nativeVertexBuffer != null)
{
nativeVertexBuffer.Dispose();
nativeVertexBuffer = null;
}
#region GraphicsDevice_ResourceDestroyed
private void GraphicsDevice_ResourceDestroyed(object sender, ResourceDestroyedEventArgs e)
{
if (nativeVertexBuffer != null)
{
nativeVertexBuffer.Dispose();
nativeVertexBuffer = null;
}
}
#endregion
CreateNativeBuffer();
}
#endregion
#region GraphicsDevice_ResourceCreated
private void GraphicsDevice_ResourceCreated(object sender, ResourceCreatedEventArgs e)
{
if (nativeVertexBuffer != null)
{
nativeVertexBuffer.Dispose();
nativeVertexBuffer = null;
}
#region CreateNativeBuffer
private void CreateNativeBuffer()
{
this.nativeVertexBuffer =
AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateVertexBuffer(GraphicsDevice, this, vertexDeclaration, vertexCount, bufferUsage);
}
#endregion
CreateNativeBuffer();
}
#endregion
#region GetData
public void GetData<T>(int offsetInBytes, T[] data, int startIndex, int elementCount, int vertexStride) where T : struct
{
throw new NotImplementedException();
}
#region CreateNativeBuffer
private void CreateNativeBuffer()
{
this.nativeVertexBuffer =
AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateVertexBuffer(GraphicsDevice, this, vertexDeclaration, vertexCount, bufferUsage);
}
#endregion
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
#region GetData
public void GetData<T>(int offsetInBytes, T[] data, int startIndex,
int elementCount, int vertexStride) where T : struct
{
NativeVertexBuffer.GetData(offsetInBytes, data, startIndex,
elementCount, vertexStride);
}
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
public void GetData<T>(T[] data) where T : struct
{
NativeVertexBuffer.GetData(data);
}
#region SetData
public void SetData<T>(int offsetInBytes, T[] data, int startIndex, int elementCount, int vertexStride) where T : struct
{
//NativeVertexBuffer.SetData(GraphicsDevice, offsetInBytes, data, startIndex, elementCount, vertexStride);
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount)
where T : struct
{
NativeVertexBuffer.GetData(data, startIndex, elementCount);
}
#endregion
public void SetData<T>(T[] data) where T : struct
{
NativeVertexBuffer.SetData(GraphicsDevice, data);
}
#region SetData
public void SetData<T>(int offsetInBytes, T[] data, int startIndex,
int elementCount, int vertexStride) where T : struct
{
NativeVertexBuffer.SetData(GraphicsDevice, offsetInBytes, data,
startIndex, elementCount, vertexStride);
}
public void SetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
NativeVertexBuffer.SetData(GraphicsDevice, data, startIndex, elementCount);
}
#endregion
public void SetData<T>(T[] data) where T : struct
{
NativeVertexBuffer.SetData(GraphicsDevice, data);
}
#region TypeToVertexDeclaration
private static VertexDeclaration TypeToVertexDeclaration(Type t)
{
IVertexType vt = Activator.CreateInstance(t) as IVertexType;
if (vt != null)
{
return vt.VertexDeclaration;
}
public void SetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
NativeVertexBuffer.SetData(GraphicsDevice, data, startIndex, elementCount);
}
#endregion
return null;
}
#endregion
#region TypeToVertexDeclaration
private static VertexDeclaration TypeToVertexDeclaration(Type t)
{
IVertexType vt = Activator.CreateInstance(t) as IVertexType;
if (vt != null)
{
return vt.VertexDeclaration;
}
#region Dispose
public override void Dispose()
{
if (nativeVertexBuffer != null)
{
nativeVertexBuffer.Dispose();
nativeVertexBuffer = null;
}
return null;
}
#endregion
if (vertexDeclaration != null)
{
// do not dispose the VertexDeclaration here, because it's only a reference
vertexDeclaration = null;
}
}
#region Dispose
public override void Dispose()
{
if (nativeVertexBuffer != null)
{
nativeVertexBuffer.Dispose();
nativeVertexBuffer = null;
}
protected override void Dispose([MarshalAs(UnmanagedType.U1)] bool disposeManaged)
{
throw new NotImplementedException();
}
#endregion
}
if (vertexDeclaration != null)
{
// do not dispose the VertexDeclaration here, because it's only a reference
vertexDeclaration = null;
}
}
protected override void Dispose([MarshalAs(UnmanagedType.U1)] bool disposeManaged)
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@ -1,9 +1,6 @@
#region Using Statements
using System;
using System;
using ANX.Framework.Graphics;
#endregion // Using Statements
#region License
//
@ -51,12 +48,17 @@ using ANX.Framework.Graphics;
#endregion // License
namespace ANX.Framework.NonXNA
namespace ANX.Framework.NonXNA.RenderSystem
{
public interface INativeBuffer : IDisposable
{
void SetData<T>(GraphicsDevice graphicsDevice, T[] data) where T : struct;
void SetData<T>(GraphicsDevice graphicsDevice, T[] data, int startIndex, int elementCount) where T : struct;
void SetData<T>(GraphicsDevice graphicsDevice, int offsetInBytes, T[] data, int startIndex, int elementCount) where T : struct;
}
public interface INativeBuffer : IDisposable
{
void SetData<T>(GraphicsDevice graphicsDevice, T[] data) where T : struct;
void SetData<T>(GraphicsDevice graphicsDevice, T[] data, int startIndex,
int elementCount) where T : struct;
void SetData<T>(GraphicsDevice graphicsDevice, int offsetInBytes, T[] data,
int startIndex, int elementCount) where T : struct;
void GetData<T>(T[] data) where T : struct;
void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct;
}
}

View File

@ -0,0 +1,58 @@
using System;
using System.IO;
#region License
//
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
//
// This file is released under the Ms-PL license.
//
//
//
// Microsoft Public License (Ms-PL)
//
// This license governs use of the accompanying software. If you use the software, you accept this license.
// If you do not accept the license, do not use the software.
//
// 1.Definitions
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
// here as under U.S. copyright law.
// A "contribution" is the original software, or any additions or changes to the software.
// A "contributor" is any person that distributes its contribution under this license.
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
//
// 2.Grant of Rights
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
// or any derivative works that you create.
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
// in the software or derivative works of the contribution in the software.
//
// 3.Conditions and Limitations
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
// patent license from such contributor to the software ends automatically.
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
// notices that are present in the software.
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
// object code form, you may only do so under a license that complies with this license.
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
// particular purpose and non-infringement.
#endregion // License
namespace ANX.Framework.NonXNA.RenderSystem
{
public interface INativeIndexBuffer : INativeBuffer
{
void GetData<T>(int offsetInBytes, T[] data, int startIndex,
int elementCount) where T : struct;
}
}

View File

@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;
#region License
@ -53,5 +54,11 @@ namespace ANX.Framework.NonXNA.RenderSystem
{
void SaveAsJpeg(Stream stream, int width, int height);
void SaveAsPng(Stream stream, int width, int height);
void GetData<T>(int level, Nullable<Rectangle> rect, T[] data,
int startIndex, int elementCount) where T : struct;
void SetData<T>(int level, Nullable<Rectangle> rect, T[] data,
int startIndex, int elementCount) where T : struct;
}
}

View File

@ -0,0 +1,62 @@
using System;
using System.IO;
using ANX.Framework.Graphics;
#region License
//
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
//
// This file is released under the Ms-PL license.
//
//
//
// Microsoft Public License (Ms-PL)
//
// This license governs use of the accompanying software. If you use the software, you accept this license.
// If you do not accept the license, do not use the software.
//
// 1.Definitions
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
// here as under U.S. copyright law.
// A "contribution" is the original software, or any additions or changes to the software.
// A "contributor" is any person that distributes its contribution under this license.
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
//
// 2.Grant of Rights
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
// or any derivative works that you create.
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
// in the software or derivative works of the contribution in the software.
//
// 3.Conditions and Limitations
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
// patent license from such contributor to the software ends automatically.
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
// notices that are present in the software.
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
// object code form, you may only do so under a license that complies with this license.
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
// particular purpose and non-infringement.
#endregion // License
namespace ANX.Framework.NonXNA.RenderSystem
{
public interface INativeVertexBuffer : INativeBuffer
{
void GetData<T>(int offsetInBytes, T[] data, int startIndex, int elementCount,
int vertexStride) where T : struct;
void SetData<T>(GraphicsDevice graphicsDevice, int offsetInBytes, T[] data,
int startIndex, int elementCount, int vertexStride) where T : struct;
}
}

View File

@ -1,9 +1,7 @@
#region Using Statements
using System;
using ANX.Framework.Graphics;
using System.IO;
using ANX.Framework.NonXNA;
using System.Collections.ObjectModel;
using System.IO;
using ANX.Framework.Graphics;
using ANX.Framework.NonXNA.RenderSystem;
#endregion // Using Statements
@ -61,18 +59,29 @@ namespace ANX.Framework.NonXNA
{
GameHost CreateGameHost(Game game);
INativeGraphicsDevice CreateGraphicsDevice(PresentationParameters presentationParameters);
INativeGraphicsDevice CreateGraphicsDevice(
PresentationParameters presentationParameters);
INativeTexture2D CreateTexture(GraphicsDevice graphics, SurfaceFormat surfaceFormat, int width, int height, int mipCount);
INativeTexture2D CreateTexture(GraphicsDevice graphics,
SurfaceFormat surfaceFormat, int width, int height, int mipCount);
INativeRenderTarget2D CreateRenderTarget(GraphicsDevice graphics, int width, int height, bool mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage);
INativeRenderTarget2D CreateRenderTarget(GraphicsDevice graphics,
int width, int height, bool mipMap, SurfaceFormat preferredFormat,
DepthFormat preferredDepthFormat, int preferredMultiSampleCount,
RenderTargetUsage usage);
INativeBuffer CreateIndexBuffer(GraphicsDevice graphics, IndexBuffer managedBuffer, IndexElementSize size, int indexCount, BufferUsage usage);
INativeIndexBuffer CreateIndexBuffer(GraphicsDevice graphics,
IndexBuffer managedBuffer, IndexElementSize size, int indexCount,
BufferUsage usage);
INativeBuffer CreateVertexBuffer(GraphicsDevice graphics, VertexBuffer managedBuffer, VertexDeclaration vertexDeclaration, int vertexCount, BufferUsage usage);
INativeVertexBuffer CreateVertexBuffer(GraphicsDevice graphics,
VertexBuffer managedBuffer, VertexDeclaration vertexDeclaration,
int vertexCount, BufferUsage usage);
INativeEffect CreateEffect(GraphicsDevice graphics, Effect managedEffect, Stream byteCode);
INativeEffect CreateEffect(GraphicsDevice graphics, Effect managedEffect, Stream vertexShaderByteCode, Stream pixelShaderByteCode);
INativeEffect CreateEffect(GraphicsDevice graphics, Effect managedEffect,
Stream byteCode);
INativeEffect CreateEffect(GraphicsDevice graphics, Effect managedEffect,
Stream vertexShaderByteCode, Stream pixelShaderByteCode);
INativeBlendState CreateBlendState();
INativeRasterizerState CreateRasterizerState();

View File

@ -1,9 +1,4 @@
#region Using Statements
using System;
#endregion // Using Statements
#region License
#region License
//
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".

View File

@ -96,7 +96,7 @@ namespace ANX.Framework.Windows.DX10
return new GraphicsDeviceWindowsDX10(presentationParameters);
}
public INativeBuffer CreateIndexBuffer(GraphicsDevice graphics,
public INativeIndexBuffer CreateIndexBuffer(GraphicsDevice graphics,
IndexBuffer managedBuffer, IndexElementSize size, int indexCount, BufferUsage usage)
{
AddInSystemFactory.Instance.PreventSystemChange(
@ -104,7 +104,7 @@ namespace ANX.Framework.Windows.DX10
return new IndexBuffer_DX10(graphics, size, indexCount, usage);
}
public INativeBuffer CreateVertexBuffer(GraphicsDevice graphics,
public INativeVertexBuffer CreateVertexBuffer(GraphicsDevice graphics,
VertexBuffer managedBuffer, VertexDeclaration vertexDeclaration, int vertexCount, BufferUsage usage)
{
AddInSystemFactory.Instance.PreventSystemChange(

View File

@ -7,6 +7,7 @@ using ANX.Framework.NonXNA;
using SharpDX.Direct3D10;
using ANX.Framework.Graphics;
using System.Runtime.InteropServices;
using ANX.Framework.NonXNA.RenderSystem;
#endregion // Using Statements
@ -59,7 +60,7 @@ using System.Runtime.InteropServices;
namespace ANX.Framework.Windows.DX10
{
public class IndexBuffer_DX10 : INativeBuffer, IDisposable
public class IndexBuffer_DX10 : INativeIndexBuffer, IDisposable
{
private SharpDX.Direct3D10.Buffer buffer;
private IndexElementSize size;
@ -163,5 +164,29 @@ namespace ANX.Framework.Windows.DX10
buffer = null;
}
}
}
#region INativeIndexBuffer Member
public void GetData<T>(int offsetInBytes, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
#region INativeBuffer Member
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@ -326,5 +326,35 @@ namespace ANX.Framework.Windows.DX10
throw new NotImplementedException();
}
#endregion
}
#region INativeTexture2D Member
public void GetData<T>(int level, Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void SetData<T>(int level, Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
#region INativeBuffer Member
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@ -7,6 +7,7 @@ using ANX.Framework.NonXNA;
using SharpDX.Direct3D10;
using ANX.Framework.Graphics;
using System.Runtime.InteropServices;
using ANX.Framework.NonXNA.RenderSystem;
#endregion // Using Statements
@ -59,7 +60,7 @@ using System.Runtime.InteropServices;
namespace ANX.Framework.Windows.DX10
{
public class VertexBuffer_DX10 : INativeBuffer, IDisposable
public class VertexBuffer_DX10 : INativeVertexBuffer, IDisposable
{
SharpDX.Direct3D10.Buffer buffer;
int vertexStride;
@ -164,5 +165,34 @@ namespace ANX.Framework.Windows.DX10
buffer = null;
}
}
}
#region INativeVertexBuffer Member
public void GetData<T>(int offsetInBytes, T[] data, int startIndex, int elementCount, int vertexStride) where T : struct
{
throw new NotImplementedException();
}
public void SetData<T>(GraphicsDevice graphicsDevice, int offsetInBytes, T[] data, int startIndex, int elementCount, int vertexStride) where T : struct
{
throw new NotImplementedException();
}
#endregion
#region INativeBuffer Member
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@ -172,7 +172,7 @@ namespace ANX.Framework.Windows.GL3
/// </param>
/// <param name="usage">The usage type of the buffer.</param>
/// <returns>Native OpenGL index buffer.</returns>
public INativeBuffer CreateIndexBuffer(GraphicsDevice graphics,
public INativeIndexBuffer CreateIndexBuffer(GraphicsDevice graphics,
IndexBuffer managedBuffer, IndexElementSize size, int indexCount,
BufferUsage usage)
{
@ -191,7 +191,7 @@ namespace ANX.Framework.Windows.GL3
/// </param>
/// <param name="usage">The usage type of the buffer.</param>
/// <returns>Native OpenGL vertex buffer.</returns>
public INativeBuffer CreateVertexBuffer(GraphicsDevice graphics,
public INativeVertexBuffer CreateVertexBuffer(GraphicsDevice graphics,
VertexBuffer managedBuffer, VertexDeclaration vertexDeclaration,
int vertexCount, BufferUsage usage)
{

View File

@ -1,6 +1,6 @@
using System;
using ANX.Framework.Graphics;
using ANX.Framework.NonXNA;
using ANX.Framework.NonXNA.RenderSystem;
using ANX.Framework.Windows.GL3.Helpers;
using OpenTK.Graphics.OpenGL;
@ -56,7 +56,7 @@ namespace ANX.Framework.Windows.GL3
/// <summary>
/// Native OpenGL implementation of a Index Buffer.
/// </summary>
public class IndexBufferGL3 : INativeBuffer
public class IndexBufferGL3 : INativeIndexBuffer
{
#region Private
private IndexBuffer managedBuffer;
@ -188,6 +188,25 @@ namespace ANX.Framework.Windows.GL3
}
#endregion
#region GetData (TODO)
public void GetData<T>(int offsetInBytes, T[] data, int startIndex,
int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount)
where T : struct
{
throw new NotImplementedException();
}
#endregion
#region BufferData (private helper)
private void BufferData<T>(T[] data, int offset) where T : struct
{

View File

@ -276,6 +276,31 @@ namespace ANX.Framework.Windows.GL3
}
#endregion
#region GetData (TODO)
public void GetData<T>(int level, Rectangle? rect, T[] data, int startIndex,
int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void SetData<T>(int level, Rectangle? rect, T[] data, int startIndex,
int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount)
where T : struct
{
throw new NotImplementedException();
}
#endregion
#region GetTextureData
private void GetTextureData()
{

View File

@ -1,6 +1,6 @@
using System;
using ANX.Framework.Graphics;
using ANX.Framework.NonXNA;
using ANX.Framework.NonXNA.RenderSystem;
using ANX.Framework.Windows.GL3.Helpers;
using OpenTK.Graphics.OpenGL;
@ -59,7 +59,7 @@ namespace ANX.Framework.Windows.GL3
/// Great tutorial about VBO/IBO directly for OpenTK:
/// http://www.opentk.com/doc/graphics/geometry/vertex-buffer-objects
/// </summary>
public class VertexBufferGL3 : INativeBuffer
public class VertexBufferGL3 : INativeVertexBuffer
{
#region Private
private VertexBuffer managedBuffer;
@ -191,6 +191,33 @@ namespace ANX.Framework.Windows.GL3
}
#endregion
#region SetData (TODO)
public void SetData<T>(GraphicsDevice graphicsDevice, int offsetInBytes,
T[] data, int startIndex, int elementCount, int vertexStride) where T : struct
{
throw new NotImplementedException();
}
#endregion
#region GetData (TODO)
public void GetData<T>(int offsetInBytes, T[] data, int startIndex,
int elementCount, int vertexStride) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount)
where T : struct
{
throw new NotImplementedException();
}
#endregion
#region BufferData (private helper)
private void BufferData<T>(T[] data, int offset) where T : struct
{

View File

@ -97,7 +97,7 @@ namespace ANX.RenderSystem.Windows.DX11
return new GraphicsDeviceWindowsDX11(presentationParameters);
}
public INativeBuffer CreateIndexBuffer(GraphicsDevice graphics,
public INativeIndexBuffer CreateIndexBuffer(GraphicsDevice graphics,
IndexBuffer managedBuffer, IndexElementSize size, int indexCount, BufferUsage usage)
{
AddInSystemFactory.Instance.PreventSystemChange(
@ -105,7 +105,7 @@ namespace ANX.RenderSystem.Windows.DX11
return new IndexBuffer_DX11(graphics, size, indexCount, usage);
}
public INativeBuffer CreateVertexBuffer(GraphicsDevice graphics,
public INativeVertexBuffer CreateVertexBuffer(GraphicsDevice graphics,
VertexBuffer managedBuffer, VertexDeclaration vertexDeclaration, int vertexCount, BufferUsage usage)
{
AddInSystemFactory.Instance.PreventSystemChange(AddInType.RenderSystem);

View File

@ -7,6 +7,7 @@ using ANX.Framework.NonXNA;
using SharpDX.Direct3D11;
using ANX.Framework.Graphics;
using System.Runtime.InteropServices;
using ANX.Framework.NonXNA.RenderSystem;
#endregion // Using Statements
@ -59,7 +60,7 @@ using System.Runtime.InteropServices;
namespace ANX.RenderSystem.Windows.DX11
{
public class IndexBuffer_DX11 : INativeBuffer, IDisposable
public class IndexBuffer_DX11 : INativeIndexBuffer, IDisposable
{
private SharpDX.Direct3D11.Buffer buffer;
private IndexElementSize size;
@ -164,5 +165,29 @@ namespace ANX.RenderSystem.Windows.DX11
buffer = null;
}
}
}
#region INativeIndexBuffer Member
public void GetData<T>(int offsetInBytes, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
#region INativeBuffer Member
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@ -326,5 +326,35 @@ namespace ANX.RenderSystem.Windows.DX11
throw new NotImplementedException();
}
#endregion
}
#region INativeTexture2D Member
public void GetData<T>(int level, Framework.Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void SetData<T>(int level, Framework.Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
#region INativeBuffer Member
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@ -7,6 +7,7 @@ using ANX.Framework.NonXNA;
using SharpDX.Direct3D11;
using ANX.Framework.Graphics;
using System.Runtime.InteropServices;
using ANX.Framework.NonXNA.RenderSystem;
#endregion // Using Statements
@ -59,7 +60,7 @@ using System.Runtime.InteropServices;
namespace ANX.RenderSystem.Windows.DX11
{
public class VertexBuffer_DX11 : INativeBuffer, IDisposable
public class VertexBuffer_DX11 : INativeVertexBuffer, IDisposable
{
SharpDX.Direct3D11.Buffer buffer;
int vertexStride;
@ -165,5 +166,34 @@ namespace ANX.RenderSystem.Windows.DX11
buffer = null;
}
}
}
#region INativeVertexBuffer Member
public void GetData<T>(int offsetInBytes, T[] data, int startIndex, int elementCount, int vertexStride) where T : struct
{
throw new NotImplementedException();
}
public void SetData<T>(GraphicsDevice graphicsDevice, int offsetInBytes, T[] data, int startIndex, int elementCount, int vertexStride) where T : struct
{
throw new NotImplementedException();
}
#endregion
#region INativeBuffer Member
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@ -92,13 +92,13 @@ namespace ANX.Framework.Windows.DX10
return new GraphicsDeviceWindowsDX10(presentationParameters);
}
public INativeBuffer CreateIndexBuffer(GraphicsDevice graphics,
public INativeIndexBuffer CreateIndexBuffer(GraphicsDevice graphics,
IndexBuffer managedBuffer, IndexElementSize size, int indexCount, BufferUsage usage)
{
return new IndexBuffer_DX10(graphics, size, indexCount, usage);
}
public INativeBuffer CreateVertexBuffer(GraphicsDevice graphics,
public INativeVertexBuffer CreateVertexBuffer(GraphicsDevice graphics,
VertexBuffer managedBuffer, VertexDeclaration vertexDeclaration, int vertexCount, BufferUsage usage)
{
return new VertexBuffer_DX10(graphics, vertexDeclaration, vertexCount, usage);

View File

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using ANX.Framework.NonXNA;
using ANX.Framework.NonXNA.RenderSystem;
using SharpDX.Direct3D10;
using ANX.Framework.Graphics;
using System.Runtime.InteropServices;
@ -59,7 +60,7 @@ using System.Runtime.InteropServices;
namespace ANX.Framework.Windows.DX10
{
public class IndexBuffer_DX10 : INativeBuffer, IDisposable
public class IndexBuffer_DX10 : INativeIndexBuffer, IDisposable
{
private SharpDX.Direct3D10.Buffer buffer;
private IndexElementSize size;
@ -148,6 +149,30 @@ namespace ANX.Framework.Windows.DX10
buffer.Dispose();
buffer = null;
}
}
}
#region INativeIndexBuffer Member
public void GetData<T>(int offsetInBytes, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
#region INativeBuffer Member
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@ -326,5 +326,35 @@ namespace ANX.Framework.Windows.DX10
throw new NotImplementedException();
}
#endregion
#region INativeTexture2D Member
public void GetData<T>(int level, Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void SetData<T>(int level, Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
#region INativeBuffer Member
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using ANX.Framework.NonXNA;
using ANX.Framework.NonXNA.RenderSystem;
using SharpDX.Direct3D10;
using ANX.Framework.Graphics;
using System.Runtime.InteropServices;
@ -59,7 +60,7 @@ using System.Runtime.InteropServices;
namespace ANX.Framework.Windows.DX10
{
public class VertexBuffer_DX10 : INativeBuffer, IDisposable
public class VertexBuffer_DX10 : INativeVertexBuffer, IDisposable
{
SharpDX.Direct3D10.Buffer buffer;
int vertexStride;
@ -153,6 +154,35 @@ namespace ANX.Framework.Windows.DX10
buffer.Dispose();
buffer = null;
}
}
}
#region INativeVertexBuffer Member
public void GetData<T>(int offsetInBytes, T[] data, int startIndex, int elementCount, int vertexStride) where T : struct
{
throw new NotImplementedException();
}
public void SetData<T>(GraphicsDevice graphicsDevice, int offsetInBytes, T[] data, int startIndex, int elementCount, int vertexStride) where T : struct
{
throw new NotImplementedException();
}
#endregion
#region INativeBuffer Member
public void GetData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
#endregion
}
}