PDA

View Full Version : BitMaps 2D drawing n the like.



12-17-2001, 07:58 AM
Hi I need to know how I can load an manipulate 2d images e.g bitmaps.
I don't want to use glaux as it's obsolete, please help.

This is what im trying to achieve:-

-----------------
| O O O O | The dashes represent a
----------------- bitmapped object and the O's bitmapped buttons, you could imagine it as bitmapped dialog box with bitmapped round
buttons.
Any pointers ideas bit of OpenGL wisom would be greatly appreciated!

Thanks.

Morglum
12-17-2001, 09:26 AM
ok ok ok
You're asking 3 different question, if I understand :
1) how to load bitmaps ?
Don't start from scratch, look for a loader (a piece of code that loads bitmap files from disk) on the internet.
The most common formats are bmp, tga, pcx, jpg, gif, png... If you're interested in tga, look at the thread I've posted last week on the advanced forum ( Best tga loader ). I've had very interesting answers !

2) how to display bitmaps ?
Of course there are pure bitmap-drawing functions in openGL, like glBitmap, glDrawPixels.... But I prefer to use textured quads, because they behave much better (and faster) especially when you want to perform some effects, like scaling, smoothing...

3) how to set up a dialog box in an opengl app ?
Personnaly I like to use glui. It's a simple user interface library for glut applications (I'm assuming that you use glut, otherwise you'll have to deal directly with the windowing system).

Hope that helps...