drawing images with opengl.
i have found this web site http://nate.scuzzy.net/docs/texture/
is this how i would draw an image(bmp,jpg,gif,ect) in opengl? is there a simpler/better way? (i am working in 2d right now)
is this how i would draw an image(bmp,jpg,gif,ect) in opengl? is there a simpler/better way? (i am working in 2d right now)
If you don't mind Mac-only, you can get QuickTime to load your images for you. See QTValuePak — http://203.79.121.211/CVS/
Try searching for glCubes in the idevgames source code section.
Hope this helps,
Iceman
Hope this helps,
Iceman
I used Cocoa's NSImage and NSBitmapImageRep to get image data. It handles a lot of different formats and is a little easier to use than Quicktime.
---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
The problem with NSBitmapImageRep is that you don't have any guarantees that the format the bitmap is in is suitable for sending to OpenGL (and I've encountered cases where it's not), so you have to copy the bits out by hand into your own array before submitting the image if you want to be safe.
At least with QuickTime, you provide the pixel format and buffer that the image gets drawn into, so you can guarantee that that buffer is suitable for submission to OpenGL, no copying required.
IMO, that more than makes up for a few extra function calls
At least with QuickTime, you provide the pixel format and buffer that the image gets drawn into, so you can guarantee that that buffer is suitable for submission to OpenGL, no copying required.
IMO, that more than makes up for a few extra function calls
thanks i will check out quicktime and glcube, i am programming in carbon, i should have mentioned that earlyer. thanks you all your help!
-brett
-brett
Well if you're working on carbon then Quicktime would be the only one you could use. GLCubes is in cocoa.
Sorry I should've asked that first.
Iceman
Sorry I should've asked that first.Iceman
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenGL ES Loading images | techy | 4 | 3,361 |
Dec 24, 2009 02:01 PM Last Post: techy |
|
| opengl text/font drawing from CGContext | fretmunky | 11 | 11,414 |
Dec 7, 2008 11:29 AM Last Post: fretmunky |
|
| OpenGL ES - Drawing a simple cube help. | MattCairns | 7 | 11,013 |
Oct 10, 2008 05:26 PM Last Post: Frogblast |
|
| Drawing bitmaps in OpenGL | MacGoober | 21 | 19,055 |
Sep 22, 2007 05:50 PM Last Post: MikeC |
|
| drawing 2D images (from png) | Najdorf | 7 | 3,268 |
Jan 18, 2006 03:30 PM Last Post: KiroNeem |
|

