You may have better luck asking NDK questions on the [android-ndk] Google Group.

On Sat, Aug 13, 2011 at 11:35 AM, Shoot <[email protected]> wrote:
> I have problem draw texture.
> It draw white plan.
> Thank
>
> #define TEXTURE_SIZE 100
> void drawImage() {
>    glEnable(GL_TEXTURE_2D);
>    //Coordinate
>    coordinatesBuffer[0] = 0.0;
>    coordinatesBuffer[1] = 0.0;
>
>    coordinatesBuffer[2] = 1.0;
>    coordinatesBuffer[3] = 0.0;
>
>    coordinatesBuffer[4] = 0.0;
>    coordinatesBuffer[5] = 1.0;
>
>    coordinatesBuffer[6] = 1.0;
>    coordinatesBuffer[7] = 1.0;
>
>    //Vertices
>    verticesBuffer[0] = -(TEXTURE_SIZE/2);
>    verticesBuffer[1] = -(TEXTURE_SIZE/2);
>    verticesBuffer[2] = 0;
>
>    verticesBuffer[3] = (TEXTURE_SIZE/2);
>    verticesBuffer[4] = -(TEXTURE_SIZE/2);
>    verticesBuffer[5] = 0;
>
>    verticesBuffer[6] = -(TEXTURE_SIZE/2);
>    verticesBuffer[7] = (TEXTURE_SIZE/2);
>    verticesBuffer[8] = 0;
>
>    verticesBuffer[9] = (TEXTURE_SIZE/2);
>    verticesBuffer[10] = (TEXTURE_SIZE/2);
>    verticesBuffer[11] = 0;
>
>    glTranslatef(0.0f+(TEXTURE_SIZE/2),0.0f+(TEXTURE_SIZE/2),0.0f);
>
>    glVertexPointer(3, GL_FLOAT, 0, verticesBuffer);
>    glEnableClientState(GL_VERTEX_ARRAY);
>
>    glTexCoordPointer(2, GL_FLOAT, 0, coordinatesBuffer);
>    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
>    // Bind the texture
>    glActiveTexture ( GL_TEXTURE0 );
>    glBindTexture ( GL_TEXTURE_2D,textureIds);
>
>    glEnable(GL_TEXTURE_2D);
>
>    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
> }
>
> --
> 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
>



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.6 Available!

-- 
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