graphics programming with C++

Started by
26 comments, last by Servant of the Lord 8 years, 10 months ago

Hello everyone ! . I have learnt C++ a bit but the language is too broad and honestly I do not know how to use all the programming techniques in real world applications but I generally know the concepts . So should I now start some graphics programming in C++ and if I want can I start with some low level api such as direct3d and openGL??

Advertisement
If you're already confused by C++ then I wouldn't even consider starting on graphics with it.

Get familiar with C++ first. Just make your games via the console with text input and output. Once you have a better handle on how the language works, then you can consider going on to doing something with graphics, but I would recommend using a 3rd party library like Cinder or SFML.

Basically - if you're already confused just by C++ you're going to be even more confused by DirectX or OpenGL.

There's also nothing wrong with going for a higher level language like Python or C# first.

I second SFML. In a year or two, if you decide to play with OpenGL, you can still let SFML manage your window and events for you.

C++ can definitely be confusing. It's a multi-year task to really learn the language, and even then, you'll still keep learning new things year after year.

Another vote for SFML. The library has a very idiomatic C++ interface and you can learn good programming habits from it.

I second SFML. In a year or two, if you decide to play with OpenGL, you can still let SFML manage your window and events for you.

C++ can definitely be confusing. It's a multi-year task to really learn the language, and even then, you'll still keep learning new things year after year.

Why SFML and not SDL?

What will you make?

Because SDL is C AFAIK, although there is several third-party C++ interfaces available.

And the architecture is not as elegant as SFML, IMO.

The OP should really take each one for a spin to see which he prefer.

Too many projects; too much time

Why SFML and not SDL?

SDL is also nice. I like SFML slightly more, but there are parts of SDL I like more than SFML.
SFML is at a slightly higher level of abstraction, which is nice some of the time, and can get in your way at other times.

For example, SFML makes use of RAII in things like images (CPU-side) and textures (GPU-side) and so on.
But at the same time, SFML doesn't provide out of the box lower-level drawing routines to 'just draw' a texture, instead having you use it's 'Sprite' class which has position and other details.

Both libraries are nice. Both are stable, well-documented, have decently-sized communities, are easy to learn, and work well. And since I'm going to build ontop of the libraries regardless, my choice to switch to SFML was basically because at the time (back in 2011 or so) SDL hardware acceleration wasn't easy to do, whereas SFML was hardware-accelerated by default. I think the new 2.x versions of SDL are hardware accelerated though.

Because SDL is C AFAIK, although there is several third-party C++ interfaces available.

SDL is C, but C libraries are usually usable by C++ code; SDL works fine in C++ without any extra porting.

The OP should really take each one for a spin to see which he prefer.

Agreed.

If you're already confused by C++ then I wouldn't even consider starting on graphics with it.

Get familiar with C++ first. Just make your games via the console with text input and output. Once you have a better handle on how the language works, then you can consider going on to doing something with graphics, but I would recommend using a 3rd party library like Cinder or SFML.

Basically - if you're already confused just by C++ you're going to be even more confused by DirectX or OpenGL.

There's also nothing wrong with going for a higher level language like Python or C# first.

I won't say I am really that confused but I think I need some practice with advanced concepts such as inheritance , polymorphism also with templates. So can I get good at them using an api?

OK guys then probably I will stick with learning the language for now

I vote for this.
As I explained here, when the language and graphics at the same time was overwhelming I fell back on just the language for at least 2 years.

It is best to get language struggles out of the way and put down graphics programming until then period.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

OK guys then probably I will stick with learning the language for now

I vote for this.
As I explained here, when the language and graphics at the same time was overwhelming I fell back on just the language for at least 2 years.

It is best to get language struggles out of the way and put down graphics programming until then period.

L. Spiro

Can you help me with some sources I should use to learn the language ?

This topic is closed to new replies.

Advertisement