View Full Version : Overlays and 2D graphics using GL
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
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.
You don't have to draw polygons to draw bitmaps. You can also use glDrawPixels.
Hude, do you have an exemple on how GLDrawPixel works ?
Or can you explain it to me ?
I'd really appreciated,
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.
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...
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...
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.