PDA

View Full Version : Overlays and 2D graphics using GL



GLoW
03-04-2000, 07: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

Thanx,
Pascal

Gorg
03-04-2000, 08: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.

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

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

Thanx
Pascal

Gorg
03-06-2000, 02: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.

GLoW
03-06-2000, 06: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...

Pascal

Hude
03-06-2000, 09: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...