问题描述
我知道这可能是一个非常主观的问题,但我只想从一个最容易学习的最快的开始,这样我就可以开始一个小项目尽快,它是一个小2D游戏,开始至少..哪一个你会建议我去?我正在使用C ++
I know this is probably a very subjective question, but I just want to start with the one which is the easiest and fastest to learn, so that I can get started with a small project of mine as fast as possible, it's a a little 2D game, to start with at least.. Which one would you recommend me to go with? And I'm using C++
推荐答案
第一个问题:如果没有,使用OpenGL。
First question: Are you on Windows? If not, use OpenGL.
如果你在Windows上,这将是一个味道的问题。 API是不同的,但是所需的概念对于OpenGL和DirectX非常相似。
If you're on Windows, this will come down to a matter of taste. The APIs are different, but the concepts required are very similar for both OpenGL and DirectX. Most things are supported on both, although they do work a bit differently.
Microsoft提供了很多样本和一个可以用于DirectX(9或10)的合适框架,
Microsoft provides quite a few samples and a decent framework you can use for DirectX (9 or 10), which can make it easier to get started.
也就是说,如果您只定位到Windows Vista / Win7,移动到DirectX 10可能会让生活更轻松。 DX10和早期版本中的很多烦恼在DX10中被删除了,API是一个更干净。
That being said, if you're targetting Windows Vista/Win7 only, moving to DirectX 10 may make life easier. A lot of the annoyances in DX9 and earlier were removed in DX10, and the API is a bit more clean.
也就是说,如果这是一个游戏,我建议使用一个中间件引擎,如,而不是直接在DirectX或OpenGL中编写。这将使你的生活更简单,特别是在学习。
That being said, if this is for a game, I'd recommend looking at using a middleware engine like Ogre instead of writing directly in DirectX OR OpenGL. This will make your life much simpler, especially while learning.
这篇关于OpenGL还是DirectX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!