为 Mac 创建 C++ GUI/API
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7676793/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Create a C++ GUI/API for Mac
提问by ChrisMP
I am quite confused about
我很困惑
1) the difference between a GUI and API 2) Where to learn to make my own GUI/API 3) What all the premade GUI/API's there are
1) GUI 和 API 之间的区别 2) 在哪里学习制作我自己的 GUI/API 3) 所有预制的 GUI/API 都有哪些
My goal is to learn how to make actual programs instead of just using console and yes, I would like a solution for doing this on Mac OS X (preferably cross-platform). Please help! IF you are confused by what I need to know, leave a comment.
我的目标是学习如何制作实际程序,而不仅仅是使用控制台,是的,我想要一个在 Mac OS X(最好是跨平台)上执行此操作的解决方案。请帮忙!如果您对我需要知道的内容感到困惑,请发表评论。
P.S. How would I turn a console game into an actual 2D game (I know its not easy).
PS 我如何将主机游戏变成真正的 2D 游戏(我知道这并不容易)。
回答by Will Ford
GUI stands for Graphical User Interface, while API stands for Application Programming Interface.
GUI 代表图形用户界面,而 API 代表应用程序编程接口。
It is common in programming terminology reusable libraries are called as API. I assume by GUI/API you mean an API that allows you to create GUI based applications. For example Swing is Java API for creating GUI.
可重用库在编程术语中很常见,称为 API。我假设 GUI/API 是指允许您创建基于 GUI 的应用程序的 API。例如 Swing 是用于创建 GUI 的 Java API。
For C++ there are many libraries which allow you to make GUI applications. Most notable, open source and cross platforms ones are:
对于 C++,有许多库可以让您制作 GUI 应用程序。最值得注意的是,开源和跨平台的是:
GTK+ http://www.gtk.org/
GTK+ http://www.gtk.org/
wxWidgets http://www.wxwidgets.org/
wxWidgets http://www.wxwidgets.org/
There are quite a few others.
还有很多其他的。
If you want to create your own GUI API which is cross platform, then you should study the above libraries. But let me warn you, creating a UI library is a huge task!
如果您想创建自己的跨平台 GUI API,那么您应该学习上述库。但是让我警告您,创建 UI 库是一项艰巨的任务!
回答by John O
An API is a library of code that someone else has written, from which you can use their functions in your own program so that you don't have to write everything from scratch.
API 是其他人编写的代码库,您可以从中使用他们的函数在您自己的程序中,这样您就不必从头开始编写所有内容。
A GUI is a type of interface to a program. It lets you click on buttons and select items from lists with the mouse, as opposed to typing in commands on a keyboard to make the program do things.
GUI 是一种程序界面。它允许您单击按钮并使用鼠标从列表中选择项目,而不是在键盘上输入命令来让程序执行操作。
These aren't comparable concepts.
这些不是可比的概念。
A console application is a real one that for many people gets work done every day, all day, in millions of places across the world. If you fail to do your homework writing console applications, you'll never be able to make a "real program". You might end up a web application developer like me though. So do your homework.
控制台应用程序是一个真正的应用程序,它让许多人每天、整天、在世界各地的数百万个地方完成工作。如果您没有完成编写控制台应用程序的家庭作业,您将永远无法制作“真正的程序”。不过,您最终可能会成为像我一样的 Web 应用程序开发人员。所以做你的功课。
回答by ksming
You might want to try Qt, which is a cross-platform GUI SDK. It is what I learning right now and I have lots of fun with it.
您可能想尝试 Qt,它是一个跨平台的 GUI SDK。这就是我现在正在学习的东西,我从中得到了很多乐趣。
Qt Cross-platform application and UI framework
For simple 2D games, instead of a GUI framework, you might want to try SDLinstead.
对于简单的 2D 游戏,您可能想要尝试SDL,而不是 GUI 框架。