缺少类似于Win32的
static osg::WindowingSystemInterfaceProxy<Win32WindowingSystem> s_proxy_Win32WindowingSystem("Win32");
osg/GraphicsContext
template<class T>
struct WindowingSystemInterfaceProxy
{
WindowingSystemInterfaceProxy(const std::string& name)
{
_wsi = new T;
_wsi->setName(name);
osg::GraphicsContext::getWindowingSystemInterfaces()->addWindowingSystemInterface(_wsi.get());
}
~WindowingSystemInterfaceProxy()
{
osg::GraphicsContext::getWindowingSystemInterfaces()->removeWindowingSystemInterface(_wsi.get());
}
osg::ref_ptr<T> _wsi;
};
可以自定义一个接口
class EmbeddedWindowingSystem : public osg::GraphicsContext::WindowingSystemInterface
{
public:
osg::GraphicsContext *createGraphicsContext(osg::GraphicsContext::Traits *traits) override {
osg::ref_ptr<osgViewer::GraphicsWindowEmbedde

本文探讨了C++中GraphicsWindowEmbedded类为何没有提供类似于Win32的窗体接口,并提出了解决方案,即自定义窗体接口进行注册。适合对C++图形界面编程感兴趣的读者。
最低0.47元/天 解锁文章
15万+

被折叠的 条评论
为什么被折叠?



