Some games have both 2D and 3D graphics, with the 2D graphics usually being some kind of status display. This is no problem for either software rendering or OpenGL-in-a-window rendering on a 2D/3D card.
However, some cards do not support OpenGL in a window, such as the older 3dfx ones, and I'm asking what might be the best way to get the 2D graphics displayed.
One way to draw the 2D parts in an offscreen buffer and then blit them to the screen with glDrawPixels(). This could be made smarter by only blitting the updated parts.
How well does that solution work in practice? I'm especially interested in considering that as a source-code improvement for Bungie's Marathon engine (http://source.bungie.org).
You see…this is the thing that pisses me off about OpenGL…the fact that you can’t efficiently mix 2D bitmaps with 3D scenes.This totally blows! If I want to use bitmaps then I should! I don’t have to resort to using textured polygons.
Forgive me if I sould aggressive,but I have spent alot of time studying OpenGL only to come to something this trivial and find out I can’t mix 2D bitmaps with my 3D scene. Now I have to resort to using DirectX which means I have to spend MORE time studying another API and then I have to convert ALL my code…Unless of course the next release of OpenGL will fix this whole bitmap mess, I really don’t have any other choice.
I can understand your frustration, but I wouldn’t say that this is a “bug” in OpenGL, it just helps keep everything a little more homogeneous. If you do move to DirectX, please keep in mind that it is highly recommended that, when using 3D, you should draw 2D bitmaps on polygons (same as OpenGL). The reason for this is that the switch from 3D to 2D and back is fairly expensive, so it’s much more efficient to stay in the Direct3D mode whenever possible. The technical details are explained somwhere in the depths of the D3D docs. So, moving to DirectX won’t make your life any easier (if you do things “right”). I’m assuming that this expensive mode switching in the reason OpenGL works this way also. The way I get around it in C++ is to create a class that knows how to draw bitmaps as textured polygons and then I only deal with that class…