drawing images with opengl.

xDexx
Unregistered
 
Post: #1
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)
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
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/
Quote this message in a reply
Member
Posts: 196
Joined: 2002.04
Post: #3
Try searching for glCubes in the idevgames source code section.

Hope this helps,
Iceman
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #4
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
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
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 Smile
Quote this message in a reply
xDexx
Unregistered
 
Post: #6
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
Quote this message in a reply
Member
Posts: 196
Joined: 2002.04
Post: #7
Well if you're working on carbon then Quicktime would be the only one you could use. GLCubes is in cocoa. Blush Sorry I should've asked that first.

Iceman
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL ES Loading images techy 4 3,917 Dec 24, 2009 02:01 PM
Last Post: techy
  opengl text/font drawing from CGContext fretmunky 11 13,072 Dec 7, 2008 11:29 AM
Last Post: fretmunky
  OpenGL ES - Drawing a simple cube help. MattCairns 7 12,608 Oct 10, 2008 05:26 PM
Last Post: Frogblast
  Drawing bitmaps in OpenGL MacGoober 21 22,146 Sep 22, 2007 05:50 PM
Last Post: MikeC
  drawing 2D images (from png) Najdorf 7 3,565 Jan 18, 2006 03:30 PM
Last Post: KiroNeem