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

Thread: Loading files and OpenGL

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2001
    Posts
    6

    Loading files and OpenGL

    Hello!
    I want to load images and use them as bitmaps in opengl, whats the easiest approach?

    Say I have a .bmp file and want to use it with the glDrawPixels-function, how do I do?

  2. #2
    Intern Newbie
    Join Date
    Jun 2001
    Location
    North America, .
    Posts
    36

    Re: Loading files and OpenGL

    YOu should not use glDrawPixels, it's toooo sloow!!!!
    Did you know that trekbbs use the same bbs engine???

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2001
    Posts
    6

    Re: Loading files and OpenGL

    Okay, what should I use instead?

  4. #4
    Intern Newbie
    Join Date
    Jun 2001
    Location
    North America, .
    Posts
    36

    Re: Loading files and OpenGL

    glBindTexture
    glTexCoord2f
    etc
    They are faster (a lot) than glDrawPixels.
    Did you know that trekbbs use the same bbs engine???

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    668

    Re: Loading files and OpenGL

    They are faster but they only take 2^n images so, assuming his bmp is a random size, you need to pad the image and then scale it to your quad, this also makes them slow to load. If they don't need to be drawin quickly (i.e. just a bmp viewer) then drawpixels is a lot less hassle and they load quicker....

    gav

Posting Permissions

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