コード例 #1
0
        private void ApplyVertexArray(VertexArray vertexArray)
        {
            VertexArrayGL3x vertexArrayGL3x = (VertexArrayGL3x)vertexArray;

            vertexArrayGL3x.Bind();
            vertexArrayGL3x.Clean();
        }
コード例 #2
0
        public override void Draw(PrimitiveType primitiveType, DrawState drawState, SceneState sceneState)
        {
            VerifyDraw(drawState, sceneState);
            ApplyBeforeDraw(drawState, sceneState);

            VertexArrayGL3x vertexArray = (VertexArrayGL3x)drawState.VertexArray;
            IndexBufferGL3x indexBuffer = vertexArray.IndexBuffer as IndexBufferGL3x;

            if (indexBuffer != null)
            {
                GL.DrawRangeElements(TypeConverterGL3x.To(primitiveType),
                                     0, vertexArray.MaximumArrayIndex(), indexBuffer.Count,
                                     TypeConverterGL3x.To(indexBuffer.Datatype), new IntPtr());
            }
            else
            {
                GL.DrawArrays(TypeConverterGL3x.To(primitiveType), 0,
                              vertexArray.MaximumArrayIndex() + 1);
            }
        }