For SDL, a book that's getting a bit long in the tooth: programming linux games. A decent enough start. I'd skip a lot of the audio portion of things as that's really getting dated, but pay attention to what he's doing with the 2d stuff. I could wish he spent a little more time with platform style collision detection and what have you, but it gives you a basis to start diving into other people's work.
Also, as many have pointed out, look at the http://www.lazyfoo.net/SDL_tutorials/index.php tutorials. Another really good start to SDL. Some might say a better start, and it's free.
Once done, peel back the code for one of the open source projects here. Study the code, and ask a few questions about it. Or start your own simple 2d game.
3d, well, that's a small library of books if you want to PROGRAM it. A lot of math, some physics, specialized optimized hacks to get the transformations and physics estimates to run quickly, etc. That doesn't even get into the moving target of the 3D libraries. A lot of the sample code out their is using the old fashioned fixed function math, where GLES 2.0 and modern OpenGL is using shaders for just about everything.
For 3d you have a lot of "roles" to fill. Modeler - look up Blender and the tutorials for it. Coder - I'd use Q3 or a similar engine to start, rather than writing one of your own. Math and physics guy, level designer, painter, etc., even for a simple project. You have all that in 2d too, but it's much faster to develop an 8-bit Mario looking character than it is to develop a 3d character that looks anything like a humanoid, never the less animate it, account for collision detection, etc.
Cheers and good luck. Don't let the scope of it scare you away, but I'd start either with 2d, or modding a level for an existing 3d program.