Checked all files in the Graphics namespace and added the last missing status attributes
This commit is contained in:
parent
db82358d24
commit
f08d6ea189
@ -8,32 +8,19 @@ using ANX.Framework.NonXNA.Development;
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[PercentageComplete(90)]
|
||||
[Developer("Glatzemann")]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public sealed class EffectTechnique
|
||||
{
|
||||
private Effect parentEffect;
|
||||
private INativeEffectTechnique nativeTechnique;
|
||||
private EffectPassCollection effectPassCollection;
|
||||
internal INativeEffectTechnique NativeTechnique { get; private set; }
|
||||
|
||||
internal INativeEffectTechnique NativeTechnique
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.nativeTechnique;
|
||||
}
|
||||
}
|
||||
public string Name
|
||||
{
|
||||
get { return NativeTechnique.Name; }
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return nativeTechnique.Name;
|
||||
}
|
||||
}
|
||||
|
||||
public EffectAnnotationCollection Annotations
|
||||
public EffectAnnotationCollection Annotations
|
||||
{
|
||||
get
|
||||
{
|
||||
@ -41,19 +28,12 @@ namespace ANX.Framework.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
public EffectPassCollection Passes
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.effectPassCollection;
|
||||
}
|
||||
}
|
||||
public EffectPassCollection Passes { get; private set; }
|
||||
|
||||
internal EffectTechnique(Effect parentEffect, INativeEffectTechnique nativeTechnique)
|
||||
{
|
||||
this.parentEffect = parentEffect;
|
||||
this.nativeTechnique = nativeTechnique;
|
||||
this.effectPassCollection = new EffectPassCollection(parentEffect, parentEffect.NativeEffect, nativeTechnique);
|
||||
this.NativeTechnique = nativeTechnique;
|
||||
this.Passes = new EffectPassCollection(parentEffect, parentEffect.NativeEffect, nativeTechnique);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,26 +11,19 @@ using ANX.Framework.NonXNA.Development;
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(75)]
|
||||
[PercentageComplete(50)]
|
||||
[Developer("Glatzemann")]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public sealed class GraphicsAdapter
|
||||
{
|
||||
public static ReadOnlyCollection<GraphicsAdapter> Adapters
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
public static ReadOnlyCollection<GraphicsAdapter> Adapters { get; private set; }
|
||||
|
||||
public static GraphicsAdapter DefaultAdapter
|
||||
{
|
||||
get
|
||||
{
|
||||
return Adapters.Where(a => a.IsDefaultAdapter).First<GraphicsAdapter>();
|
||||
}
|
||||
}
|
||||
public static GraphicsAdapter DefaultAdapter
|
||||
{
|
||||
get { return Adapters.First(a => a.IsDefaultAdapter); }
|
||||
}
|
||||
|
||||
public static bool UseNullDevice { get; set; }
|
||||
public static bool UseNullDevice { get; set; }
|
||||
public static bool UseReferenceDevice { get; set; }
|
||||
public int DeviceId { get; set; }
|
||||
public string DeviceName { get; set; }
|
||||
|
@ -1,5 +1,6 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
#endregion // Using Statements
|
||||
|
||||
@ -9,45 +10,24 @@ using System;
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[Developer("???")]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public sealed class Model
|
||||
{
|
||||
private ModelBoneCollection bones;
|
||||
|
||||
public ModelBoneCollection Bones
|
||||
{
|
||||
get { return bones; }
|
||||
}
|
||||
|
||||
private ModelMeshCollection meshes;
|
||||
|
||||
public ModelMeshCollection Meshes
|
||||
{
|
||||
get { return meshes; }
|
||||
}
|
||||
|
||||
private ModelBone root;
|
||||
|
||||
public ModelBone Root
|
||||
{
|
||||
get { return root; }
|
||||
}
|
||||
|
||||
private Object tag;
|
||||
|
||||
public Object Tag
|
||||
{
|
||||
get { return tag; }
|
||||
set { tag = value; }
|
||||
}
|
||||
public ModelBoneCollection Bones { get; private set; }
|
||||
public ModelMeshCollection Meshes { get; private set; }
|
||||
public ModelBone Root { get; private set; }
|
||||
public object Tag { get; set; }
|
||||
|
||||
private static Matrix[] cachedBonesArray;
|
||||
|
||||
public Model(ModelBoneCollection bones, ModelMeshCollection meshes, ModelBone rootBone, Object tag)
|
||||
{
|
||||
this.bones = bones;
|
||||
this.meshes = meshes;
|
||||
this.root = rootBone;
|
||||
this.tag = tag;
|
||||
this.Bones = bones;
|
||||
this.Meshes = meshes;
|
||||
this.Root = rootBone;
|
||||
this.Tag = tag;
|
||||
}
|
||||
|
||||
public void CopyAbsoluteBoneTransformsTo(Matrix[] destinationBoneTransforms)
|
||||
@ -57,14 +37,14 @@ namespace ANX.Framework.Graphics
|
||||
throw new ArgumentNullException("destinationBoneTransforms");
|
||||
}
|
||||
|
||||
if (destinationBoneTransforms.Length < bones.Count)
|
||||
if (destinationBoneTransforms.Length < Bones.Count)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("destinationBoneTransforms");
|
||||
}
|
||||
|
||||
for (int i = 0; i < bones.Count; i++)
|
||||
for (int i = 0; i < Bones.Count; i++)
|
||||
{
|
||||
var bone = bones[i];
|
||||
var bone = Bones[i];
|
||||
if (bone.Parent == null)
|
||||
{
|
||||
destinationBoneTransforms[i] = bone.Transform;
|
||||
@ -84,14 +64,14 @@ namespace ANX.Framework.Graphics
|
||||
throw new ArgumentNullException("sourceBoneTransforms");
|
||||
}
|
||||
|
||||
if (sourceBoneTransforms.Length < bones.Count)
|
||||
if (sourceBoneTransforms.Length < Bones.Count)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("sourceBoneTransforms");
|
||||
}
|
||||
|
||||
for (int i = 0; i < bones.Count; i++)
|
||||
for (int i = 0; i < Bones.Count; i++)
|
||||
{
|
||||
bones[i].Transform = sourceBoneTransforms[i];
|
||||
Bones[i].Transform = sourceBoneTransforms[i];
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,28 +82,28 @@ namespace ANX.Framework.Graphics
|
||||
throw new ArgumentNullException("destinationBoneTransforms");
|
||||
}
|
||||
|
||||
if (destinationBoneTransforms.Length < bones.Count)
|
||||
if (destinationBoneTransforms.Length < Bones.Count)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("destinationBoneTransforms");
|
||||
}
|
||||
|
||||
for (int i = 0; i < bones.Count; i++)
|
||||
for (int i = 0; i < Bones.Count; i++)
|
||||
{
|
||||
destinationBoneTransforms[i] = bones[i].Transform;
|
||||
destinationBoneTransforms[i] = Bones[i].Transform;
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw (Matrix world, Matrix view, Matrix projection)
|
||||
{
|
||||
Matrix[] absTransforms = Model.cachedBonesArray;
|
||||
if (absTransforms == null || absTransforms.Length < this.bones.Count)
|
||||
if (absTransforms == null || absTransforms.Length < this.Bones.Count)
|
||||
{
|
||||
Array.Resize<Matrix>(ref absTransforms, this.bones.Count);
|
||||
Array.Resize<Matrix>(ref absTransforms, this.Bones.Count);
|
||||
Model.cachedBonesArray = absTransforms;
|
||||
}
|
||||
this.CopyAbsoluteBoneTransformsTo(absTransforms);
|
||||
|
||||
foreach (var mesh in meshes)
|
||||
foreach (var mesh in Meshes)
|
||||
{
|
||||
foreach (var effect in mesh.Effects)
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
#endregion // Using Statements
|
||||
|
||||
@ -9,46 +10,22 @@ using System;
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[Developer("???")]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public sealed class ModelBone
|
||||
{
|
||||
private ModelBoneCollection children;
|
||||
public ModelBoneCollection Children
|
||||
{
|
||||
get { return children; }
|
||||
internal set { children = value; }
|
||||
}
|
||||
|
||||
private int index;
|
||||
public int Index
|
||||
{
|
||||
get { return index; }
|
||||
}
|
||||
|
||||
private string name;
|
||||
public string Name
|
||||
{
|
||||
get { return name; }
|
||||
}
|
||||
|
||||
private ModelBone parent;
|
||||
public ModelBone Parent
|
||||
{
|
||||
get { return parent; }
|
||||
internal set { parent = value; }
|
||||
}
|
||||
|
||||
private Matrix transform;
|
||||
public Matrix Transform
|
||||
{
|
||||
get { return transform; }
|
||||
set { transform = value; }
|
||||
}
|
||||
public ModelBoneCollection Children { get; internal set; }
|
||||
public int Index { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
public ModelBone Parent { get; internal set; }
|
||||
public Matrix Transform { get; set; }
|
||||
|
||||
public ModelBone(string name, Matrix transform, int index)
|
||||
{
|
||||
this.name = name;
|
||||
this.transform = transform;
|
||||
this.index = index;
|
||||
this.Name = name;
|
||||
this.Transform = transform;
|
||||
this.Index = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
#endregion // Using Statements
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
@ -10,6 +12,9 @@ using System.Collections.Generic;
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[Developer("???")]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public sealed class ModelMesh
|
||||
{
|
||||
private BoundingSphere boundingSphere;
|
||||
@ -19,57 +24,27 @@ namespace ANX.Framework.Graphics
|
||||
get { return boundingSphere; }
|
||||
}
|
||||
|
||||
private ModelEffectCollection effects;
|
||||
|
||||
public ModelEffectCollection Effects
|
||||
{
|
||||
get { return effects; }
|
||||
}
|
||||
|
||||
private ModelMeshPartCollection meshParts;
|
||||
|
||||
public ModelMeshPartCollection MeshParts
|
||||
{
|
||||
get { return meshParts; }
|
||||
}
|
||||
|
||||
private string name;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return name; }
|
||||
}
|
||||
|
||||
private ModelBone parentBone;
|
||||
|
||||
public ModelBone ParentBone
|
||||
{
|
||||
get { return parentBone; }
|
||||
}
|
||||
|
||||
private Object tag;
|
||||
|
||||
public Object Tag
|
||||
{
|
||||
get { return tag; }
|
||||
set { this.tag = value; }
|
||||
}
|
||||
public ModelEffectCollection Effects { get; private set; }
|
||||
public ModelMeshPartCollection MeshParts { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
public ModelBone ParentBone { get; private set; }
|
||||
public object Tag { get; set; }
|
||||
|
||||
public ModelMesh(string name, ModelBone bone, BoundingSphere sphere, ModelMeshPart[] meshParts, Object tag)
|
||||
{
|
||||
this.name = name;
|
||||
this.parentBone = bone;
|
||||
this.Name = name;
|
||||
this.ParentBone = bone;
|
||||
this.boundingSphere = sphere;
|
||||
this.tag = tag;
|
||||
this.meshParts = new ModelMeshPartCollection(meshParts);
|
||||
this.effects = new ModelEffectCollection();
|
||||
this.Tag = tag;
|
||||
this.MeshParts = new ModelMeshPartCollection(meshParts);
|
||||
this.Effects = new ModelEffectCollection();
|
||||
|
||||
foreach (var item in this.meshParts)
|
||||
foreach (var item in this.MeshParts)
|
||||
{
|
||||
item.parentMesh = this;
|
||||
if (item.Effect != null && !this.effects.Contains(item.Effect))
|
||||
if (item.Effect != null && !this.Effects.Contains(item.Effect))
|
||||
{
|
||||
this.effects.Add(item.Effect);
|
||||
this.Effects.Add(item.Effect);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -79,7 +54,7 @@ namespace ANX.Framework.Graphics
|
||||
bool oldEffectIsInUse = false;
|
||||
bool newEffectIsKnown = false;
|
||||
|
||||
foreach (var item in meshParts)
|
||||
foreach (var item in MeshParts)
|
||||
{
|
||||
if (object.ReferenceEquals(item, part))
|
||||
{
|
||||
@ -99,18 +74,18 @@ namespace ANX.Framework.Graphics
|
||||
|
||||
if (oldEffect != null && !oldEffectIsInUse)
|
||||
{
|
||||
effects.Remove(oldEffect);
|
||||
Effects.Remove(oldEffect);
|
||||
}
|
||||
|
||||
if (newEffect != null && !newEffectIsKnown)
|
||||
{
|
||||
effects.Add(newEffect);
|
||||
Effects.Add(newEffect);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
foreach (var part in meshParts)
|
||||
foreach (var part in MeshParts)
|
||||
{
|
||||
foreach (var pass in part.Effect.CurrentTechnique.Passes)
|
||||
{
|
||||
|
@ -8,20 +8,14 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[Developer("???")]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public sealed class ModelMeshPart
|
||||
{
|
||||
#region Private
|
||||
internal ModelMesh parentMesh;
|
||||
private Effect effect;
|
||||
private IndexBuffer indexBuffer;
|
||||
private int numVertices;
|
||||
private int primitiveCount;
|
||||
private int startIndex;
|
||||
private Object tag;
|
||||
private VertexBuffer vertexBuffer;
|
||||
private int vertexOffset;
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Public
|
||||
public Effect Effect
|
||||
@ -38,54 +32,22 @@ namespace ANX.Framework.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
public IndexBuffer IndexBuffer
|
||||
{
|
||||
get { return indexBuffer; }
|
||||
internal set { this.indexBuffer = value; }
|
||||
}
|
||||
|
||||
public int NumVertices
|
||||
{
|
||||
get { return numVertices; }
|
||||
}
|
||||
|
||||
public int PrimitiveCount
|
||||
{
|
||||
get { return primitiveCount; }
|
||||
}
|
||||
|
||||
public int StartIndex
|
||||
{
|
||||
get { return startIndex; }
|
||||
}
|
||||
|
||||
public Object Tag
|
||||
{
|
||||
get { return tag; }
|
||||
set { tag = value; }
|
||||
}
|
||||
|
||||
|
||||
public VertexBuffer VertexBuffer
|
||||
{
|
||||
get { return vertexBuffer; }
|
||||
internal set { this.vertexBuffer = value; }
|
||||
}
|
||||
|
||||
|
||||
public int VertexOffset
|
||||
{
|
||||
get { return vertexOffset; }
|
||||
}
|
||||
#endregion
|
||||
public IndexBuffer IndexBuffer { get; internal set; }
|
||||
public int NumVertices { get; private set; }
|
||||
public int PrimitiveCount { get; private set; }
|
||||
public int StartIndex { get; private set; }
|
||||
public object Tag { get; set; }
|
||||
public VertexBuffer VertexBuffer { get; internal set; }
|
||||
public int VertexOffset { get; private set; }
|
||||
#endregion
|
||||
|
||||
internal ModelMeshPart(int vertexOffset, int numVertices, int startIndex, int primitiveCount, object tag)
|
||||
{
|
||||
this.vertexOffset = vertexOffset;
|
||||
this.numVertices = numVertices;
|
||||
this.startIndex = startIndex;
|
||||
this.primitiveCount = primitiveCount;
|
||||
this.tag = tag;
|
||||
this.VertexOffset = vertexOffset;
|
||||
this.NumVertices = numVertices;
|
||||
this.StartIndex = startIndex;
|
||||
this.PrimitiveCount = primitiveCount;
|
||||
this.Tag = tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public sealed class NoSuitableGraphicsDeviceException : Exception
|
||||
{
|
||||
public NoSuitableGraphicsDeviceException()
|
||||
|
@ -1,9 +1,14 @@
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[Developer("Glatzemann")]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public enum PresentInterval
|
||||
{
|
||||
Default,
|
||||
|
@ -1,9 +1,14 @@
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[Developer("Glatzemann")]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public enum PrimitiveType
|
||||
{
|
||||
TriangleList,
|
||||
|
@ -10,6 +10,8 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[Developer("AstrorEnales")]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public class RasterizerState : GraphicsResource
|
||||
{
|
||||
#region Constants
|
||||
|
@ -2,6 +2,7 @@ using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using ANX.Framework.NonXNA;
|
||||
using ANX.Framework.NonXNA.RenderSystem;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
@ -9,59 +10,19 @@ using ANX.Framework.NonXNA.RenderSystem;
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(70)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public class RenderTarget2D : Texture2D, IDynamicGraphicsResource
|
||||
{
|
||||
public event EventHandler<EventArgs> ContentLost;
|
||||
|
||||
#region Private
|
||||
private DepthFormat depthStencilFormat;
|
||||
private int multiSampleCount;
|
||||
private RenderTargetUsage usage;
|
||||
private bool isContentLost;
|
||||
private INativeRenderTarget2D nativeRenderTarget;
|
||||
#endregion
|
||||
internal INativeRenderTarget2D NativeRenderTarget { get; private set; }
|
||||
public DepthFormat DepthStencilFormat { get; private set; }
|
||||
public bool IsContentLost { get; private set; }
|
||||
public int MultiSampleCount { get; private set; }
|
||||
public RenderTargetUsage RenderTargetUsage { get; private set; }
|
||||
|
||||
internal INativeRenderTarget2D NativeRenderTarget
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.nativeRenderTarget;
|
||||
}
|
||||
}
|
||||
|
||||
public DepthFormat DepthStencilFormat
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.depthStencilFormat;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsContentLost
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.isContentLost;
|
||||
}
|
||||
}
|
||||
|
||||
public int MultiSampleCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.multiSampleCount;
|
||||
}
|
||||
}
|
||||
|
||||
public RenderTargetUsage RenderTargetUsage
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.usage;
|
||||
}
|
||||
}
|
||||
|
||||
#region Constructor
|
||||
#region Constructor
|
||||
public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height)
|
||||
: base(graphicsDevice)
|
||||
{
|
||||
@ -73,14 +34,14 @@ namespace ANX.Framework.Graphics
|
||||
base.levelCount = 1;
|
||||
base.format = SurfaceFormat.Color;
|
||||
|
||||
this.depthStencilFormat = DepthFormat.None;
|
||||
this.multiSampleCount = 0;
|
||||
this.usage = RenderTargetUsage.DiscardContents;
|
||||
this.DepthStencilFormat = DepthFormat.None;
|
||||
this.MultiSampleCount = 0;
|
||||
this.RenderTargetUsage = RenderTargetUsage.DiscardContents;
|
||||
|
||||
var creator = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>();
|
||||
this.nativeRenderTarget = creator.CreateRenderTarget(graphicsDevice, width, height, false, SurfaceFormat.Color,
|
||||
this.depthStencilFormat, this.multiSampleCount, this.usage);
|
||||
base.nativeTexture = this.nativeRenderTarget as INativeTexture2D;
|
||||
this.NativeRenderTarget = creator.CreateRenderTarget(graphicsDevice, width, height, false, SurfaceFormat.Color,
|
||||
this.DepthStencilFormat, this.MultiSampleCount, this.RenderTargetUsage);
|
||||
base.nativeTexture = this.NativeRenderTarget as INativeTexture2D;
|
||||
}
|
||||
|
||||
public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height,
|
||||
@ -95,14 +56,14 @@ namespace ANX.Framework.Graphics
|
||||
base.levelCount = 1;
|
||||
base.format = preferredFormat;
|
||||
|
||||
this.depthStencilFormat = preferredDepthFormat;
|
||||
this.multiSampleCount = 0;
|
||||
this.usage = RenderTargetUsage.DiscardContents;
|
||||
this.DepthStencilFormat = preferredDepthFormat;
|
||||
this.MultiSampleCount = 0;
|
||||
this.RenderTargetUsage = RenderTargetUsage.DiscardContents;
|
||||
|
||||
var creator = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>();
|
||||
this.nativeRenderTarget = creator.CreateRenderTarget(graphicsDevice, width, height, false, SurfaceFormat.Color,
|
||||
this.depthStencilFormat, this.multiSampleCount, this.usage);
|
||||
base.nativeTexture = this.nativeRenderTarget as INativeTexture2D;
|
||||
this.NativeRenderTarget = creator.CreateRenderTarget(graphicsDevice, width, height, false, SurfaceFormat.Color,
|
||||
this.DepthStencilFormat, this.MultiSampleCount, this.RenderTargetUsage);
|
||||
base.nativeTexture = this.NativeRenderTarget as INativeTexture2D;
|
||||
}
|
||||
|
||||
public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height,
|
||||
@ -118,14 +79,14 @@ namespace ANX.Framework.Graphics
|
||||
base.levelCount = 1;
|
||||
base.format = preferredFormat;
|
||||
|
||||
this.depthStencilFormat = preferredDepthFormat;
|
||||
this.multiSampleCount = preferredMultiSampleCount;
|
||||
this.usage = usage;
|
||||
this.DepthStencilFormat = preferredDepthFormat;
|
||||
this.MultiSampleCount = preferredMultiSampleCount;
|
||||
this.RenderTargetUsage = usage;
|
||||
|
||||
var creator = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>();
|
||||
this.nativeRenderTarget = creator.CreateRenderTarget(graphicsDevice, width, height, false, SurfaceFormat.Color,
|
||||
this.depthStencilFormat, this.multiSampleCount, this.usage);
|
||||
base.nativeTexture = this.nativeRenderTarget as INativeTexture2D;
|
||||
this.NativeRenderTarget = creator.CreateRenderTarget(graphicsDevice, width, height, false, SurfaceFormat.Color,
|
||||
this.DepthStencilFormat, this.MultiSampleCount, this.RenderTargetUsage);
|
||||
base.nativeTexture = this.NativeRenderTarget as INativeTexture2D;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -136,7 +97,7 @@ namespace ANX.Framework.Graphics
|
||||
|
||||
void IDynamicGraphicsResource.SetContentLost(bool isContentLost)
|
||||
{
|
||||
this.isContentLost = isContentLost;
|
||||
this.IsContentLost = isContentLost;
|
||||
if (isContentLost)
|
||||
raise_ContentLost(this, EventArgs.Empty);
|
||||
|
||||
|
@ -8,6 +8,7 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public struct RenderTargetBinding
|
||||
{
|
||||
#region Private
|
||||
|
@ -9,6 +9,7 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(0)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public class RenderTargetCube : TextureCube, IDynamicGraphicsResource
|
||||
{
|
||||
public event EventHandler<EventArgs> ContentLost;
|
||||
|
@ -1,9 +1,13 @@
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public enum RenderTargetUsage
|
||||
{
|
||||
DiscardContents,
|
||||
|
@ -8,6 +8,7 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public sealed class ResourceCreatedEventArgs : EventArgs
|
||||
{
|
||||
public object Resource { get; set; }
|
||||
|
@ -8,6 +8,7 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public sealed class ResourceDestroyedEventArgs : EventArgs
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
@ -10,6 +10,7 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public class SamplerState : GraphicsResource
|
||||
{
|
||||
#region Constants
|
||||
|
@ -1,9 +1,13 @@
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public enum SetDataOptions
|
||||
{
|
||||
Discard = 1,
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
@ -7,6 +8,8 @@ using System;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[Flags]
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public enum SpriteEffects
|
||||
{
|
||||
None,
|
||||
|
@ -1,9 +1,13 @@
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public enum SpriteSortMode
|
||||
{
|
||||
Deferred = 0,
|
||||
|
@ -1,9 +1,13 @@
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public enum StencilOperation
|
||||
{
|
||||
Keep,
|
||||
|
@ -1,9 +1,13 @@
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public enum SurfaceFormat
|
||||
{
|
||||
Color,
|
||||
|
@ -1,3 +1,4 @@
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
using ANX.Framework.NonXNA.RenderSystem;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
@ -6,6 +7,8 @@ using ANX.Framework.NonXNA.RenderSystem;
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public abstract class Texture : GraphicsResource
|
||||
{
|
||||
protected internal int levelCount;
|
||||
|
@ -2,6 +2,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using ANX.Framework.NonXNA;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
using ANX.Framework.NonXNA.RenderSystem;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
@ -10,6 +11,8 @@ using ANX.Framework.NonXNA.RenderSystem;
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(70)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public class Texture2D : Texture, IGraphicsResource
|
||||
{
|
||||
#region Private
|
||||
|
@ -9,6 +9,7 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(0)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public class Texture3D : Texture, IGraphicsResource
|
||||
{
|
||||
public int Depth
|
||||
|
@ -1,9 +1,13 @@
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public enum TextureAddressMode
|
||||
{
|
||||
Wrap,
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using ANX.Framework.NonXNA;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
@ -7,9 +8,12 @@ using ANX.Framework.NonXNA;
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[Developer("AstrorEnales")]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public sealed class TextureCollection
|
||||
{
|
||||
private Texture[] textures;
|
||||
private readonly Texture[] textures;
|
||||
|
||||
public Texture this[int index]
|
||||
{
|
||||
|
@ -9,6 +9,7 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(0)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public class TextureCube : Texture, IGraphicsResource
|
||||
{
|
||||
public int Size
|
||||
|
@ -1,9 +1,13 @@
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public enum TextureFilter
|
||||
{
|
||||
Linear,
|
||||
|
@ -9,6 +9,7 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public class VertexDeclaration : GraphicsResource
|
||||
{
|
||||
private VertexElement[] elements;
|
||||
|
@ -8,6 +8,7 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(95)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public struct VertexElement
|
||||
{
|
||||
#region Private
|
||||
|
@ -1,9 +1,13 @@
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public enum VertexElementFormat
|
||||
{
|
||||
Single = 0,
|
||||
|
@ -1,9 +1,13 @@
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
// For details see: http://anxframework.codeplex.com/license
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public enum VertexElementUsage
|
||||
{
|
||||
Position = 0,
|
||||
|
@ -8,6 +8,7 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(95)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public struct VertexPositionColor : IVertexType
|
||||
{
|
||||
public Vector3 Position;
|
||||
|
@ -7,7 +7,8 @@ using ANX.Framework.NonXNA.Development;
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(95)]
|
||||
[PercentageComplete(95)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public struct VertexPositionColorTexture : IVertexType
|
||||
{
|
||||
public Vector3 Position;
|
||||
|
@ -7,7 +7,8 @@ using ANX.Framework.NonXNA.Development;
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(95)]
|
||||
[PercentageComplete(95)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public struct VertexPositionNormalTexture : IVertexType
|
||||
{
|
||||
public Vector3 Position;
|
||||
|
@ -8,6 +8,7 @@ using ANX.Framework.NonXNA.Development;
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(95)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public struct VertexPositionTexture : IVertexType
|
||||
{
|
||||
public Vector3 Position;
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using ANX.Framework.NonXNA.Development;
|
||||
|
||||
// This file is part of the ANX.Framework created by the
|
||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||
@ -6,6 +7,8 @@ using System;
|
||||
|
||||
namespace ANX.Framework.Graphics
|
||||
{
|
||||
[PercentageComplete(100)]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public struct Viewport
|
||||
{
|
||||
#region Private
|
||||
|
Loading…
x
Reference in New Issue
Block a user