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 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
SDL 站点的库部分中列出了多个 GUI 库。
对于什么是有价值的,我查看了所有这些库并确定没有一个适合我的需求。我正在写我自己的。
There are several GUI libraries listed in the libraries section of the SDL site.
For what is worth, I looked at all those libs and decided none fit my needs. I'm writing my own.
不完全是,据我所知你几乎必须:
1)使用图形基元编写自己的或
2) 为每个目标平台编写操作系统特定代码以打开对话窗口。
对于第一个选项,您没有提到您是使用 SDL 进行 2D 图形还是使用 OpenGL?如果您使用 OpenGL,我相信有可用的 GUI 库可以使用 OpenGL 原语创建 GUI 元素,我会尝试搜索“OpenGL GUI”。
如果您查找如何使用 SDL_ttf 渲染字体并进行操作,您可以使用它向显示器写入文本响应。
第二个选项要求您研究如何在您想要定位的每个平台上打开消息框,并使用 #ifdefs 来控制使用哪个平台。例如,如果您想要针对 Windows、OS X 和 Linux,则需要使用 Windows api、Cocoa 和 X11 编写 3 个对话框函数。
Not really, as far as I know you pretty much have to:
1) write your own using graphics primitives or
2) write OS specific code for each target platform to open a dialog window.
For the first option, you haven't mentioned if you are using SDL for 2D graphics or with OpenGL? If you are using OpenGL I believe there are GUI libraries available that use OpenGL primitives to create GUI elements, I'd try searching for "OpenGL GUI".
If you lookup how to render fonts with SDL_ttf and get that going you could write text responses to the display using that.
The second option requires you to research how to open a message box on each platform you want to target and use #ifdefs to control which one is used. For example if you want to target windows, OS X and Linux you'll need to write 3 dialogue box functions, using the windows api, Cocoa and X11.
我是 sourceforge 上小文件对话框的作者。它是一个单一的 C 文件,只有五个函数调用,包括消息框和问题对话框。它没有主循环,可以轻松补充 SDL。
I am the author of tiny file dialogs on sourceforge. It is a single C file with just five function calls including message box and question dialog. It has no main loop and complement SDL easily.