Recommended Posts

I'm learning the basics of C++. I've messed around with it over the years off and on. Tried some random books and tutorials online.

Back when I decided to try it C++ was all the hype. So its what I decided to stick with. I'm just more comfortable with it because I'm familiar with it. I tried Game Institute online. Its alright but I found the tutorials a little scarce on details. Then I ran into Cave of Programming on youtube and it gave me a nice boost of knowledge. But again, it lacks in some area's.

The one I'm learning from right now is Sams Teach yourself C++ in an hour a day (updated for C++ 11). Bought it from a book store and so far its the best of the bunch. I'm about a quarter of the way through and its pretty solid.
Eventually I might sign up to educator.com for their C++ courses.

But right now I'm just wondering if anyone knows of some good books (consumer or college level) that goes over graphics programming with C++. There's a slew of them on amazon but I thought maybe this would be the best place to ask. Most of those books have so many mixed reviews its hard to pick.
Like I said I;m not ready for graphics coding yet but I'm trying to prepare early so I wont have to hunt around for resources when I am.

But if there's any books or online learning anybody can recommend that would be great.
Thank thanks in advance for any help.

Share this post

Link to post

Share on other sites

Anything you want to do with C++ beyond general purpose programming is done using some library, which is not part of C++.

So to me, your question is trying to connect two unrelated things. That is, "graphics programming with Python" or "graphics programming with Lua" would basically give you the same answer, except you write the calls to the library a little different, that's all. Obviously, from a book-author point of view, this is great. I write the explanation of some graphics library once, for language X. Then I modify the programming code to language Y, and I have a new book. Then I replace it to language Z, and a third book!! In other words, cheap money from people that don't understand the connection between a programming language and a library.

In other words, "Foo programming and Your language" are much less tightly connected than you may think. The library calls that you make do the actual work, and they are the same no matter what language you use. Graphics programming amounts to "just do the right library function calls at the right time".

A second point is "graphics". It's a very big area, not to mention huge insanely big. There is no book that covers all of it. If it would exist, I wouldn't recommend buying it, since it would be way to shallow to be of any value. In other words, it makes a lot of sense for you to pick a subset of "graphics" first before trying to find a book. A second possible approach is to focus on graphics only, and not so much on programming, since in the end, it's just a bunch of library calls that you do for "programming graphics". Even graphics on its own is a big field, of which I have little understanding, so I can't give you much guidance there.

You can also start at the other end. There are some popular libraries that are used often, like SDL2, SFML (both mostly 2D oriented afaik), and OpenGL (fully 3D). Windows has its own set of libraries, DirectX and maybe a few others (I don't know Windows).

Find the tutorials of them, and work through them. I wouldn't be surprised if that is enough to understand how to use that library. Beyond that, it becomes time to do some programming with the library for a game of your own.

Share this post

Link to post

Share on other sites

Anything you want to do with C++ beyond general purpose programming is done using some library, which is not part of C++.

So to me, your question is trying to connect two unrelated things. That is, "graphics programming with Python" or "graphics programming with Lua" would basically give you the same answer, except you write the calls to the library a little different, that's all. Obviously, from a book-author point of view, this is great. I write the explanation of some graphics library once, for language X. Then I modify the programming code to language Y, and I have a new book. Then I replace it to language Z, and a third book!! In other words, cheap money from people that don't understand the connection between a programming language and a library.

In other words, "Foo programming and Your language" are much less tightly connected than you may think. The library calls that you make do the actual work, and they are the same no matter what language you use. Graphics programming amounts to "just do the right library function calls at the right time".

A second point is "graphics". It's a very big area, not to mention huge insanely big. There is no book that covers all of it. If it would exist, I wouldn't recommend buying it, since it would be way to shallow to be of any value. In other words, it makes a lot of sense for you to pick a subset of "graphics" first before trying to find a book. A second possible approach is to focus on graphics only, and not so much on programming, since in the end, it's just a bunch of library calls that you do for "programming graphics". Even graphics on its own is a big field, of which I have little understanding, so I can't give you much guidance there.

You can also start at the other end. There are some popular libraries that are used often, like SDL2, SFML (both mostly 2D oriented afaik), and OpenGL (fully 3D). Windows has its own set of libraries, DirectX and maybe a few others (I don't know Windows).

Find the tutorials of them, and work through them. I wouldn't be surprised if that is enough to understand how to use that library. Beyond that, it becomes time to do some programming with the library for a game of your own.

- SDL2 and SFML Stuff like that is what I mean for 2D graphics. I've heard of SFML and I think I remember seeing a book about game development that uses that library/set of libraries. I'd have to find it again. But thank you for that.

Basically stuff like that is what I'm after. To start with I'd like to learn to take basic sprite assets made in a paint program and make it all into a game with code.
You're right though, I have very little understanding of how general code and graphics libraries correlate.

I had to look it up to know SFML is an API. It says its written in C++ with bindings for other languages. I feel like an idiot saying this but I didn't know different programming languages could tie into each other in that way.

2 other things I wanted to bring up real quick.....

1.) I was googling some examples of game and graphics code with C++, and I noticed a few of them using the libraries
#include<graphics.h> and #include<conio.h>

Are those 2 libraries specifically related to graphics? Well, graphics.h obviously, but that was just something I noticed them all using.

2.) A buddy of mine I used to talk to a lot had programmed some games and he still has the section of his website up that has source code examples. You can go there and view some source code for them. I think they're written in straight C though.http://vazgames.com/retro/

But something I noticed about his 2D frogger demo is he didn't use any #include <graphics.h>. It looks like its just using regular libraries. His tank game does use OpenGL because its 3D.

But yea, I guess I'll start with the resources you provided Alberth. Thank you for your help.

If you choose for directx as an API, I would suggest the DX11 boom from Frank D Luna. It assumes you know the basics of C++

ok, I'll check that one out. Thanks for recommending it.

0

Share this post

Link to post

Share on other sites

Luna's work is good but his DX11 book is outdated to the point that you'll have a difficult time making use of it. He wrote that book back when DX11 was relatively young and then Microsoft decided to deprecate and/or forcefully disable a ton of stuff that it relied on. It's not really a good first experience for graphics programming, since it would make it very hard to understand if you screwed something up or if you're just having trouble with code that MS has broken.

Share this post

Link to post

Share on other sites

Luna's work is good but his DX11 book is outdated to the point that you'll have a difficult time making use of it. He wrote that book back when DX11 was relatively young and then Microsoft decided to deprecate and/or forcefully disable a ton of stuff that it relied on. It's not really a good first experience for graphics programming, since it would make it very hard to understand if you screwed something up or if you're just having trouble with code that MS has broken.