private void init(DisposableI parent, BufferLayoutDescI bufferLayoutDesc) { try { video = parent.FindParentOrSelfWithException<Video>(); vertexBuffer = new VertexBuffer(this, bufferLayoutDesc, BufferUsages.Write, VertexBufferTopologys.Triangle, vertices); } catch (Exception e) { Dispose(); throw e; } }
public QuickDraw(DisposableI parent, BufferLayoutDescI bufferLayoutDesc) : base(parent, bufferLayoutDesc) { try { vertexBuffer = new VertexBuffer(this, bufferLayoutDesc, BufferUsages.Write, VertexBufferTopologys.Triangle, vertices); } catch (Exception e) { Dispose(); throw e; } }
private void init(DisposableI parent, BufferLayoutDescI bufferLayoutDesc) { try { video = parent.FindParentOrSelfWithException <Video>(); vertexBuffer = new VertexBuffer(this, bufferLayoutDesc, BufferUsages.Write, VertexBufferTopologys.Triangle, vertices); } catch (Exception e) { Dispose(); throw e; } }
private void init(DisposableI parent, BufferLayoutDescI bufferLayoutDesc, BufferUsages bufferUsage, VertexBufferTopologys vertexBufferTopology, float[] vertices, int[] indices) { try { video = parent.FindParentOrSelfWithException <Video>(); Topology = vertexBufferTopology; var format = new G.VertexFormat[bufferLayoutDesc.Elements.Count]; for (int i = 0; i != bufferLayoutDesc.Elements.Count; ++i) { switch (bufferLayoutDesc.Elements[i].FloatCount) { case 1: format[i] = G.VertexFormat.Float; break; case 2: format[i] = G.VertexFormat.Float2; break; case 3: format[i] = G.VertexFormat.Float3; break; case 4: format[i] = G.VertexFormat.Float4; break; } } if (indices != null && indices.Length != 0) { vertexBuffer = new G.VertexBuffer(vertexCount, indices.Length, format); indexCount = indices.Length; var indicesShort = new ushort[indexCount]; for (int i = 0; i != indexCount; ++i) { indicesShort[i] = (ushort)indices[i]; } vertexBuffer.SetIndices(indicesShort); } else { vertexBuffer = new G.VertexBuffer(vertexCount, format); } vertexBuffer.SetVertices(vertices); } catch (Exception e) { Dispose(); throw e; } }
private void init(DisposableI parent, ShaderI shader, BufferLayoutDescI inputLayoutDesc, bool construct) { if (!construct) { return; } try { video = parent.FindParentOrSelfWithException <Video>(); var inputLayoutDescTEMP = (BufferLayoutDesc)inputLayoutDesc; layout = new VertexDeclaration(inputLayoutDescTEMP.desc); } catch (Exception e) { Dispose(); throw e; } }
private void init(DisposableI parent, BufferLayoutDescI bufferLayoutDesc, BufferUsages bufferUsage, VertexBufferTopologys vertexBufferTopology, float[] vertices, int[] indices) { try { video = parent.FindParentOrSelfWithException <Video>(); Topology = vertexBufferTopology; bufferLayout = new BufferLayout(this, null, bufferLayoutDesc, true); vertexBuffer = new X.VertexBuffer(video.Device, bufferLayout.layout, vertexCount, X.BufferUsage.WriteOnly); Update(vertices, vertexCount); if (indices != null && indices.Length != 0) { indexBuffer = new IndexBuffer(this, usage, indices); } } catch (Exception e) { Dispose(); throw e; } }
internal BufferLayout(DisposableI parent, ShaderI shader, BufferLayoutDescI inputLayoutDesc, bool construct) : base(parent) { init(parent, shader, inputLayoutDesc, construct); }
public BufferLayout(DisposableI parent, ShaderI shader, BufferLayoutDescI desc) : base(parent) { video = parent.FindParentOrSelfWithException <Video>(); this.desc = (BufferLayoutDesc)desc; }
public static BufferLayout New(DisposableI parent, ShaderI shader, BufferLayoutDescI desc) { return(new BufferLayout(parent, shader, desc)); }
public BufferLayout(DisposableI parent, ShaderI shader, BufferLayoutDescI inputLayoutDesc) : base(parent) { init(parent, shader, inputLayoutDesc, false); }
public QuickDraw(DisposableI parent, BufferLayoutDescI bufferLayoutDesc) : base(parent, bufferLayoutDesc) { init(parent, bufferLayoutDesc); }
public VertexBuffer(DisposableI parent, BufferLayoutDescI bufferLayoutDesc, BufferUsages bufferUsage, VertexBufferTopologys vertexBufferTopology, float[] vertices, int[] indices) : base(parent, bufferLayoutDesc, bufferUsage, vertices) { init(parent, bufferLayoutDesc, bufferUsage, vertexBufferTopology, vertices, indices); }
public static QuickDraw New(DisposableI parent, BufferLayoutDescI bufferLayoutDesc) { return new QuickDraw(parent, bufferLayoutDesc); }
public static QuickDraw New(DisposableI parent, BufferLayoutDescI bufferLayoutDesc) { return(new QuickDraw(parent, bufferLayoutDesc)); }
public static VertexBuffer New(DisposableI parent, BufferLayoutDescI bufferLayoutDesc, BufferUsages usage, VertexBufferTopologys topology, float[] vertices, int[] indices) { return(new VertexBuffer(parent, bufferLayoutDesc, usage, topology, vertices, indices)); }
private void init(DisposableI parent, BufferLayoutDescI bufferLayoutDesc, BufferUsages bufferUsage, VertexBufferTopologys vertexBufferTopology, float[] vertices, int[] indices) { try { video = parent.FindParentOrSelfWithException<Video>(); Topology = vertexBufferTopology; bufferLayout = new BufferLayout(this, null, bufferLayoutDesc, true); vertexBuffer = new X.VertexBuffer(video.Device, bufferLayout.layout, vertexCount, X.BufferUsage.WriteOnly); Update(vertices, vertexCount); if (indices != null && indices.Length != 0) indexBuffer = new IndexBuffer(this, usage, indices); } catch (Exception e) { Dispose(); throw e; } }
public static VertexBuffer New(DisposableI parent, BufferLayoutDescI bufferLayoutDesc, BufferUsages usage, VertexBufferTopologys topology, float[] vertices, int[] indices) { return new VertexBuffer(parent, bufferLayoutDesc, usage, topology, vertices, indices); }