some more work on GraphicsDevice

prepared GetData for BackBuffer and native hardware buffers
This commit is contained in:
Glatzemann 2011-11-07 14:53:33 +00:00
parent 72c4ddff1c
commit 1efaa0a111
11 changed files with 149 additions and 11 deletions

View File

@ -333,5 +333,21 @@ namespace ANX.Framework.Windows.DX10
{
throw new NotImplementedException();
}
}
public void GetBackBufferData<T>(Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
}
}

View File

@ -139,5 +139,21 @@ namespace ANX.Framework.Windows.DX10
}
}
public void GetBackBufferData<T>(Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
}
}

View File

@ -143,5 +143,21 @@ namespace ANX.Framework.Windows.DX10
buffer = null;
}
}
public void GetBackBufferData<T>(Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
}
}

View File

@ -223,5 +223,21 @@ namespace ANX.Framework.Windows.GL3
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
}
}

View File

@ -166,5 +166,21 @@ namespace ANX.Framework.Windows.GL3
GL.DeleteBuffers(1, ref bufferHandle);
}
#endregion
}
public void GetBackBufferData<T>(Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
}
}

View File

@ -162,5 +162,21 @@ namespace ANX.Framework.Windows.GL3
GL.DeleteBuffers(1, ref bufferHandle);
}
#endregion
}
public void GetBackBufferData<T>(Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
}
}

View File

@ -73,6 +73,8 @@ namespace ANX.Framework.Graphics
private GraphicsProfile graphicsProfile;
private VertexBufferBinding[] currentVertexBufferBindings;
private RenderTargetBinding[] currentRenderTargetBindings;
private TextureCollection vertexTextureCollection;
private TextureCollection textureCollection;
#endregion // Private Members
@ -97,6 +99,8 @@ namespace ANX.Framework.Graphics
nativeDevice = AddInSystemFactory.Instance.GetCurrentCreator<IRenderSystemCreator>().CreateGraphicsDevice(presentationParameters);
this.samplerStateCollection = new SamplerStateCollection(this, 8); //TODO: get maximum number of sampler states from capabilities
this.textureCollection = new TextureCollection();
this.vertexTextureCollection = new TextureCollection();
}
~GraphicsDevice()
@ -216,17 +220,17 @@ namespace ANX.Framework.Graphics
public void GetBackBufferData<T>(Nullable<Rectangle> rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
nativeDevice.GetBackBufferData<T>(rect, data, startIndex, elementCount);
}
public void GetBackBufferData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
nativeDevice.GetBackBufferData<T>(data);
}
public void GetBackBufferData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
nativeDevice.GetBackBufferData<T>(data, startIndex, elementCount);
}
public VertexBufferBinding[] GetVertexBuffers()
@ -483,7 +487,7 @@ namespace ANX.Framework.Graphics
{
get
{
throw new NotImplementedException();
return this.vertexTextureCollection;
}
}
@ -491,7 +495,7 @@ namespace ANX.Framework.Graphics
{
get
{
throw new NotImplementedException();
return this.textureCollection;
}
}

View File

@ -56,9 +56,11 @@ namespace ANX.Framework.NonXNA
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 GetBackBufferData<T>(Nullable<Rectangle> rect, T[] data, int startIndex, int elementCount) where T : struct;
void GetBackBufferData<T>(T[] data) where T : struct;
void GetBackBufferData<T>(T[] data, int startIndex, int elementCount) where T : struct;
}
}

View File

@ -70,5 +70,9 @@ namespace ANX.Framework.NonXNA
void SetViewport(Viewport viewport);
void SetRenderTargets(params RenderTargetBinding[] renderTargets);
void GetBackBufferData<T>(Nullable<Rectangle> rect, T[] data, int startIndex, int elementCount) where T : struct;
void GetBackBufferData<T>(T[] data) where T : struct;
void GetBackBufferData<T>(T[] data, int startIndex, int elementCount) where T : struct;
}
}

View File

@ -593,5 +593,21 @@ namespace ANX.RenderSystem.Windows.DX11_1
{
throw new NotImplementedException();
}
}
public void GetBackBufferData<T>(Framework.Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
}
}

View File

@ -142,5 +142,21 @@ namespace ANX.RenderSystem.Windows.DX11_1
buffer = null;
}
}
public void GetBackBufferData<T>(Framework.Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data) where T : struct
{
throw new NotImplementedException();
}
public void GetBackBufferData<T>(T[] data, int startIndex, int elementCount) where T : struct
{
throw new NotImplementedException();
}
}
}