PDA

View Full Version : Load bitmap images w/o addon engine?



Yargh
05-20-2010, 06:43 PM
Hello, I am a newbie to OpenGL, and am running mac with GLUT. I was wondering if it is possible to load a bitmap image and render it without having to add an external engine, such as SDL, just to keep things simple. If possible, please provide example code.

If it is not easily possible (e.g. having to code a bitmap loader/renderer from scratch), could someone then please suggest me an engine that makes this the easiest without a lot of code?

Thanks in advance for any help.

Note: This will all be using 2D OpenGL if possible, because I am not planning to implement any 3D graphics. I am using C++ and Xcode.

Alfonse Reinheart
05-20-2010, 09:24 PM
If it is not easily possible (e.g. having to code a bitmap loader/renderer from scratch), could someone then please suggest me an engine that makes this the easiest without a lot of code?

There aren't any "engines" for this, but there are several image loading libraries. I suggest FreeImage, but others swear by DevIL or SOIL.

mhagain
05-21-2010, 02:10 AM
A bitmap loading function (I assume you mean a .bmp file) is just about 50-80 lines of code. There's a sample here: http://www.gamedev.net/reference/articles/article1966.asp

Yargh
05-21-2010, 04:38 PM
Thank you for the help