Results 1 to 2 of 2

Thread: Using glTexImage2D with GL_ALPHA

  1. #1

    Using glTexImage2D with GL_ALPHA

    I am trying to use GL_ALPHA as internal format in glTexImage2D.
    My code goes like follows :

    Code :
    GLubyte data[4] ={255,16,8,64};
    glGenTextures(1, &textureId);
    glActiveTexture ( GL_TEXTURE0 );
    glBindTexture(GL_TEXTURE_2D, textureId);
    glTexImage2D ( GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, pixels );

    Here I am a bit confused about width and height values .
    When I am assigning (2 ,2) I am not getting expected output , because glReadPixels() doesn't return any pixel with alpha value 8 or 64.

    Am I doing something wrong ?

  2. #2

    Re: Using glTexImage2D with GL_ALPHA

    Issue resolved

Similar Threads

  1. GL_FLOAT in glTexImage2D?
    By CROMA in forum OpenGL ES 2X - for programmable 3D graphics pipelines
    Replies: 0
    Last Post: 06-08-2012, 04:05 AM
  2. about glTexImage2D
    By freesui1984 in forum OpenGL ES general technical discussions
    Replies: 7
    Last Post: 07-21-2008, 07:35 PM
  3. a question about glTexImage2D
    By wycwang in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 11-13-2007, 12:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts