Пример #1
0
        private void ClearBackground(uint cx, uint cy)
        {
            GSEffect solid = Obs.GetBaseEffect(ObsBaseEffect.Solid);

            solid.SetParameterValue("color", new Vector4(0.0f, 0.0f, 0.0f, 1.0f));

            GSEffectTechnique tech = solid.GetTechnique("Solid");

            GS.TechniqueBegin(tech);
            GS.TechniqueBeginPass(tech, 0);

            GS.MatrixPush();
            GS.MatrixIdentity();
            GS.MatrixScale3f((float)cx, (float)cy, 1.0f);

            GS.LoadVertexBuffer(boxPrimitive);

            //draw solid black color over the scene
            GS.Draw(GSDrawMode.TrisStrip, 0, 0);

            GS.MatrixPop();

            GS.TechniqueEndPass(tech);
            GS.TechniqueEnd(tech);

            GS.LoadVertexBuffer(null);
        }
Пример #2
0
        private void RenderSceneEditing(IntPtr data)
        {
            if (scene == null)
            {
                return;
            }

            // draw selection outlines

            GSEffect solid = Obs.GetBaseEffect(ObsBaseEffect.Solid);

            solid.SetParameterValue("color", new Vector4(1.0f, 1.0f, 1.0f, 0.6f));

            GSEffectTechnique tech = solid.GetTechnique("Solid");

            GS.TechniqueBegin(tech);
            GS.TechniqueBeginPass(tech, 0);

            scene.EnumItems(DrawSelectedItem, data);

            GS.TechniqueEndPass(tech);
            GS.TechniqueEnd(tech);

            // hover outlines

            solid.SetParameterValue("color", new Vector4(1.0f, 1.0f, 1.0f, 0.40f));
            tech = solid.GetTechnique("Solid");

            GS.TechniqueBegin(tech);
            GS.TechniqueBeginPass(tech, 0);

            if (hoveredItem != null)
            {
                DrawHoveredItem(scene, hoveredItem, data);
            }

            GS.TechniqueEndPass(tech);
            GS.TechniqueEnd(tech);

            GS.LoadVertexBuffer(null);
        }