Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: problem with textures while drawing !!!

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2009
    Posts
    17

    problem with textures while drawing !!!

    Hi All,

    I'm building an application where i've rendered various geometries. after rendering geometric objects i'm also trying to put names on them. i'm creating and loading the textures in different file b'coz i'm using freetype for rendering text.

    But after drawing the text all the geometric objects gets transparent each time with different Alpha values. I'm using two channel alpha values for drawing the textures.

    //loading textures
    glTexImage2D( GL_TEXTURE_2D, 0, GL_ALPHA8, width_gl, height_gl, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, expanded_data );

    //setting the properties

    glBindTexture(GL_TEXTURE_2D,textures[i]);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R,GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,GL_NEAREST);


    Where i'm going wrong???
    please correct me. Thanks

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: problem with textures while drawing !!!

    1) Do you think you are an advanced opengl programmer ?
    - YES : then you are wrong.
    - NO : then you post on the wrong forum section.

    Do you need textures on your geometries ? If no, then glDisable(GL_TEXTURE_2D) before drawing. Enable it back before drawing the text.

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2009
    Posts
    17

    Re: problem with textures while drawing !!!

    sorry for posting in a wrong section :P
    thanks for replying i'll try that

Posting Permissions

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