桌面/平台问题的 OpenGL 游戏开发

发布于 2024-08-24 01:30:13 字数 226 浏览 6 评论 0 原文

有人有在 Windows 上编写专业 OpenGL 游戏的经验吗?对于Mac来说,由于苹果的控制,操作系统显得相当“统一”。对于Windows来说,由于硬件不同,安装的驱动程序不同等等......硬件基础似乎有很多很多不同的配置。

理论上,OpenGL 提供了一个 API 来抽象所有这些。在实践中,许多驱动程序经常有错误并且有奇怪的情况 - 这对于在 Windows 上开发游戏来说是一个问题吗?

谢谢!

Does anyone have experience writing professional OpenGL games on Windows? For the Mac, due to apple's control, the OS seems quite "uniform". For windows, due to different hardware, different drivers installed, etc ... the hardware base seems to have many many different configurations.

In theory, OpenGL provides a API that abstracts all this away. In practice, many drivers are often buggy and have weird cases -- has this been a problem for developing games on Windows?

Thanks!

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

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

发布评论

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

评论(3

儭儭莪哋寶赑 2024-08-31 01:30:14

两个最大的 GPU 供应商(Nvidia 和 ATI)都提供 OpenGL 3.x 驱动程序,该驱动程序利用了现代硬件的最新功能。正如 Chris 指出的那样,主要问题是用户需要安装供应商自己提供的最新驱动程序,因为 Windows 附带了最基本的 OpenGL 支持(感谢微软,他们似乎竭尽全力削弱 OpenGL 并推动DirectX)。因此,只要他们有最新的驱动程序,就应该没问题。

驱动程序之间不可避免地存在一些(大多数是微小的)差异。例如,我注意到 Nvidia 的 GLSL 编译器比 ATI 的更挑剔,并且拒绝一些本来可以正常工作的着色器代码。最重要的是你需要对两者进行测试(无论如何你都会这样做)。

gDebugger 工具似乎非常擅长追踪性能问题。 (不过,随 Xcode 免费提供的 OpenGL 工具非常棒。)

您需要从 glext.h ="nofollow noreferrer">OpenGL 扩展注册表 并找出您的应用程序的基本要求。如果您可以帮助的话,您可能不希望根据可用的扩展来使用备用代码路径!正如 epatel 提到的,有一些库(例如 GLEW 和 GLEE)可以帮助扩展管理过程。我最终编写了自己的,因为我不喜欢这些实现。

如果您还没有选择工具集,那么有很多 OpenGL 引擎和场景图。

我一路上发现了一些小错误,但几乎所有错误都很容易解决。这些天一切都很好。

The two biggest GPU vendors (Nvidia and ATI) both provide OpenGL 3.x drivers, which take advantage of the latest features of modern hardware. As Chris points out, the main issue is that the user will need to install the latest drivers from the vendors themselves, as Windows ships with the most rudimentary OpenGL support (thanks to Microsoft, who seem to do everything they can to knife OpenGL and push DirectX). So provided they have recent drivers, you should be fine.

There are inevitably some (mostly minor) differences between the drivers. For example, I've noticed Nvidia's GLSL compiler is a little more picky than ATI's, and rejects some shader code that otherwise works fine. Bottom line is you need to test on both (which you would be doing anyway).

The gDebugger tool seems to be pretty good at tracking down performance issues. (The OpenGL tools that ship free with Xcode are pretty awesome though.)

You'll need to get glext.h from the OpenGL extensions registry and figure out the base requirements for your app. You probably don't want to have alternate code paths based on which extensions are available, if you can help it! And as epatel mentions, there are a few libraries (such as GLEW and GLEE) which help with the process of extension management. I ended up writing my own, as I didn't like those implementations.

There's lots of engines and scene graphs for OpenGL, if you haven't already chosen your toolset.

I've found a few little bugs along the way, but nearly all were easy to work around. These days things are pretty good.

烟雨扶苏 2024-08-31 01:30:14

您将面临的最大问题很简单:Windows 7 不附带硬件 OpenGL。如果用户不采取行动将默认视频驱动程序替换为来自供应商站点的更新版本,那么他们拥有的唯一 OpenGL 支持将是 ~v1.0 软件渲染器。

The biggest problem you will face is simply this: Windows 7 does not ship with a hardware OpenGL. If the user does not take the action to replace the default video drivers with updated versions from the vendors site the only OpenGL support they have will be a ~v1.0 software renderer.

ぃ双果 2024-08-31 01:30:14

我还没有在 Windows 上制作专业的 OpenGL 游戏,但我认为一件重要的事情是查询 OpenGL 驱动程序,了解哪些功能(扩展)可用并处理这些功能。还有一个包可以通过 GLEW 库以独立于平台的方式处理此问题。认为这是了解如何处理不同 OpenGL 功能的良好开端。

OpenGL Extension Wrangler Library (GLEW) 是一个跨平台开源 C/C++ 扩展加载库。 GLEW 提供了高效的运行时机制来确定目标平台支持哪些 OpenGL 扩展。 OpenGL 核心和扩展功能在单个头文件中公开。 GLEW 已在多种操作系统上进行了测试,包括 Windows、Linux、Mac OS X、FreeBSD、Irix 和 Solaris。

I haven't yet made a professional OpenGL game on Windows, but I think one important thing is to query the OpenGL drivers about what capabilities (extensions) are available and handle those functions. There is also a package to handle this in a platform independent way with the GLEW library. Think that is a good start to understand how to handle different OpenGL capabilities.

The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. GLEW provides efficient run-time mechanisms for determining which OpenGL extensions are supported on the target platform. OpenGL core and extension functionality is exposed in a single header file. GLEW has been tested on a variety of operating systems, including Windows, Linux, Mac OS X, FreeBSD, Irix, and Solaris.

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