Esempio n. 1
0
        public void DrawCube(Matrix world, bool isSelected, float multiplier = 0.5f)
        {
            renderData.worldViewProjection = Matrix.Scaling(multiplier) * world * viewProjection;
            renderData.Color = isSelected ? selectedColor : normalColor;

            device.SetCullModeNone();
            device.ApplyRasterState();
            device.SetBlendStateAlphaBlend();
            device.UpdateAllStates();

            device.UpdateData(basicBuffer, renderData);
            device.DeviceContext.VertexShader.SetConstantBuffer(0, basicBuffer);
            basicShader.Apply();

            Cube.Draw(device);
        }