[英]Render OpenGL scene at two different locations
I am writing an application that renders an OpenGL scene. 我正在编写一个渲染OpenGL场景的应用程序。 This application has two windows:
该应用程序有两个窗口:
This application is written in .NET (for the control window part) and uses a native C++ DLL to create the rendering window and do the actual OpenGL rendering. 此应用程序用.NET编写(用于控制窗口部分),并使用本机C ++ DLL创建渲染窗口并进行实际的OpenGL渲染。
This works fine, but one important part is still missing: getting a live preview of the rendered scene into my .NET control window. 这可以正常工作,但是仍然缺少一个重要的部分:将渲染场景的实时预览放入我的.NET控制窗口中。
So far I could think of two solutions: 到目前为止,我可以想到两种解决方案:
Option 2 sounds faster, but I have no idea if/how that even works. 选项2听起来更快,但我不知道它是否/如何工作。 Can this be done?
能做到吗? Are there better alternatives?
有更好的选择吗?
Look into the documentation on framebuffers . 查看有关framebuffers的文档。 It is basically the destination of your rendering, by default it's your viewport (or the backbuffer , which switches with the displayed buffer once it's ready).
它基本上是渲染的目标,默认情况下是您的视口(或backbuffer ,一旦准备好,它将与显示的缓冲区一起切换)。
The first option should generally be faster as you render the scene once and then just basically copy a texture. 通常,第一个选项应该更快,因为您一次渲染场景,然后基本上只复制纹理。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.