Based on direct3d 9
1. First, learn how to use d3d 9 to draw basic elements, such as an image.
Reference http://blog.csdn.net/zhmxy555/article/details/8223965
Direct3d renders the five steps. You only need to use the stretchrect function to copy the image memory to gbackbuf in the formal drawing to display the right image.
2. NVIDIA 3D 3D display principle
Reference http://www.klayge.org/2010/11/21/%E5%9C%A8%E7%A8%8B%E5%BA%8F%E4%B8%AD%E4%BD%BF%E7%94%A8nv-3d-vision/
- Place the left and right eye images into a large texture. The width of the large texture is w x 2, and the height is H + 1 (W and H are the width and height of the original image respectively ). The left eye is on the left, and the right eye is on the right.
- Add a special flag to the last line of a large texture (this is the key ).
- Use stretchrect to merge large textures into the back buffer.
- When the back buffer is displayed, It is three-dimensional.
In fact, it is no different from displaying a normal image in 1, but we need to add a flag to the last line of the image to tell nvidia that this is 3D display. (Use Ctrl + T to switch to 3D display mode when displaying the image)
If no logo is added, the normal left and right images are displayed.
A post: http://www.mtbs3d.com/phpBB/viewtopic.php? F = 105 & t = 5072 & SID = 7270d0dc496ee2cb25315259eb50776b