Results 1 to 5 of 5

Thread: Texture mapping in Opengl ES ?

  1. #1
    Member
    Join Date
    Oct 2004
    Location
    Bangalore, India
    Posts
    44

    Texture mapping in Opengl ES ?

    Hi,

    I am trying to texture map a quad in opengl es . But it doesn't seem to texture map at all. Is there something that needs to be done differently than in regular opengl ?

    This is the following code I have.


    Code :
     

    Is there anything I should be doing differently ?

    Thanks.
    Gautam

  2. #2
    Senior Member
    Join Date
    Sep 2003
    Location
    Seattle, WA
    Posts
    246

    Re: Texture mapping in Opengl ES ?

    glEnable(GL_TEXTURE_2D);

    At least I don't see it in your listing.

    - HM

  3. #3
    Member
    Join Date
    Oct 2004
    Location
    Bangalore, India
    Posts
    44

    Re: Texture mapping in Opengl ES ?

    Hi,

    I am sorry, that was done in Init(). I'll post the complete code here. I just get a white quad. But I do image info into image_data. Also the image is 5=64x64 (24bits). Hence I am wondering what could be causing this. Also I am on linux so I am using opengl es 1.0.


    Code :
     

    Thanks

  4. #4
    Junior Member
    Join Date
    Oct 2004
    Location
    UK
    Posts
    24

    Re: Texture mapping in Opengl ES ?

    OK, the problem is with glTexImage2D this uploads the texture into the currently bound texture. Even though you have generated an ID with glGenTextures you are not binding that ID prior to uploading your texture data. So after the glGenTextures add :

    glBindTexture(GL_TEXTURE_2D, texture[0]);

    This will make sure the texture data gets uploaded into the correct texture. Most likely your data is being uploaded into the default initial texture, and your specific texture remains empty.

    Hope this helps,

    K-

  5. #5
    Member
    Join Date
    Oct 2004
    Location
    Bangalore, India
    Posts
    44

    Re: Texture mapping in Opengl ES ?

    That worked. Now I have a decent texture.

    Thanks

Similar Threads

  1. Texture mapping on a disk
    By Zelig in forum OpenGL ES 1.X - fixed function hardware
    Replies: 9
    Last Post: 02-18-2013, 08:52 AM
  2. Texture mapping
    By Giacomo in forum OpenGL ES general technical discussions
    Replies: 3
    Last Post: 06-28-2005, 08:04 AM

Posting Permissions

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