Beispiel #1
0
    public void Render()
    {
        if (OptionsForm.options.ShowGrid)
        {
            float a    = OptionsForm.options.GridOpacity;
            float size = OptionsForm.options.GridSize;
            gridModel.Color = new Color(0.4f, 0.4f, 0.4f, a);

            GL.LineWidth(1f);

            gridModel.Reset();
            gridModel.Scale(size);
            gridModel.Draw();

            gridModel.Color = new Color(0.8f, 0.8f, 0.8f, a);

            GL.LineWidth(3f);

            gridModel.Scale(10f);
            gridModel.Draw();

            GL.LineWidth(1f);
        }

        GL.Enable(EnableCap.StencilTest);
        GL.Clear(ClearBufferMask.StencilBufferBit);
        GL.Disable(EnableCap.StencilTest);

        EMesh.MeshProgram["view"].SetValue(editorCamera.View);
        EMesh.MeshProgram["projection"].SetValue(editorCamera.Projection);
        foreach (EMesh m in Meshes)
        {
            m.Draw();
        }
        foreach (EMesh m in Meshes)
        {
            m.DrawUI();
        }

        GL.Enable(EnableCap.StencilTest);
        GL.Clear(ClearBufferMask.StencilBufferBit);
        GL.Disable(EnableCap.StencilTest);

        Manipulator.Draw();

        selectionBox.Draw();
        meshCreator.Draw();
    }