public unsafe MyDebugMesh(MyRenderMessageDebugDrawMesh message) { vbuffer = MyManagers.Buffers.CreateVertexBuffer( "MyDebugMesh", message.VertexCount, sizeof(MyVertexFormatPositionColor), usage: ResourceUsage.Dynamic); Update(message); }
internal static void DebugMesh(MyRenderMessageDebugDrawMesh message) { if (!m_debugMeshes.ContainsKey(message.ID)) { m_debugMeshes.Add(message.ID, new MyDebugMesh(message)); } else { m_debugMeshes[message.ID].Update(message); } }
internal unsafe void Update(MyRenderMessageDebugDrawMesh message) { edges = !message.Shaded; depth = message.DepthRead; if (message.VertexCount > vbuffer.Capacity) { MyHwBuffers.ResizeVertexBuffer(vbuffer, message.VertexCount); } var mapping = MyMapping.MapDiscard(MyPrimitivesRenderer.RC.DeviceContext, vbuffer.Buffer); for (int i = 0; i < message.VertexCount; i++) { MyVertexFormatPositionColor vert = new MyVertexFormatPositionColor(Vector3.Transform(message.Vertices[i].Position, message.WorldMatrix), message.Vertices[i].Color); mapping.WriteAndPosition(ref vert); } mapping.Unmap(); message.Vertices.Clear(); }
internal unsafe void Update(MyRenderMessageDebugDrawMesh message) { edges = !message.Shaded; depth = message.DepthRead; if (vbuffer.ElementCount < message.VertexCount) { MyManagers.Buffers.Resize(vbuffer, message.VertexCount); } var mapping = MyMapping.MapDiscard(MyPrimitivesRenderer.RC, vbuffer); for (int i = 0; i < message.VertexCount; i++) { MyVertexFormatPositionColor vert = new MyVertexFormatPositionColor(Vector3.Transform(message.Vertices[i].Position, message.WorldMatrix), message.Vertices[i].Color); mapping.WriteAndPosition(ref vert); } mapping.Unmap(); message.Vertices.Clear(); }
public unsafe MyDebugMesh(MyRenderMessageDebugDrawMesh message) { vbuffer = MyHwBuffers.CreateVertexBuffer(message.VertexCount, sizeof(MyVertexFormatPositionColor), BindFlags.VertexBuffer, ResourceUsage.Dynamic, null, "MyDebugMesh"); Update(message); }
internal static void DebugMesh(MyRenderMessageDebugDrawMesh message) { if (!m_debugMeshes.ContainsKey(message.ID)) m_debugMeshes.Add(message.ID, new MyDebugMesh(message)); else m_debugMeshes[message.ID].Update(message); }
public unsafe MyDebugMesh(MyRenderMessageDebugDrawMesh message) { vbuffer = MyHwBuffers.CreateVertexBuffer(message.VertexCount, sizeof(MyVertexFormatPositionColor), BindFlags.VertexBuffer, ResourceUsage.Dynamic, null, "MyDebugMesh"); Update(message); }