Esempio n. 1
0
 public void IncreaseVertexCount()
 {
     {
         IndexBufferRenderer renderer = this.indexBufferRenderer as IndexBufferRenderer;
         if (renderer != null)
         {
             if (renderer.ElementCount < this.elementCount)
             {
                 renderer.ElementCount++;
             }
             return;
         }
     }
     {
         ZeroIndexBufferRenderer renderer = this.indexBufferRenderer as ZeroIndexBufferRenderer;
         if (renderer != null)
         {
             if (renderer.VertexCount < this.elementCount)
             {
                 renderer.VertexCount++;
             }
             return;
         }
     }
 }
Esempio n. 2
0
 public void DecreaseVertexCount()
 {
     {
         IndexBufferRenderer renderer = this.indexBufferRenderer as IndexBufferRenderer;
         if (renderer != null)
         {
             if (renderer.ElementCount > 0)
             {
                 renderer.ElementCount--;
             }
             return;
         }
     }
     {
         ZeroIndexBufferRenderer renderer = this.indexBufferRenderer as ZeroIndexBufferRenderer;
         if (renderer != null)
         {
             if (renderer.VertexCount > 0)
             {
                 renderer.VertexCount--;
             }
             return;
         }
     }
 }
Esempio n. 3
0
        protected void InitializeVAO()
        {
            IModel model = this.model;

            this.positionBufferRenderer = model.GetPositionBufferRenderer(strin_Position);
            //this.colorBufferRenderer = model.GetColorBufferRenderer(strin_Color);
            this.lineColor = this.model.lineColor;
            //this.normalBufferRenderer = model.GetNormalBufferRenderer(strin_Normal);
            this.indexBufferRenderer = model.GetIndexes();

            this.model = null;

            {
                IndexBufferRenderer renderer = this.indexBufferRenderer as IndexBufferRenderer;
                if (renderer != null)
                {
                    this.elementCount = renderer.ElementCount;
                }
            }
            {
                ZeroIndexBufferRenderer renderer = this.indexBufferRenderer as ZeroIndexBufferRenderer;
                if (renderer != null)
                {
                    this.elementCount = renderer.VertexCount;
                }
            }
        }
Esempio n. 4
0
        protected void InitializeVAO()
        {
            //IModel model = IceCreamModel.GetModel(1, 10, 10);
            IModel model = this.model;

            this.positionBufferRenderer = model.GetPositionBufferRenderer(strin_Position);
            //this.colorBufferRenderer = model.GetColorBufferRenderer(strin_Color);
            this.normalBufferRenderer = model.GetNormalBufferRenderer(strin_Normal);
            this.indexBufferRenderer  = model.GetIndexes();
            IndexBufferRenderer renderer = this.indexBufferRenderer as IndexBufferRenderer;

            if (renderer != null)
            {
                this.indexCount = renderer.ElementCount;
            }
        }
Esempio n. 5
0
        protected void InitializeVAO()
        {
            this.positionBufferRenderer = model.GetPositionBufferRenderer(strposition);
            this.colorBufferRenderer    = model.GetColorBufferRenderer(strcolor);
            //this.texCoordBufferRenderer = ???(strtexCoord);
            this.texCoordBufferRenderer = model.GetTexCoordBufferRenderer(strtexCoord);
            this.indexBufferRenderer    = model.GetIndexes();

            {
                IndexBufferRenderer renderer = this.indexBufferRenderer as IndexBufferRenderer;
                if (renderer != null)
                {
                    this.elementCount = renderer.ElementCount;
                }
            }
            {
                ZeroIndexBufferRenderer renderer = this.indexBufferRenderer as ZeroIndexBufferRenderer;
                if (renderer != null)
                {
                    this.elementCount = renderer.VertexCount;
                }
            }
        }
        protected void InitializeVAO()
        {
            IModel model = this.model;

            this.positionBufferRenderer = model.GetPositionBufferRenderer(strin_Position);
            //this.colorBufferRenderer = model.GetColorBufferRenderer(strin_Color);
            using (var colorBuffer = new ColorBuffer(strin_Color))
            {
                colorBuffer.Alloc(4 * 6);
                for (int i = 0; i < 6; i++)
                {
                    colorBuffer[i * 4 + 0] = new vec2(0, 0);
                    colorBuffer[i * 4 + 1] = new vec2(0, 1);
                    colorBuffer[i * 4 + 2] = new vec2(1, 1);
                    colorBuffer[i * 4 + 3] = new vec2(1, 0);
                }

                this.colorBufferRenderer = colorBuffer.GetRenderer();
            }
            //this.normalBufferRenderer = model.GetNormalBufferRenderer(strin_Normal);
            this.indexBufferRenderer = model.GetIndexes();

            {
                IndexBufferRenderer renderer = this.indexBufferRenderer as IndexBufferRenderer;
                if (renderer != null)
                {
                    this.elementCount = renderer.ElementCount;
                }
            }
            {
                ZeroIndexBufferRenderer renderer = this.indexBufferRenderer as ZeroIndexBufferRenderer;
                if (renderer != null)
                {
                    this.elementCount = renderer.VertexCount;
                }
            }
        }