更改 OpenTK 中的分辨率

发布于 2024-09-26 03:29:37 字数 246 浏览 0 评论 0原文

我一直在寻找这个,我设法找到了改变窗口大小以及如何改变显示器分辨率的方法。

但我似乎无法找到如何告诉 OpenGL 我的视口在哪里以及有多大。

示例:游戏以 400x300 启动,我将窗口扩展到 800x600。我现在有一个 800x600 的窗口,但只有角落里的 400x300 框被渲染。 切换到全屏时我遇到了同样的问题,灰色区域覆盖了整个屏幕,但我只有角落里的一个小框被渲染到。

有 OpenTK 人员知道如何做到这一点吗?

I've been searching around for this, I've managed to find out out to change the size of our window, and how to change the resolution of the monitor.

But I can't seem to find how to tell OpenGL where and how big my viewport is.

Example: the game starts up in 400x300, and I expand the window to 800x600. I now have a 800x600 window, but only a 400x300 box in the corner is being rendered to.
I get the same problem when switching to fullscreen, the gray area covers the entire screen, but I only have a small box in the corner being rendered to.

Any OpenTK people out there that know how to do this?

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

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

发布评论

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

评论(1

看海 2024-10-03 03:29:37

您需要刷新视口:

GL.Viewport(gameWindow.ClientRectangle);

You need to refresh your viewport:

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