View Full Version : Overlays and 2D graphics using GL

03-04-2000, 06:37 PM
Greetings, I am coding a 3D game, and although the main screen is 3D, I of course wanna do a 2D interface. I also need to be able to draw images (.bmp files) on this interface
I know how to do this using DirectDraw, but not with GL
Any help would be appreciated


03-04-2000, 07:47 PM
To have your 2d interface, you just disable writing to the depth buffer and you use glOrtho. There is a simpler way with gluOrtho2D. You only to set the lower left corner and the width and the height of your projection.

To draw bitmaps, you'll have to draw a polygon and texture map it using your bitmap.

03-05-2000, 09:36 PM
You don't have to draw polygons to draw bitmaps. You can also use glDrawPixels.

03-06-2000, 09:25 AM
Hude, do you have an exemple on how GLDrawPixel works ?
Or can you explain it to me ?
I'd really appreciated,


03-06-2000, 01:18 PM
that's right, you can use glDrawPixels, but it is extremely slow on PC. Using polygons is much more efficient and not really more complex.

03-06-2000, 05:20 PM
In any case, Gorg could you point me out to an exemple of some sort using your technique (glOrtho...) please ?
Just to get me started...


03-06-2000, 08:57 PM
There was some document with OGLSDK, in which they told how to make glDrawPixels fast. You had to disable almost every OpenGL state in order to do it. Never tested it though...