Loading bitmaps in OGL
Author |
Message |
AsianSensation
|
Posted: Sun Apr 25, 2004 4:14 pm Post subject: Loading bitmaps in OGL |
|
|
I was reading through the Nehe OpenGL tutorials, and I saw that when you load a bitmap, you need to have the height and width being exactly some powers of 2. Is there a simple way around it? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Catalyst
![](http://catalyze.mine.nu/jack_of_spades+100.jpg)
|
Posted: Sun Apr 25, 2004 4:46 pm Post subject: (No subject) |
|
|
Simply, no
You could resize the image after loading to memory but before loading to ogl or you could use some 3rd party library that will do this for you. (i recommend DevIL) |
|
|
|
|
![](images/spacer.gif) |
Raugrist
![](http://www.voidspace.org.uk/gallery/silly/thumbnails/tn_big_cup_of_STFU.jpg)
|
Posted: Sun Apr 25, 2004 5:36 pm Post subject: (No subject) |
|
|
Asian, try this. Unless you really had your heart set on writing your own image loader (from the NeHe tutorials), this can prove useful. It'll load pretty much any image format you could want (or at least, any I could want: ie, TGA, JPG... well, that's all I need). And it's got some good options for optimization or efficiency. |
|
|
|
|
![](images/spacer.gif) |
Catalyst
![](http://catalyze.mine.nu/jack_of_spades+100.jpg)
|
Posted: Sun Apr 25, 2004 6:17 pm Post subject: (No subject) |
|
|
I would recommend DevIL over that
http://openil.sourceforge.net/
its loads almost any image format (really simply with ogl)
and saves out in many formats |
|
|
|
|
![](images/spacer.gif) |
|
|