glfwOpenWindow 和 glReadPixels 模式?

发布于 2024-08-20 06:53:37 字数 284 浏览 3 评论 0原文

假设我打开一个 glfw 窗口:

glfwOpenWindow(width, height, 8,8,8,8,8,8, GLFW_WINDOW);

然后,我尝试用以下内容读回它:

glReadPixels(0, 0, width, height, ..1.., ..2..);

我不确定应该输入什么内容作为 ..1.. 和 ..2.. ;我认为..1..应该是GL_RGBA,但不知道..2..

谢谢!

Suppose I open a glfw window with:

glfwOpenWindow(width, height, 8,8,8,8,8,8, GLFW_WINDOW);

Then, I try to read it back with:

glReadPixels(0, 0, width, height, ..1.., ..2..);

I'm not sure what I should be putting in as ..1.. and ..2.. ; I think ..1.. should be GL_RGBA, but no idea for ..2..

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦在夏天 2024-08-27 06:53:37

不知道是否有帮助,但我在GPWiki上找到了这篇关于glfwOpenWindow的文章glReadPixels 的 openGL 文档

我玩过一点openGL,但没有使用过这些功能。
您可以尝试一些基本的操作,例如:

glfwOpenWindow(width, height, 8,8,8,0,0,0, GLFW_WINDOW);

glReadPixels(0, 0, width, height, GL_RGB, GL_FLOAT);

查看是否获得正确的结果或接近的结果,然后逐步添加您需要的详细信息,例如测试:

glfwOpenWindow(width, height, 8,8,8,8,0,0, GLFW_WINDOW);

然后

glReadPixels(0, 0, width, height, GL_RGBA, GL_FLOAT);

等等。

Don't know if it helps, but I've found this article on GPWiki about glfwOpenWindow and the openGL docs for glReadPixels.

I've played with openGL a bit, but I haven't used these functions.
Could you try something basic like:

glfwOpenWindow(width, height, 8,8,8,0,0,0, GLFW_WINDOW);

and

glReadPixels(0, 0, width, height, GL_RGB, GL_FLOAT);

And see if you get the right result or anything close, then incrementally add the details you need, like testing:

glfwOpenWindow(width, height, 8,8,8,8,0,0, GLFW_WINDOW);

then

glReadPixels(0, 0, width, height, GL_RGBA, GL_FLOAT);

and so on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文