Some newbie questions about C++ as a whole

Hey guys!

I study game design and development, am in my first year and I really want to focus on programming. So far I did pretty basic stuff in Gamemaker and Processing, and after talking with a few older students I decided my main focus will be C++. I do have a few questions however and would love it if you guys could help me out.

- Libraries, as far as I understand a library or API are pretty much engines so you can save if you want to code, say, several platformers.

- Can you code only in C++? Basically, do you 'need' an API for a simple game like pong or breakout?

- I know this question get asks a lot, but any good tutorials out there? So far I've seen thenewbostons videos about C++, but when I'm looking for C++ game tutorials, the writers assume you know everything about libraries and API's.

Thanks in advance guys!
Can you code only in C++? Basically, do you 'need' an API for a simple game like pong or breakout?


No. There are various languages, such as Python for example. Any language you can also program a simple pong game in a terminal.
In standard C++, the only thing that you have at your disposal is the standard library. It has things like sorting algorithms, timers, math functions and basic I/O (console stuff).

Now it depends what you want to code. If you want to do a pong/breakout in the console (i.e. with ascii characters only), then you can do it with standard C++, but it won't be any good.

If you want to make your own window, then you'll need to use the API for your operating system. If you want to make any kind of graphics, even as simple as Pong, then you'll have to talk with the video card. The easiest only practical way to do that is to use an API that is compatible that video cards are designed to handle. Those include OpenGL or DirectX. If you want to add sound, you can communicate with your motherboards buzzer through your operating system API, or you can communicate with your sound card for more complicated things through a sound library like OpenAL.
closed account (zb0S216C)
Zemmi wrote:
"- Libraries, as far as I understand a library or API are pretty much engines so you can save if you want to code, say, several platformers. "
Libraries are not engines. A library is collect of functions and classes. An engine is a system whose components are linked together in some logical way.

Zemmi wrote:
"- Can you code only in C++? Basically, do you 'need' an API for a simple game like pong or breakout?"

There are many languages available for specific projects. C++ is the industry standard because of its performance and growing flexibility.

Zemmi wrote:
"So far I've seen thenewbostons videos about C++, but when I'm looking for C++ game tutorials, the writers assume you know everything about libraries and API's."

You've got to know your tools before building things with them. A tutorial that teaches a language whilst building a game isn't practical. It's best to learn the advanced concepts of a language first.

Wazzak
Thanks guys, I didn't really get the fact you need an API to communicate with my videocard, since I was so used to just typing in Processing (where you can just type your window size without installing an API first).

Anyways, I looked around for a bit and decided I will be experimening with SDL for a while :)
Topic archived. No new replies allowed.