Loading Bitmaps

Jones
Unregistered
 
Post: #1
I recently got my hands on a copy of "Beginning OpenGL Game Programming", in hopes to learn the essential basics like loading images, in particular. Sadly, the book is a little dissapointing. Near the beginning they tell you that they'll concentrate on GLUT and SDL. Good. I know how to get a GLUT environment up and going, as for SDL, hopefully not knowing it won't cripple the use of the book. However, the second thing they do is throw a bunch of non-glut-or-sdl microsoft window code at you. Hmm. Annoyed

I went through it, learning some useful stuff like lights and lightmapping, and a little about the matrice stack. Anyway, once arrived at chapter 6 I'm looking forward to finally being able to load images for games! Yay!

Wait... no yay. The example is quite complicated for the first use of any image manipulation seen so far in the book. I'm a BEGINNER, I want something simple to start with! Not something split accross 2 different C++ files with multiple functions and full use of C++'s psycho mutated function/structure system, which I hate, by the way.

It seems that when I look at image loading tutorials, they are A)dependant on non-mac libraries B)somewhat poorly explained (like NeHe's) or C) way to complicated to begin with. I've looked at SDL at it's loadImage commands seem quite useful, but I don't really want to have to learn SDL and OpenGL at the same time to accomplish only one goal. I just want to learn how to load a bitmap through the stdio and built in OpenGL functions, unless there's a compact and quick library out there than can handle this on a Mac. (Related: Where should I start when it comes to intergrating SDL into a GLUT program seemlessly?)

Anyway... sorry about complaining. Rasp

Thanks, and suggestions would be greatly appreciated!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
SDL and GLUT are mutually exclusive.

QuickTime is the easiest way to load an OpenGL texture on the Mac. http://onesadcookie.com/svn/repos/QTValuePak has code for it, but do read the warning first Wink

You can also use ImageIO -- see http://gamewiki.evolpenguin.com/index.ph...re_Loading . That code also doesn't work on Intel Macs, but is as easily fixable as the other.

If you want something cross-platform, you're looking at libjpeg and libpng, neither of which is fun to work with.
Quote this message in a reply
Jones
Unregistered
 
Post: #3
Hmm, it's non-portable and apparently broken, perhaps not the best choice. Smile (The quicktime thing!)

By "mutually exclusive" do you mean: "Can't and certainly won't work with each other."

Thanks!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
I'm not really suggesting that that's the code you'll use forever, but it is an easy way to get up and running.

Yes, I mean they won't work together. They do the same things as each other (providing windows and handling events).
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Drawing bitmaps in OpenGL MacGoober 21 20,833 Sep 22, 2007 05:50 PM
Last Post: MikeC
  Loading textures from bitmaps tehqin 5 3,768 Feb 26, 2007 01:58 AM
Last Post: unknown
  OpenGL, SDL, and Transparent Bitmaps RyanA 4 3,805 Jun 26, 2006 04:26 PM
Last Post: RyanA
  Question about handling non power-of-two bitmaps Malarkey 9 4,024 Apr 23, 2005 09:11 AM
Last Post: Malarkey