graphics programming with C++

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

I used 30% online tutorials (I have no idea which ones) and 70% hands-on experimentation.

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

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 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?


A good C++ API, sure, a C API won't help much in learning C++ (and most APIs are going to be C-based because C++ doesn't have a defined binary interface).

The standard C++ library (sometimes called the STL or Standard Template Library) exhibits several good practices for example.

If you're confused about a specific aspect of C++, feel free to ask, and we'll do our best to answer smile.png

Some good resources for C++:

A Tour of C++ - a short-ish overview of C++ itself, including new 11/14 features
The C++ FAQ - lots and lots of questions and answers frequently seen for C++, including where to start learning
The C++ Standard homepage - aggregates articles, Slashdot, and news related to C++
Herb Sutter's Guru of the Week - some 'best practices' articles for C++11/14. You can get more of them in the "Exceptional C++" series of books, but some of the ones in the books are out of date with the newest language standards.

Additional books:
"Effective Modern C++" by Scott Meyers - a good book on best practices for C++11 and 14
"A Tour of C++" by Bjarne Stroustrup (book form of the above link)
"Modern C++ Design" by Alexi Alexandrescu - focuses on template metaprogramming. Somewhat out of date in that the standard library implements some of the things he presents and it doesn't cover newer features like SFINAE, but a great introduction of how to do templates.
"The C++ Programming Language" fourth edition by Bjarne Stroustrup - pretty much the reference book for the C++ language. Not so much a teaching material as a reference. And friendlier to read than the standard.
"The C++ Standard Library" second edition by Nicolai M. Josuttis - a great reference of the standard library, updated for 11/14.

I'm sure others have their own reference books and links they find useful smile.png

I`m pretty new to programming aswell i mostly play with python but did read some c++, I recommend to you "C++ through game programming" the 3rd edition. The book only does text based examples , you won`t learn how to program a graphic game but it will surely ease you way. I will give you some insight on why vectors and other containers are cool and will teach you inheritance by doing a console black jack game.

I think that it's a good way to learn things, but you should start with "complete" programs not jump into OpenGL. So if you did a little code to do some ray tracing, or to make a rasterizing renderer that would give you a very good idea what's really going on. Otherwise it is like magic is happening and you will be fighting frustrating occurrences more than learning how to code on your own.

This is my thread. There are many threads like it, but this one is mine.


A good C++ API, sure, a C API won't help much in learning C++ (and most APIs are going to be C-based because C++ doesn't have a defined binary interface).

The standard C++ library (sometimes called the STL or Standard Template Library) exhibits several good practices for example.

If you're confused about a specific aspect of C++, feel free to ask, and we'll do our best to answer smile.png

Some good resources for C++:

A Tour of C++ - a short-ish overview of C++ itself, including new 11/14 features
The C++ FAQ - lots and lots of questions and answers frequently seen for C++, including where to start learning
The C++ Standard homepage - aggregates articles, Slashdot, and news related to C++
Herb Sutter's Guru of the Week - some 'best practices' articles for C++11/14. You can get more of them in the "Exceptional C++" series of books, but some of the ones in the books are out of date with the newest language standards.

Additional books:
"Effective Modern C++" by Scott Meyers - a good book on best practices for C++11 and 14
"A Tour of C++" by Bjarne Stroustrup (book form of the above link)
"Modern C++ Design" by Alexi Alexandrescu - focuses on template metaprogramming. Somewhat out of date in that the standard library implements some of the things he presents and it doesn't cover newer features like SFINAE, but a great introduction of how to do templates.
"The C++ Programming Language" fourth edition by Bjarne Stroustrup - pretty much the reference book for the C++ language. Not so much a teaching material as a reference. And friendlier to read than the standard.
"The C++ Standard Library" second edition by Nicolai M. Josuttis - a great reference of the standard library, updated for 11/14.

I'm sure others have their own reference books and links they find useful smile.png

Thanks everyone for the help.

But I don't want to do something like sfml apart from the pain in setting it up even though it makes thing easier I don't just want to make games it is more like I want to know how things work. So when I start I will start with some low level api.

Learning how to do something like setting up a window without help is certainly a worthy goal. As is writing your own linked list.

However, think long and hard before using either in actual code to get something done. Working on something to understand it better is one thing, but getting something to production quality is a completely different beast.

Apart from that, SFML (and similar libraries) work on Macs, Windows and Linux (sometimes more). Getting your own code to work on all those platforms is not easy, even if you have access to all those platforms.

Also the "pain in setting it up" in setting it up you are worried about is a key skill. You will need some external libraries at some point unless you never progress far beyond some hello world. Learning to deal with the problems here is important and it gets significantly easier when you learn about the usual pitfalls. It also forces you to learn about some low-level compiler/linker issues which are an often overlooked part of "want to know how things work".

A lot of good advice from everyone. When I was learning C++, it was always helpful to apply what was being instructed into code, especially code that moved me in the direction I wanted to go. This re-enforced everything and put it into perspective.

If you are a little shaky on C++, or any language, and you want to move towards game programming, then might I suggest picking up a book that covers game programming, with graphics. Read the book, enter in the code that is in the book, even if it is for a program or game you have no interest in, at least by doing this you will gain the understanding on how it is supposed to work, and then you can modify the code to take you towards your goal.

Your Brain contains the Best Program Ever Written : Manage Your Data Wisely !!

But I don't want to do something like sfml apart from the pain in setting it up even though it makes thing easier I don't just want to make games it is more like I want to know how things work. So when I start I will start with some low level api.

Sometimes it helps to use the middle-level APIs, to learn how their interfaces are designed, before jumping to a low level and not knowing what to aim for.

But if that's really what you want to do, my advise would be to use Qt. It provides low level access to mid-level libraries in a cross-platform way, and you'll learn how GUI widgets fit together.

Qt is more for desktop applications rather than games, but it sounds like that's what you are interested in.

If you are interested in low-level 3D or 2D graphics, then you *should* use SFML for managing your windows and events, and use OpenGL for the graphics... but I think that'd dive you too fast into the deep end.

Perhaps a more ideal choice is for you to use SDL, which is probably low enough to satisfy you. I'd suggest starting with SDL, and after a year of using it, decide how you want to proceed from there.

hey guys I 'm new here ... currently I am learning C # and know some basic things , but my goal is to make games with some graphics Can anyone give some suggestions about this?

thank you, md4friends

Easy3D

in your opinion it is better to use only C # and unity ? how can I best deal on C #? I want to be the best or the program quite well in this language

because really I enjoy challenges...

thank you, for your answer

md4friends

This topic is closed to new replies.

Advertisement