Reference: http://www.cppblog.com/hitmaen/archive/2007/05/22/24589.html
Reference: http://www.360doc.com/content/13/0906/11/593831_312575920.shtml
Reference: http://blog.csdn.net/windows_nt/article/details/7495387
(Owed by: Spring Night rain Http://blog.csdn.net/chunyexiyu reprint please indicate the source)
To implement adding a navigation window on a ogre-three-dimensional window
There are two ways, one is to use the Ogre multi-viewport implementation, one is to use Windows transparent window implementation
The following uses Ogre 's multi-viewport to achieve
//-------------------------------------------------------------------------------------------------------------
First create a second Camera
// picture-in -Pictures camera M_pcamerainner =m_pscenemanager,createcamera("Innercam"); // Create a camera named Playercam M_pcamerainner-setposition(Vector3(0,0,500)); // setting the camera's location M_pcamerainner-lookAt(Vector3(0,0,0)); // the direction of the camera M_pcamerainner,setnearclipdistance(5); // Close-up clipping of position units |
Then create a second ViewPort, which ViewPort the corner of the window
// picture in the picture viewport Viewport *vpinner =M_pwindow,addviewport(m_pcamerainner, 1 , 0.75, 0, 0.25, 0.25); // place in top left corner Vpinner-setbackgroundcolour(colourvalue(0, 0, 1)); // Set Background Vpinner,setoverlaysenabled(false); // do not enable overlay M_pcamerainner-setaspectratio(Real(VP-getactualwidth())/ Real (VP-getactualheight())); // Viewport aspect ratio |
use Windows 's transparent window for the following now
//-------------------------------------------------------------------------------------------------------------
A. First, create a borderless dialog box,
B. then set the transparent form properties in the OnInitDialog of the dialog box, set the transparency
// set the form to translucent SetWindowLong (m_hwnd,gwl_exstyle, getwindowlong(m_hwnd,gwl_exstyle) | ws_ex_layered); setlayeredwindowattributes (0,lwa_alpha); |
c. Adjust the position of the form to the upper left corner
D. you can use OpenGL to draw elements in a form
This creates the effect of the PIP, and the effect of this painting is a translucent effect.
(Owed by: Spring Night rain Http://blog.csdn.net/chunyexiyu reprint please indicate the source)
ogre-Adding a small navigation window to a three-dimensional window