Exemplo n.º 1
0
        public void DisableAttributesOld()
        {
            foreach (var binding in bindings)
            {
                var attribute = binding.Attribute;
                switch (binding.AttributeMapping.DstUsage)
                {
                case VertexUsage.Position:
                {
                    GL.DisableClientState(OpenGL.ArrayCap.VertexArray);
                    break;
                }

                case VertexUsage.Normal:
                {
                    GL.DisableClientState(OpenGL.ArrayCap.NormalArray);
                    break;
                }

                case VertexUsage.Color:
                {
                    GL.DisableClientState(OpenGL.ArrayCap.ColorArray);
                    break;
                }

                case VertexUsage.TexCoord:
                {
                    GL.ClientActiveTexture(OpenGL.TextureUnit.Texture0 + binding.AttributeMapping.DstIndex);
                    GL.DisableClientState(OpenGL.ArrayCap.TextureCoordArray);
                    break;
                }

                default:
                {
                    break;
                }
                }
            }
        }
Exemplo n.º 2
0
        public void SetupAttributePointersOld()
        {
            foreach (var binding in bindings)
            {
                var attribute = binding.Attribute;
                switch (binding.AttributeMapping.DstUsage)
                {
                case VertexUsage.Position:
                {
                    GL.EnableClientState(OpenGL.ArrayCap.VertexArray);
                    GL.VertexPointer(
                        attribute.Dimension,
                        (OpenGL.VertexPointerType)attribute.Type,
                        binding.Stride,
                        attribute.Offset
                        );
                    break;
                }

                case VertexUsage.Normal:
                {
                    GL.EnableClientState(OpenGL.ArrayCap.NormalArray);
                    GL.NormalPointer(
                        (OpenGL.NormalPointerType)attribute.Type,
                        binding.Stride,
                        attribute.Offset
                        );
                    break;
                }

                case VertexUsage.Color:
                {
                    if ((attribute.Dimension != 3) && (attribute.Dimension != 4))
                    {
                        //  \todo
                        continue;
                    }
                    GL.EnableClientState(OpenGL.ArrayCap.ColorArray);
                    GL.ColorPointer(
                        attribute.Dimension,
                        (OpenGL.ColorPointerType)attribute.Type,
                        binding.Stride,
                        attribute.Offset
                        );
                    break;
                }

                case VertexUsage.TexCoord:
                {
                    GL.ClientActiveTexture(OpenGL.TextureUnit.Texture0 + binding.AttributeMapping.DstIndex);
                    GL.EnableClientState(OpenGL.ArrayCap.TextureCoordArray);
                    GL.TexCoordPointer(
                        attribute.Dimension,
                        (OpenGL.TexCoordPointerType)attribute.Type,
                        binding.Stride,
                        attribute.Offset
                        );
                    break;
                }

                default:
                {
                    break;
                }
                }
            }
        }