
Beginning Game Programming in C++ - max_
http://lazyfoo.net/tutorials/SDL/index.php
======
melling
[https://handmadehero.org](https://handmadehero.org) is a project that teaches
how to write a game from scratch. He starts without even using OpenGL.

It's mostly C, but he does use the C++ compiler.

~~~
seivan
I guess the opposite of that (Without introducing editors) would be Cocos2d-x.
You could still stay in C++ code-land but get everything out of the box (ECS,
Memory management, scenes, etc)

~~~
uhtred
I've been using cocos2d-x for a few months now to create my first game, and I
am really impressed with it.

------
omegote
It would be great if lazyfoo had a changelog. Looks like it was last updated
on 2016/2/15, but who knows what was updated? I mean I've been visiting
lazyfoo since 10 years ago...

------
shmerl
I hope someone will make a tutorial for using SDL with Vulkan.

 _> You should not be trying to use multithreaded optimization. Play with fire
and you will get burned._

That's some poor encouragement there. They should be teaching how to do
multithreading properly instead, or referring to such resources. May be using
languages like Rust where multithreading is more sane will encourage using it
more.

~~~
cmrdporcupine
As I discovered to my misfortune recently, SDL2 is a nightmare of undefined
behaviour when you start involving multiple threads, even if you're doing
things in what naively would appear to be the correct way with locks and the
like. Depending on your OS and GL backend, a bunch of stuff is thread local
and will bomb out or just fail to do anything. In the end I ended up having to
do everything SDL related, not just rendering, but including things like
polling the keyboard and mouse, inside one thread, with mailboxes back to
everywhere else. The documentation was pretty weak on explaining this, too.

~~~
bottled_poe
I find this hard to believe. I've implemented multi-threaded rendering engines
with OpenGL without too any major issues. As long as you aren't adding
multiple threads to the main render loop, you shouldn't have these issues.
Could you elaborate?

~~~
cmrdporcupine
This is with SDL overtop of OpenGL. I never had problems on Linux as long as I
kept the rendering in its own thread, but on OSX I had more serious problems
with SDL_PollEvent simply failing to do the right thing if not called from the
main thread, if I recall.

------
richerlariviere
That's a classic one. I used to refer to this website for SDL related
projects.

~~~
douche
It's awesome that he's reworked them to stay up to date - I remember poring
over the SDL 1.2 tutorials almost ten years ago. Also looks like the OpenGL
page is updated as well - no more immediate-mode 1.0 stuff, like there still
is in the Nehe tutorials that everyone used to use.

------
pjc50
Here's the tutorials I used to learn game programming in C:
[http://bespin.org/~qz/pc-gpe/](http://bespin.org/~qz/pc-gpe/)

.. 20 years ago :(

------
woodman
C++, not C :(

~~~
dang
Thanks. Fixed.

