mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 12:22:35 +00:00
- remove SlimDX.Direct3D9 namespace
This commit is contained in:
parent
1be047d316
commit
3cff90d716
22 changed files with 215 additions and 265 deletions
|
@ -37,7 +37,6 @@ using CodeImp.DoomBuilder.Rendering;
|
|||
using CodeImp.DoomBuilder.Windows;
|
||||
using CodeImp.DoomBuilder.ZDoom;
|
||||
using SlimDX;
|
||||
using SlimDX.Direct3D9;
|
||||
using Matrix = SlimDX.Matrix;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ using CodeImp.DoomBuilder.IO;
|
|||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
using SlimDX;
|
||||
using SlimDX.Direct3D9;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ using System.Collections.Generic;
|
|||
using CodeImp.DoomBuilder.GZBuilder.MD3;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
using SlimDX;
|
||||
using SlimDX.Direct3D9;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using SlimDX.Direct3D9;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
|
||||
namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
||||
{
|
||||
|
|
|
@ -11,7 +11,6 @@ using CodeImp.DoomBuilder.Data;
|
|||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.GZBuilder.Data;
|
||||
using SlimDX;
|
||||
using SlimDX.Direct3D9;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
|
||||
#endregion
|
||||
|
@ -38,11 +37,10 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
|
|||
|
||||
private static readonly VertexElement[] vertexElements = new[]
|
||||
{
|
||||
new VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0),
|
||||
new VertexElement(0, 12, DeclarationType.Color, DeclarationMethod.Default, DeclarationUsage.Color, 0),
|
||||
new VertexElement(0, 16, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0),
|
||||
new VertexElement(0, 24, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Normal, 0),
|
||||
VertexElement.VertexDeclarationEnd
|
||||
new VertexElement(0, 0, DeclarationType.Float3, DeclarationUsage.Position),
|
||||
new VertexElement(0, 12, DeclarationType.Color, DeclarationUsage.Color),
|
||||
new VertexElement(0, 16, DeclarationType.Float2, DeclarationUsage.TextureCoordinate),
|
||||
new VertexElement(0, 24, DeclarationType.Float3, DeclarationUsage.Normal)
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -40,7 +40,6 @@ using CodeImp.DoomBuilder.Plugins;
|
|||
using CodeImp.DoomBuilder.Rendering;
|
||||
using CodeImp.DoomBuilder.Types;
|
||||
using CodeImp.DoomBuilder.Windows;
|
||||
using SlimDX.Direct3D9;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Drawing;
|
||||
using SlimDX.Direct3D9;
|
||||
using Font = System.Drawing.Font;
|
||||
|
||||
namespace CodeImp.DoomBuilder.Rendering
|
||||
|
|
|
@ -23,12 +23,193 @@ using System.Windows.Forms;
|
|||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using SlimDX;
|
||||
using SlimDX.Direct3D9;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace CodeImp.DoomBuilder.Rendering
|
||||
{
|
||||
#region High level mesh rendering
|
||||
public class Mesh
|
||||
{
|
||||
public Mesh(int indexCount, int vertexCount, MeshFlags flags, VertexElement[] elements) { }
|
||||
|
||||
public VertexBuffer VertexBuffer { get; private set; }
|
||||
public IndexBuffer IndexBuffer { get; private set; }
|
||||
|
||||
public DataStream LockVertexBuffer(LockFlags flags) { return null; }
|
||||
public DataStream LockIndexBuffer(LockFlags flags) { return null; }
|
||||
public void UnlockVertexBuffer() { }
|
||||
public void UnlockIndexBuffer() { }
|
||||
|
||||
public void DrawSubset(int index) { }
|
||||
|
||||
public void Dispose() { }
|
||||
}
|
||||
|
||||
public class Effect
|
||||
{
|
||||
public static Effect FromStream(System.IO.Stream stream, ShaderFlags flags, out string errors) { errors = ""; return null; }
|
||||
|
||||
public void SetTexture(EffectHandle handle, BaseTexture texture) { }
|
||||
public void SetValue<T>(EffectHandle handle, T value) where T : struct { }
|
||||
public EffectHandle GetParameter(EffectHandle parameter, string name) { return null; }
|
||||
public string Technique { set; private get; }
|
||||
public void CommitChanges() { }
|
||||
|
||||
public void Begin() { }
|
||||
public void BeginPass(int index) { }
|
||||
public void EndPass() { }
|
||||
public void End() { }
|
||||
|
||||
public void Dispose() { }
|
||||
}
|
||||
|
||||
public class EffectHandle
|
||||
{
|
||||
public void Dispose() { }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Vertex buffer format / Input assembly
|
||||
public class VertexDeclaration
|
||||
{
|
||||
public VertexDeclaration(VertexElement[] elements) { }
|
||||
public void Dispose() { }
|
||||
}
|
||||
|
||||
public struct VertexElement
|
||||
{
|
||||
public VertexElement(short stream, short offset, DeclarationType type, DeclarationUsage usage) { }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Buffer objects
|
||||
public class VertexBuffer
|
||||
{
|
||||
public VertexBuffer(int sizeInBytes, Usage usage, Pool pool) { }
|
||||
|
||||
public DataStream Lock(int offset, int size, LockFlags flags) { return null; }
|
||||
public void Unlock() { }
|
||||
|
||||
public object Tag { get; set; }
|
||||
|
||||
public bool Disposed { get; private set; }
|
||||
public void Dispose() { Disposed = true; }
|
||||
}
|
||||
|
||||
public class IndexBuffer
|
||||
{
|
||||
public DataStream Lock(int offset, int size, LockFlags flags) { return null; }
|
||||
public void Unlock() { }
|
||||
|
||||
public object Tag { get; set; }
|
||||
|
||||
public bool Disposed { get; private set; }
|
||||
public void Dispose() { Disposed = true; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Textures
|
||||
public class BaseTexture
|
||||
{
|
||||
public bool Disposed { get; }
|
||||
public void Dispose() { }
|
||||
}
|
||||
|
||||
public class Texture : BaseTexture
|
||||
{
|
||||
public Texture(int width, int height, int levels, Usage usage, Format format, Pool pool) { }
|
||||
|
||||
public int Width { get; private set; }
|
||||
public int Height { get; private set; }
|
||||
|
||||
public object Tag { get; set; }
|
||||
|
||||
public DataRectangle LockRectangle(int level, LockFlags flags) { return null; }
|
||||
public void UnlockRectangle(int level) { }
|
||||
|
||||
public static Texture FromStream(System.IO.Stream stream) { return null; }
|
||||
public static Texture FromStream(System.IO.Stream stream, int length, int width, int height, int levels, Usage usage, Format format, Pool pool) { return null; }
|
||||
}
|
||||
|
||||
public class CubeTexture : BaseTexture
|
||||
{
|
||||
public CubeTexture(int size, int levels, Usage usage, Format format, Pool pool) { }
|
||||
|
||||
public DataRectangle LockRectangle(CubeMapFace face, int level, LockFlags flags) { return null; }
|
||||
public void UnlockRectangle(CubeMapFace face, int level) { }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Locked buffer writing and reading
|
||||
public class DataRectangle
|
||||
{
|
||||
public DataRectangle(int pitch, DataStream s) { Data = s; Pitch = pitch; }
|
||||
public DataStream Data { get; private set; }
|
||||
public int Pitch { get; private set; }
|
||||
}
|
||||
|
||||
public class DataStream : IDisposable
|
||||
{
|
||||
public void Seek(long offset, System.IO.SeekOrigin origin) { }
|
||||
public void Write(ushort v) { }
|
||||
public void Write(Array data, long offset, long size) { }
|
||||
public void WriteRange(Array data) { }
|
||||
public void WriteRange(Array data, long offset, long size) { }
|
||||
public void WriteRange(IntPtr data, long size) { }
|
||||
public void Dispose() { }
|
||||
|
||||
public void ReadRange(Array data, long offset, long size) { }
|
||||
|
||||
public bool CanRead { get; private set; }
|
||||
public bool CanWrite { get; private set; }
|
||||
public long Length { get; private set; }
|
||||
public IntPtr DataPointer { get; private set; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Enumerations
|
||||
public enum RenderState
|
||||
{
|
||||
AlphaBlendEnable,
|
||||
AlphaRef,
|
||||
AlphaTestEnable,
|
||||
CullMode,
|
||||
BlendOperation,
|
||||
SourceBlend,
|
||||
DestinationBlend,
|
||||
FillMode,
|
||||
FogEnable,
|
||||
FogColor,
|
||||
FogStart,
|
||||
FogEnd,
|
||||
MultisampleAntialias,
|
||||
TextureFactor,
|
||||
ZEnable,
|
||||
ZWriteEnable
|
||||
}
|
||||
|
||||
public enum Cull { None, Counterclockwise }
|
||||
public enum Blend { InverseSourceAlpha, SourceAlpha, One, BlendFactor }
|
||||
public enum BlendOperation { Add, ReverseSubtract }
|
||||
public enum FillMode { Solid, Wireframe }
|
||||
public enum TransformState { World, View, Projection }
|
||||
public enum SamplerState { AddressU, AddressV, AddressW }
|
||||
public enum TextureAddress { Wrap, Clamp }
|
||||
public enum Format { Unknown, A8R8G8B8 }
|
||||
public enum Usage { None, WriteOnly, Dynamic, RenderTarget }
|
||||
public enum Pool { Default, Managed, SystemMemory }
|
||||
public enum LockFlags { None, Discard }
|
||||
public enum MeshFlags { Use32Bit, IndexBufferManaged, VertexBufferManaged, Managed }
|
||||
public enum ShaderFlags { None, Debug }
|
||||
public enum PrimitiveType { LineList, TriangleList, TriangleStrip }
|
||||
public enum CubeMapFace { PositiveX, PositiveY, PositiveZ, NegativeX, NegativeY, NegativeZ }
|
||||
public enum TextureFilter { None, Point, Linear, Anisotropic }
|
||||
public enum DeclarationType { Float2, Float3, Color }
|
||||
public enum DeclarationUsage { Position, Color, TextureCoordinate, Normal }
|
||||
#endregion
|
||||
|
||||
#region Device context
|
||||
internal class D3DDevice : IDisposable
|
||||
{
|
||||
internal D3DDevice(RenderTargetControl rendertarget)
|
||||
|
@ -42,7 +223,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
public void SetRenderState(RenderState state, float v) { }
|
||||
public void SetRenderState(RenderState state, bool v) { }
|
||||
public void SetRenderState(RenderState state, int v) { }
|
||||
public void SetRenderState(RenderState state, Compare v) { }
|
||||
public void SetRenderState(RenderState state, Cull v) { }
|
||||
public void SetRenderState(RenderState state, Blend v) { }
|
||||
public void SetRenderState(RenderState state, BlendOperation v) { }
|
||||
|
@ -87,7 +267,6 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
{
|
||||
// Setup renderstates
|
||||
SetRenderState(RenderState.AlphaBlendEnable, false);
|
||||
SetRenderState(RenderState.AlphaFunc, Compare.GreaterEqual);
|
||||
SetRenderState(RenderState.AlphaRef, 0x0000007E);
|
||||
SetRenderState(RenderState.AlphaTestEnable, false);
|
||||
SetRenderState(RenderState.CullMode, Cull.None);
|
||||
|
@ -153,4 +332,5 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
return new Vector2D(v2.X, v2.Y);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
using System;
|
||||
using System.IO;
|
||||
using SlimDX.Direct3D9;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using SlimDX.Direct3D9;
|
||||
using SlimDX;
|
||||
|
||||
#endregion
|
||||
|
@ -79,10 +78,9 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// Initialize world vertex declaration
|
||||
VertexElement[] elements = new[]
|
||||
{
|
||||
new VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0),
|
||||
new VertexElement(0, 12, DeclarationType.Color, DeclarationMethod.Default, DeclarationUsage.Color, 0),
|
||||
new VertexElement(0, 16, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0),
|
||||
VertexElement.VertexDeclarationEnd
|
||||
new VertexElement(0, 0, DeclarationType.Float3, DeclarationUsage.Position),
|
||||
new VertexElement(0, 12, DeclarationType.Color, DeclarationUsage.Color),
|
||||
new VertexElement(0, 16, DeclarationType.Float2, DeclarationUsage.TextureCoordinate)
|
||||
};
|
||||
vertexdecl = new VertexDeclaration(elements);
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using SlimDX.Direct3D9;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ using System.Collections.Generic;
|
|||
using System.Drawing;
|
||||
using System.Net;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using SlimDX.Direct3D9;
|
||||
using SlimDX;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
|
@ -392,8 +391,8 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
graphics.ClearTexture(General.Colors.Background.WithAlpha(0).ToColorValue(), overlaytex);
|
||||
|
||||
// Create vertex buffers
|
||||
screenverts = new VertexBuffer(4 * sizeof(FlatVertex), Usage.Dynamic | Usage.WriteOnly, VertexFormat.None, Pool.Default);
|
||||
thingsvertices = new VertexBuffer(THING_BUFFER_SIZE * 12 * sizeof(FlatVertex), Usage.Dynamic | Usage.WriteOnly, VertexFormat.None, Pool.Default);
|
||||
screenverts = new VertexBuffer(4 * sizeof(FlatVertex), Usage.Dynamic | Usage.WriteOnly, Pool.Default);
|
||||
thingsvertices = new VertexBuffer(THING_BUFFER_SIZE * 12 * sizeof(FlatVertex), Usage.Dynamic | Usage.WriteOnly, Pool.Default);
|
||||
|
||||
// Make screen vertices
|
||||
DataStream stream = screenverts.Lock(0, 4 * sizeof(FlatVertex), LockFlags.Discard);
|
||||
|
@ -2009,7 +2008,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
}
|
||||
|
||||
// Write to buffer
|
||||
VertexBuffer vb = new VertexBuffer(FlatVertex.Stride * verts.Length, Usage.WriteOnly | Usage.Dynamic, VertexFormat.None, Pool.Default);
|
||||
VertexBuffer vb = new VertexBuffer(FlatVertex.Stride * verts.Length, Usage.WriteOnly | Usage.Dynamic, Pool.Default);
|
||||
DataStream s = vb.Lock(0, FlatVertex.Stride * verts.Length, LockFlags.Discard);
|
||||
s.WriteRange(verts);
|
||||
vb.Unlock();
|
||||
|
|
|
@ -26,7 +26,6 @@ using CodeImp.DoomBuilder.GZBuilder.MD3;
|
|||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using SlimDX;
|
||||
using SlimDX.Direct3D9;
|
||||
using CodeImp.DoomBuilder.GZBuilder;
|
||||
|
||||
#endregion
|
||||
|
@ -721,7 +720,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
}
|
||||
}
|
||||
|
||||
VertexBuffer vb = new VertexBuffer(WorldVertex.Stride * verts.Length, Usage.WriteOnly | Usage.Dynamic, VertexFormat.None, Pool.Default);
|
||||
VertexBuffer vb = new VertexBuffer(WorldVertex.Stride * verts.Length, Usage.WriteOnly | Usage.Dynamic, Pool.Default);
|
||||
DataStream s = vb.Lock(0, WorldVertex.Stride * verts.Length, LockFlags.Discard);
|
||||
s.WriteRange(verts);
|
||||
vb.Unlock();
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using System.Collections.Generic;
|
||||
using SlimDX.Direct3D9;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ using System.IO;
|
|||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using SlimDX;
|
||||
using SlimDX.Direct3D9;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -141,7 +140,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
for(int i = 0; i < set.Value.buffersizes.Count; i++)
|
||||
{
|
||||
// Make the new buffer!
|
||||
VertexBuffer b = new VertexBuffer(FlatVertex.Stride * set.Value.buffersizes[i], Usage.WriteOnly | Usage.Dynamic, VertexFormat.None, Pool.Default);
|
||||
VertexBuffer b = new VertexBuffer(FlatVertex.Stride * set.Value.buffersizes[i], Usage.WriteOnly | Usage.Dynamic, Pool.Default);
|
||||
|
||||
// Start refilling the buffer with sector geometry
|
||||
DataStream bstream = b.Lock(0, FlatVertex.Stride * set.Value.buffersizes[i], LockFlags.Discard);
|
||||
|
@ -281,7 +280,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
if(!resourcesunloaded)
|
||||
{
|
||||
// Make the new buffer!
|
||||
vb = new VertexBuffer(FlatVertex.Stride * buffernumvertices, Usage.WriteOnly | Usage.Dynamic, VertexFormat.None, Pool.Default);
|
||||
vb = new VertexBuffer(FlatVertex.Stride * buffernumvertices, Usage.WriteOnly | Usage.Dynamic, Pool.Default);
|
||||
|
||||
// Add it.
|
||||
set.buffers.Add(vb);
|
||||
|
@ -332,7 +331,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
if(!resourcesunloaded)
|
||||
{
|
||||
// Make the new buffer and lock it
|
||||
vb = new VertexBuffer(FlatVertex.Stride * buffernumvertices, Usage.WriteOnly | Usage.Dynamic, VertexFormat.None, Pool.Default);
|
||||
vb = new VertexBuffer(FlatVertex.Stride * buffernumvertices, Usage.WriteOnly | Usage.Dynamic, Pool.Default);
|
||||
bstream = vb.Lock(0, FlatVertex.Stride * theseentries.Count * verticesperentry, LockFlags.Discard);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ using System.Drawing.Imaging;
|
|||
using System.Drawing.Text;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using SlimDX.Direct3D9;
|
||||
using SlimDX;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using Font = System.Drawing.Font;
|
||||
|
@ -343,7 +342,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
//mxd. Create the buffer
|
||||
if(textbuffer == null || textbuffer.Disposed)
|
||||
{
|
||||
textbuffer = new VertexBuffer(4 * FlatVertex.Stride, Usage.Dynamic | Usage.WriteOnly, VertexFormat.None, Pool.Default);
|
||||
textbuffer = new VertexBuffer(4 * FlatVertex.Stride, Usage.Dynamic | Usage.WriteOnly, Pool.Default);
|
||||
}
|
||||
|
||||
//mxd. Lock the buffer
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using SlimDX.Direct3D9;
|
||||
using SlimDX;
|
||||
|
||||
#endregion
|
||||
|
@ -94,10 +93,9 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// Initialize world vertex declaration
|
||||
VertexElement[] elements = new[]
|
||||
{
|
||||
new VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0),
|
||||
new VertexElement(0, 12, DeclarationType.Color, DeclarationMethod.Default, DeclarationUsage.Color, 0),
|
||||
new VertexElement(0, 16, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0),
|
||||
VertexElement.VertexDeclarationEnd
|
||||
new VertexElement(0, 0, DeclarationType.Float3, DeclarationUsage.Position),
|
||||
new VertexElement(0, 12, DeclarationType.Color, DeclarationUsage.Color),
|
||||
new VertexElement(0, 16, DeclarationType.Float2, DeclarationUsage.TextureCoordinate)
|
||||
};
|
||||
vertexdecl = new VertexDeclaration(elements);
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
using System;
|
||||
using CodeImp.DoomBuilder.VisualModes;
|
||||
using SlimDX.Direct3D9;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -85,7 +84,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
v2, v3,
|
||||
v3, v0 };
|
||||
|
||||
upper = new VertexBuffer(WorldVertex.Stride * vu.Length, Usage.WriteOnly | Usage.Dynamic, VertexFormat.None, Pool.Default);
|
||||
upper = new VertexBuffer(WorldVertex.Stride * vu.Length, Usage.WriteOnly | Usage.Dynamic, Pool.Default);
|
||||
upper.Lock(0, WorldVertex.Stride * vu.Length, LockFlags.None).WriteRange(vu);
|
||||
upper.Unlock();
|
||||
|
||||
|
@ -99,7 +98,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
v6, v7,
|
||||
v7, v4 };
|
||||
|
||||
lower = new VertexBuffer(WorldVertex.Stride * vl.Length, Usage.WriteOnly | Usage.Dynamic, VertexFormat.None, Pool.Default);
|
||||
lower = new VertexBuffer(WorldVertex.Stride * vl.Length, Usage.WriteOnly | Usage.Dynamic, Pool.Default);
|
||||
lower.Lock(0, WorldVertex.Stride * vl.Length, LockFlags.None).WriteRange(vl);
|
||||
lower.Unlock();
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using SlimDX.Direct3D9;
|
||||
using SlimDX;
|
||||
|
||||
#endregion
|
||||
|
@ -305,11 +304,10 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
|
||||
// Initialize world vertex declaration
|
||||
VertexElement[] ve = {
|
||||
new VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0),
|
||||
new VertexElement(0, 12, DeclarationType.Color, DeclarationMethod.Default, DeclarationUsage.Color, 0),
|
||||
new VertexElement(0, 16, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0),
|
||||
new VertexElement(0, 24, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Normal, 0), //mxd
|
||||
VertexElement.VertexDeclarationEnd
|
||||
new VertexElement(0, 0, DeclarationType.Float3, DeclarationUsage.Position),
|
||||
new VertexElement(0, 12, DeclarationType.Color, DeclarationUsage.Color),
|
||||
new VertexElement(0, 16, DeclarationType.Float2, DeclarationUsage.TextureCoordinate),
|
||||
new VertexElement(0, 24, DeclarationType.Float3, DeclarationUsage.Normal)
|
||||
};
|
||||
|
||||
vertexdecl = new VertexDeclaration(ve);
|
||||
|
|
|
@ -2,208 +2,6 @@
|
|||
|
||||
namespace SlimDX
|
||||
{
|
||||
#region High level mesh rendering
|
||||
namespace Direct3D9
|
||||
{
|
||||
public class Mesh
|
||||
{
|
||||
public Mesh(int indexCount, int vertexCount, MeshFlags flags, VertexElement[] elements) { }
|
||||
|
||||
public VertexBuffer VertexBuffer { get; private set; }
|
||||
public IndexBuffer IndexBuffer { get; private set; }
|
||||
|
||||
public DataStream LockVertexBuffer(LockFlags flags) { return null; }
|
||||
public DataStream LockIndexBuffer(LockFlags flags) { return null; }
|
||||
public void UnlockVertexBuffer() { }
|
||||
public void UnlockIndexBuffer() { }
|
||||
|
||||
public void DrawSubset(int index) { }
|
||||
|
||||
public void Dispose() { }
|
||||
}
|
||||
|
||||
public class Effect
|
||||
{
|
||||
public static Effect FromStream(System.IO.Stream stream, ShaderFlags flags, out string errors) { errors = ""; return null; }
|
||||
|
||||
public void SetTexture(EffectHandle handle, BaseTexture texture) { }
|
||||
public void SetValue<T>(EffectHandle handle, T value) where T : struct { }
|
||||
public EffectHandle GetParameter(EffectHandle parameter, string name) { return null; }
|
||||
public string Technique { set; private get; }
|
||||
public void CommitChanges() { }
|
||||
|
||||
public void Begin() { }
|
||||
public void BeginPass(int index) { }
|
||||
public void EndPass() { }
|
||||
public void End() { }
|
||||
|
||||
public void Dispose() { }
|
||||
}
|
||||
|
||||
public class EffectHandle
|
||||
{
|
||||
public void Dispose() { }
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Vertex buffer format / Input assembly
|
||||
namespace Direct3D9
|
||||
{
|
||||
public class VertexDeclaration
|
||||
{
|
||||
public VertexDeclaration(VertexElement[] elements) { }
|
||||
public void Dispose() { }
|
||||
}
|
||||
|
||||
public struct VertexElement
|
||||
{
|
||||
public VertexElement(short stream, short offset, DeclarationType type, DeclarationMethod method, DeclarationUsage usage, byte usageIndex) { }
|
||||
public static readonly VertexElement VertexDeclarationEnd;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Buffer objects
|
||||
namespace Direct3D9
|
||||
{
|
||||
public class VertexBuffer
|
||||
{
|
||||
public VertexBuffer(int sizeInBytes, Usage usage, VertexFormat format, Pool pool) { }
|
||||
|
||||
public DataStream Lock(int offset, int size, LockFlags flags) { return null; }
|
||||
public void Unlock() { }
|
||||
|
||||
public object Tag { get; set; }
|
||||
|
||||
public bool Disposed { get; private set; }
|
||||
public void Dispose() { Disposed = true; }
|
||||
}
|
||||
|
||||
public class IndexBuffer
|
||||
{
|
||||
public DataStream Lock(int offset, int size, LockFlags flags) { return null; }
|
||||
public void Unlock() { }
|
||||
|
||||
public object Tag { get; set; }
|
||||
|
||||
public bool Disposed { get; private set; }
|
||||
public void Dispose() { Disposed = true; }
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Images (textures and surfaces)
|
||||
namespace Direct3D9
|
||||
{
|
||||
public class BaseTexture
|
||||
{
|
||||
public bool Disposed { get; }
|
||||
public void Dispose() { }
|
||||
}
|
||||
|
||||
public class Texture : BaseTexture
|
||||
{
|
||||
public Texture(int width, int height, int levels, Usage usage, Format format, Pool pool) { }
|
||||
|
||||
public int Width { get; private set; }
|
||||
public int Height { get; private set; }
|
||||
|
||||
public object Tag { get; set; }
|
||||
|
||||
public DataRectangle LockRectangle(int level, LockFlags flags) { return null; }
|
||||
public void UnlockRectangle(int level) { }
|
||||
|
||||
public static Texture FromStream(System.IO.Stream stream) { return null; }
|
||||
public static Texture FromStream(System.IO.Stream stream, int length, int width, int height, int levels, Usage usage, Format format, Pool pool) { return null; }
|
||||
}
|
||||
|
||||
public class CubeTexture : BaseTexture
|
||||
{
|
||||
public CubeTexture(int size, int levels, Usage usage, Format format, Pool pool) { }
|
||||
|
||||
public DataRectangle LockRectangle(CubeMapFace face, int level, LockFlags flags) { return null; }
|
||||
public void UnlockRectangle(CubeMapFace face, int level) { }
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Locked buffer writing and reading
|
||||
public class DataRectangle
|
||||
{
|
||||
public DataRectangle(int pitch, DataStream s) { Data = s; Pitch = pitch; }
|
||||
public DataStream Data { get; private set; }
|
||||
public int Pitch { get; private set; }
|
||||
}
|
||||
|
||||
public class DataStream : IDisposable
|
||||
{
|
||||
public void Seek(long offset, System.IO.SeekOrigin origin) { }
|
||||
public void Write(ushort v) { }
|
||||
public void Write(Array data, long offset, long size) { }
|
||||
public void WriteRange(Array data) { }
|
||||
public void WriteRange(Array data, long offset, long size) { }
|
||||
public void WriteRange(IntPtr data, long size) { }
|
||||
public void Dispose() { }
|
||||
|
||||
public void ReadRange(Array data, long offset, long size) { }
|
||||
|
||||
public bool CanRead { get; private set; }
|
||||
public bool CanWrite { get; private set; }
|
||||
public long Length { get; private set; }
|
||||
public IntPtr DataPointer { get; private set; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Enumerations
|
||||
namespace Direct3D9
|
||||
{
|
||||
public enum RenderState
|
||||
{
|
||||
AlphaBlendEnable,
|
||||
AlphaFunc,
|
||||
AlphaRef,
|
||||
AlphaTestEnable,
|
||||
CullMode,
|
||||
BlendOperation,
|
||||
SourceBlend,
|
||||
DestinationBlend,
|
||||
FillMode,
|
||||
FogEnable,
|
||||
FogColor,
|
||||
FogStart,
|
||||
FogEnd,
|
||||
MultisampleAntialias,
|
||||
TextureFactor,
|
||||
ZEnable,
|
||||
ZWriteEnable
|
||||
}
|
||||
|
||||
public enum Compare { GreaterEqual }
|
||||
public enum Cull { None, Counterclockwise }
|
||||
public enum Blend { InverseSourceAlpha, SourceAlpha, One, BlendFactor }
|
||||
public enum BlendOperation { Add, ReverseSubtract }
|
||||
public enum FillMode { Solid, Wireframe }
|
||||
public enum TransformState { World, View, Projection }
|
||||
public enum SamplerState { AddressU, AddressV, AddressW }
|
||||
public enum TextureAddress { Wrap, Clamp }
|
||||
public enum ClearFlags { Target, ZBuffer }
|
||||
public enum Format { Unknown, A8R8G8B8 }
|
||||
public enum Usage { None, WriteOnly, Dynamic, RenderTarget }
|
||||
public enum VertexFormat { None }
|
||||
public enum Pool { Default, Managed, SystemMemory }
|
||||
public enum LockFlags { None, Discard }
|
||||
public enum MeshFlags { Use32Bit, IndexBufferManaged, VertexBufferManaged, Managed }
|
||||
public enum ShaderFlags { None, Debug }
|
||||
public enum PrimitiveType { LineList, TriangleList, TriangleStrip }
|
||||
public enum CubeMapFace { PositiveX, PositiveY, PositiveZ, NegativeX, NegativeY, NegativeZ }
|
||||
public enum TextureFilter { None, Point, Linear, Anisotropic }
|
||||
public enum DeclarationType { Float2, Float3, Color }
|
||||
public enum DeclarationMethod { Default }
|
||||
public enum DeclarationUsage { Position, Color, TextureCoordinate, Normal }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Matrix, vector, color
|
||||
public struct Matrix
|
||||
{
|
||||
|
@ -502,6 +300,10 @@ namespace SlimDX
|
|||
public MouseState GetCurrentState() { return null; }
|
||||
public void Dispose() { }
|
||||
}
|
||||
|
||||
public class DirectInputException : ApplicationException
|
||||
{
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -519,13 +321,4 @@ namespace SlimDX
|
|||
public static StopWatch Timer { get; set; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Exceptions
|
||||
namespace DirectInput
|
||||
{
|
||||
public class DirectInputException : ApplicationException
|
||||
{
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using SlimDX.Direct3D9;
|
||||
using SlimDX;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
|
||||
|
@ -139,7 +138,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
if(numverts > 0)
|
||||
{
|
||||
// Make a new buffer
|
||||
geobuffer = new VertexBuffer(WorldVertex.Stride * numverts, Usage.WriteOnly | Usage.Dynamic, VertexFormat.None, Pool.Default);
|
||||
geobuffer = new VertexBuffer(WorldVertex.Stride * numverts, Usage.WriteOnly | Usage.Dynamic, Pool.Default);
|
||||
|
||||
// Fill the buffer
|
||||
DataStream bufferstream = geobuffer.Lock(0, WorldVertex.Stride * numverts, LockFlags.Discard);
|
||||
|
|
|
@ -25,7 +25,6 @@ using CodeImp.DoomBuilder.GZBuilder.Data; //mxd
|
|||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
using SlimDX;
|
||||
using SlimDX.Direct3D9;
|
||||
using Plane = CodeImp.DoomBuilder.Geometry.Plane;
|
||||
using CodeImp.DoomBuilder.GZBuilder;
|
||||
|
||||
|
@ -527,7 +526,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
for(int i = 0; i < vertices.Length; i++)
|
||||
{
|
||||
// Make a new buffer
|
||||
geobuffers[i] = new VertexBuffer(WorldVertex.Stride * vertices[i].Length, Usage.WriteOnly | Usage.Dynamic, VertexFormat.None, Pool.Default);
|
||||
geobuffers[i] = new VertexBuffer(WorldVertex.Stride * vertices[i].Length, Usage.WriteOnly | Usage.Dynamic, Pool.Default);
|
||||
|
||||
// Fill the buffer
|
||||
DataStream bufferstream = geobuffers[i].Lock(0, WorldVertex.Stride * vertices[i].Length, LockFlags.Discard);
|
||||
|
@ -617,7 +616,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
// Create buffer
|
||||
WorldVertex[] cv = cageverts.ToArray();
|
||||
cagelength = cv.Length / 2;
|
||||
cagebuffer = new VertexBuffer(WorldVertex.Stride * cv.Length, Usage.WriteOnly | Usage.Dynamic, VertexFormat.None, Pool.Default);
|
||||
cagebuffer = new VertexBuffer(WorldVertex.Stride * cv.Length, Usage.WriteOnly | Usage.Dynamic, Pool.Default);
|
||||
cagebuffer.Lock(0, WorldVertex.Stride * cv.Length, LockFlags.None).WriteRange(cv);
|
||||
cagebuffer.Unlock();
|
||||
|
||||
|
|
Loading…
Reference in a new issue