您可以在不打开窗口的情况下创建OpenGL上下文吗? [英] Can you create OpenGL context without opening a window?

查看:114
本文介绍了您可以在不打开窗口的情况下创建OpenGL上下文吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候,我会碰到一些我想要获取OpenGL帧缓冲区对象的地方,但是我对打开任何类型的窗口都不感兴趣.

Occassionally I hit places where I'd want to get an OpenGL framebuffer object, but where I'm not interested about opening a window of any kind.

是否可以创建一个opengl上下文而不将其附加到任何类型的窗口上?

Is it possible to create an opengl context without attaching it to a window of any kind?

推荐答案

是的!您可以将桌面窗口用作传递给OpenGL的窗口,只要您不尝试在窗口上显示任何内容即可;)

Yes! you can use the desktop window as the window passed to OpenGL- as long as you don't try to display anything on it ;)

只需调用 GetDesktopWindow 并传递结果作为创建新OpenGL窗口时的参数.

Just Call GetDesktopWindow and pass the result as an argument when creating new OpenGL window.

这篇关于您可以在不打开窗口的情况下创建OpenGL上下文吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆