On Fri, Jan 22, 2010 at 3:06 PM, Lance Nanek <[email protected]> wrote:
> The type of buffer is often specified by a type argument. For the
> glDrawElements method you can see this argument described in the
> Javadoc right before the argument where you are a passing a
> FloatBuffer:
> http://java.sun.com/javame/reference/apis/jsr239/javax/microedition/khronos/opengles/GL10.html#glDrawElements%28int,%20int,%20int,%20java.nio.Buffer%29
>>type - Specifies the type of the values in indices. Must be either 
>>GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT.
>>indices - Specifies a pointer to the location where the indices are stored.
>
> There's an Android example of creating a buffer of indices and passing
> it to the glDrawElements method here:
> http://developer.android.com/intl/fr/resources/samples/ApiDemos/src/com/example/android/apis/graphics/spritetext/Grid.html
>
> Floats don't make any sense for indices. Referring to vertex 1 or 2
> makes sense, referring to vertex 1.5 doesn't. Floats can be used for
> things like coordinates, however. The above API Demo has an example of
> using glVertexPointer with type GL10.GL_FLOAT, for example. You can
> see in the Javadoc that the type argument is described differently for
> the glVertexPointer method:
> http://java.sun.com/javame/reference/apis/jsr239/javax/microedition/khronos/opengles/GL10.html#glVertexPointer%28int,%20int,%20int,%20java.nio.Buffer%29
>>type - Specifies the data type of each vertex coordinate in the array. 
>>Symbolic constants GL_BYTE, GL_SHORT, GL_FIXED, and GL_FLOAT are accepted. 
>>The initial value is GL_FLOAT.


Thank you, this part of your post was most helpful.


-- 
Greg Donald
destiney.com | gregdonald.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to