Exemple #1
0
 private void drawPrimitiveElement(PrimitiveDrawingElement p)
 {
     //drawPrimitiveElement(p, 1.0f);
 }
Exemple #2
0
 private void drawPrimitiveElement(PrimitiveDrawingElement p, float alpha)
 {
     // float temp = effect.Alpha;
     //effect.Alpha = alpha;
     //effect.World = p.transform;
     //foreach (EffectPass ep in effect.CurrentTechnique.Passes)
     //{
     //    ep.Apply();
     //    if (p.primitiveCount > 0)
     //    {
     //        gdm.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>(p.type, p.vertices, p.vertexOffset, p.primitiveCount);
     //    }
     //}
     //effect.Alpha = temp;
 }
Exemple #3
0
 public void drawSinglePrimitiveElement(PrimitiveDrawingElement p)
 {
     drawSinglePrimitiveElement(p, 1.0f);
 }
Exemple #4
0
 public void drawSinglePrimitiveElement(PrimitiveDrawingElement p, float alpha)
 {
     endBatch();
     drawPrimitiveElement(p);
     beginBatch();
 }
Exemple #5
0
 public void drawPrimitiveElements(PrimitiveDrawingElement[] elements)
 {
     drawPrimitiveElements(elements, 1.0f);
 }
Exemple #6
0
 public void drawPrimitiveElements(PrimitiveDrawingElement[] elements, float alpha)
 {
     endBatch();
     foreach (var element in elements)
     {
         drawPrimitiveElement(element, alpha);
     }
     beginBatch();
 }
Exemple #7
0
        private void initializeLetterBox()
        {
            if (!isLetterBoxing) return;

            VertexPositionColor[] letterboxVertices = new VertexPositionColor[4];
            letterboxVertices[0] = new VertexPositionColor(Vector3.Zero, Constants.LETTERBOX_COLOR);
            letterboxVertices[1] = new VertexPositionColor(Vector3.UnitX, Constants.LETTERBOX_COLOR);
            letterboxVertices[2] = new VertexPositionColor(Vector3.UnitY, Constants.LETTERBOX_COLOR);
            letterboxVertices[3] = new VertexPositionColor(new Vector3(1, 1, 0), Constants.LETTERBOX_COLOR);

            letterBox = new PrimitiveDrawingElement(PrimitiveType.TriangleStrip, letterboxVertices, 0, letterboxVertices.Length - 2, Matrix.Identity);
        }