internal unsafe void Init(MyRenderInstanceBufferType type) { if (type == MyRenderInstanceBufferType.Cube) { m_input = m_input.Append(MyVertexInputComponentType.CUBE_INSTANCE, 2, MyVertexInputComponentFreq.PER_INSTANCE); m_stride = sizeof(MyVertexFormatCubeInstance); } else if (type == MyRenderInstanceBufferType.Generic) { m_input = m_input.Append(MyVertexInputComponentType.GENERIC_INSTANCE, 2, MyVertexInputComponentFreq.PER_INSTANCE); m_stride = sizeof(MyVertexFormatGenericInstance); } m_type = type; }
internal unsafe void Construct(MyRenderInstanceBufferType type) { m_capacity = 0; m_input = MyVertexInputLayout.Empty; if (type == MyRenderInstanceBufferType.Cube) { m_input.Append(MyVertexInputComponentType.CUBE_INSTANCE, 2, MyVertexInputComponentFreq.PER_INSTANCE); m_stride = sizeof(MyVertexFormatCubeInstance); } else if (type == MyRenderInstanceBufferType.Generic) { m_input.Append(MyVertexInputComponentType.GENERIC_INSTANCE, 2, MyVertexInputComponentFreq.PER_INSTANCE); m_stride = sizeof(MyVertexFormatGenericInstance); } m_type = type; VertexBuffer = VertexBufferId.NULL; }
internal unsafe void Construct(MyRenderInstanceBufferType type) { m_capacity = 0; m_input = MyVertexInputLayout.Empty; if(type == MyRenderInstanceBufferType.Cube) { m_input.Append(MyVertexInputComponentType.CUBE_INSTANCE, 2, MyVertexInputComponentFreq.PER_INSTANCE); m_stride = sizeof(MyVertexFormatCubeInstance); } else if (type == MyRenderInstanceBufferType.Generic) { m_input.Append(MyVertexInputComponentType.GENERIC_INSTANCE, 2, MyVertexInputComponentFreq.PER_INSTANCE); m_stride = sizeof(MyVertexFormatGenericInstance); } m_type = type; VertexBuffer = VertexBufferId.NULL; }