سؤال

I'm trying to specify the type of my GL.VertexAttribPointer(...) argument as GL_DOUBLE. This should be valid according to the documentation for this OpenTK function for ES20 (link).

However, the VertexAttribPointerType enum seems to be missing the Double type for OpenTK-1.0. In other words, the following line:

GL.VertexAttribPointer(ATTRIBUTE_COORD2D, 3, VertexAttribPointerType.Double, false, 0, quadVertices); 

..fails to compile since the VertexAttribPointerType only provides the definitions for the following:

using System;
namespace OpenTK.Graphics.ES20
{
    public enum VertexAttribPointerType
    {
        Byte = 5120,
        UnsignedByte,
        Short,
        UnsignedShort,
        Float = 5126,
        Fixed = 5132
    }
}

Is there a work around for this issue? How else are you supposed to specify a double[] of vertices for the vertex shader?

هل كانت مفيدة؟

المحلول

The OpenGL ES 2.0 manual page for glVertexAttribPointer says:

GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_FIXED, or GL_FLOAT are accepted

So the reason for OpenTK not having double is that the underlying framework doesn't seem to support it either. The OpenTK documentation may be suffering from copy-paste error.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top