The specific method is to switch the projection modeParallel projectionAnd then draw the 2D image, and map it to the two-dimensional screen.
Note: The 2D transparent scene information panel is under the 3D drawing area.PurpleTransparent area
CoreCodeAs follows:
Void glarea: displayinfo () {// enter in 2D Screen mode againglmatrixmode (gl_projection); glpushmatrix (); glloadidentity (); glortho (-1, 1,-1,-1 ); glmatrixmode (gl_modelview); glpushmatrix (); glloadidentity (); glpushattrib (scheme); gldisable (gl_lighting); gldisable (scheme); gl_blend ); glblendfunc (gl_one, gl_src_alpha); // set display info pane color glcolor (logareacolor); // barheight is the height of paneglbegin (gl_quads); glvertex2f (-1.f, barheight ); glvertex2f (-1.f,-1.f); glvertex2f (1.f,-1.f); glvertex2f (1.f, barheight); glend ();
// Render text is dismiss // closing 2 dglpopattrib (); glpopmatrix (); // restore modelviewglmatrixmode (gl_projection); glpopmatrix (); glmatrixmode (gl_modelview );}
----------------
Hope to be useful to you! Good luck.