Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: two things...

  1. #1
    Intern Newbie
    Join Date
    Mar 2002
    Posts
    38

    two things...

    first... my when adding my textures to my tiles.. they are upside down and backwards???? i brought a screenshot into photoshop and had to turn 180 degrees and flip horizontaly to get it to look right...

    to display my tiles i am using..


    glBindTexture(GL_TEXTURE_2D, tiles[tile]);
    glBegin(GL_QUADS);
    glTexCoord2f(0.0f,0.0f);
    glVertex2f(drawingx, drawingy);
    glTexCoord2f(1.0f,0.0f);
    glVertex2f(drawingx + 32, drawingy);
    glTexCoord2f(1.0f,1.0f);
    glVertex2f(drawingx + 32, drawingy + 32);
    glTexCoord2f(0.0f,1.0f);
    glVertex2f(drawingx,drawingy + 32);
    glEnd();


    any ideas?


    also.. the textures I am loading.. (bitmaps) are being antialised... meaning blured a little. how do I stop that? i want sharp pixels..

  2. #2
    Intern Newbie
    Join Date
    Mar 2002
    Posts
    38

    Re: two things...

    nevermind about 2 just please help with the first thing.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    California, USA
    Posts
    167

    Re: two things...

    Hi. Bitmaps by default are stored "upside down." You can do what you did and save it upside down in Photoshop, or flip it using glPixelZoom()

    Old GLman

  4. #4
    Intern Newbie
    Join Date
    Mar 2002
    Posts
    38

    Re: two things...

    where would i put this glPixelZoom(1.0,-1.0); ?

    [This message has been edited by method5 (edited 03-28-2002).]

  5. #5
    Junior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    California, USA
    Posts
    167

    Re: two things...

    Hi. After you have loaded the .bmp and before you make the call to glTexImage2d(), or glDrawPixels() etc... So:
    glPixelZoom(-1.0f, 1.0f); // flip it horizontally baby!
    glPixelZoom( 1.0f,-1.0f); // flip it right side up baby!

    lol
    Old GLman

    [This message has been edited by Old GLman (edited 03-28-2002).]

  6. #6
    Intern Newbie
    Join Date
    Mar 2002
    Posts
    38

    Re: two things...

    ive tried it a few places.. and it doenst seem to be working.. do you have aim (kdghsu) or icq (21159213)? thank you

  7. #7
    Intern Newbie
    Join Date
    Mar 2002
    Posts
    38

    Re: two things...

    is there something you have to do it enable it first before you can use those?

  8. #8
    Junior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    California, USA
    Posts
    167

    Re: two things...

    Hi. I know for a fact that glPixelZoom() can be used to flip .bmps, I have done it myself. It is probably working, but not positioned right. In other words it may just not be in view. Set the raster position with glRasterPos2f().
    Let me know if you have any more problems.
    Old GLman

    [This message has been edited by Old GLman (edited 03-28-2002).]

  9. #9
    Intern Newbie
    Join Date
    Mar 2002
    Posts
    38

    Re: two things...

    it just dosent want to work for me.. anyone willing to take a look at my code.. if so please post your email

  10. #10
    Junior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    California, USA
    Posts
    167

    Re: two things...

    Ok, ill aim you in one sec. We'll figure this out.

    EDIT: Hey I cant help you if your not on aim or icq.. hehe

    Old GLman

    [This message has been edited by Old GLman (edited 03-28-2002).]

Posting Permissions

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