We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(6)
那是胡说八道
OpenGL IS 跨平台, 。不需要Qt之类的。只有少数部分必须进行调整:窗口 API 和输入 API,它们是唯一依赖于操作系统特定例程的函数。
你有几种可能性:
That's nonsense guys
OpenGL IS cross-platform. No need for Qt or such. Only a few part must be adapted : the windowing API and the input API, which are the only functions that depend on OS-specific routines.
You have several possibilities :
SDL+OpenGL。也许还有 glee 或 glew 如果您使用着色器和/或扩展。
Glee比较好用,但是貌似不支持3.0以后的OpenGL版本。
此外,您可能需要 SDL_image 来加载图像。
有关详细信息,请参阅 sdl 文档。
禁用垂直同步后,每秒可以获得数百到数千帧。确切的性能取决于您的硬件和场景复杂性 - 我有 300 fps 的简单 3D 地下城爬行器报告,该爬行器使用“RAW”opengl,没有显示列表/顶点缓冲区对象。此外,如果您使用固定帧速率或计时器驱动的引擎,每秒获得的帧数不会超过您要求的数量。
SDL 用于将 Unreal 2004 移植到 Linux。它也被用于 Doom 3/Quake 4 Linux 移植。因此它经过了彻底的测试并且众所周知。
请参阅此列表了解更多信息。
SDL + OpenGL. Maybe also glee or glew if you use shaders and/or extensions.
Glee is easier to use, but it looks like it doesn't support OpenGL versions after 3.0.
Also you might need SDL_image for loading images.
See sdl documentation for more info.
With vsync disabled, you can get from few hundreds to thousand frames per second. Exact performance depends on your hardware and scene complexity - I had 300 fps reports for simple 3D dungeon crawler that used "RAW" opengl without display lists/vertex buffer objects. Also, if you use fixed framerate or timer-driven engine, you won't get more frames per second than you asked for.
SDL was used for porting Unreal 2004 to Linux. It also was used in Doom 3/Quake 4 linux port. So it is thoroughly tested and well known.
See this list for more info.
如果您希望以跨平台方式使用 OpenGL,您可以使用 QGLWidget 将其嵌入到 Qt 应用程序中。
If you want OpenGL in a cross platform manner you can embed it in a Qt application using QGLWidget.
还有 wxWidgets,它有 OpenGl 支持。
There's also wxWidgets, which has OpenGl support.
对我来说,问题不在于知道是否应该使用库。这是您应该使用的库。如果您想编写游戏,请找到可以为您解决大多数可移植性问题的库。它会让您专注于最重要的事情:游戏本身。其他人给出了更多我本可以给你的图书馆建议。
我认为在项目开始之前过度担心性能是错误的。像开发过程中遇到的任何其他问题一样解决性能问题。设计您的程序以将库隔离在与其余程序逻辑分开的层中。如果需要的话,切换实现会更容易。这甚至允许尝试不同的实现。
IE:
To me the question is not to know if you should use libraries or not. It is what library you should use. If you want to write a game, then find libraries that will solve most portability issues for you. It will let you concentrate on what matters the most: the game itself. Others gave more library suggestions that I could have given you.
I think it is a mistake to overly worry about performance before you have even started your project. Work on performance issues like any other problem you face during development. Design your program to isolate libraries in a layer separate from the rest of your program logic. It will be easier to switch implementation if needed. That will even allow to experiment different implementations.
Ie:
是的,选择 SFML。 SDL 本身并不是硬件加速的。
OpenGL 确实是可移植的,但它确实具有用于创建 OpenGL 上下文的特定于平台的方法。 SFML 解决了这个问题。
Yes, go with SFML. SDL is not inherently hardware accelerated.
OpenGL is indeed portable but it does have platform-specific methods for creating the OpenGL context. SFML solves that.