Beginning Game Programming v2.0
Last Updated 8/19/18
Greetings everyone, welcome to the ground up recoding of Beginning Game Programming with SDL. This time we will be coding with SDL 2 which has been released on the .
These tutorials were designed for C++ programmers who want to move from text based games to real time games with graphics. By the end of these tutorials, you'll know the basics to make your first real video game! Follow Lazy Foo' Productions on Twitter:
Table of Contents | |
Lesson 01 | In this tutorial we will be setting up the SDL library and creating our first window. |
Lesson 02 | Now that we can get a window to appear, lets blit an image onto it. |
Lesson 03 | Here we'll start handling user input by allow the user to X out the window. |
Lesson 04 | Here we'll learn to handle keyboard input. |
Lesson 05 | Now that we know how to load and blit surfaces, it's time to make our blits faster. We'll also take a smaller image and stretch it to fit the screen. |
Lesson 06 | Here we'll be using the SDL_image extension library to load png images. |
Lesson 07 | A big new feature in SDL 2.0 is hardware accelerated texture based 2D rendering. Here we'll be loading an image to render it using textures. |
Lesson 08 | Another new feature in SDL 2.0 is hardware accelerated primitive rendering. Here we'll be using it to render some common shapes. |
Lesson 09 | SDL 2.0 also lets you control where you render on the screen using the viewport. We'll be using the viewport to create subscreens. |
Lesson 10 | Here we'll use color keying to give texture transparent backgrounds. |
Lesson 11 | Using clip rendering, you can keep multiple images on one texture and render the part you need. We'll be using this to render individual sprites from a sprite sheet. |
Lesson 12 | We'll be altering the color of rendered textures using color modulation. |
Lesson 13 | Here we'll be using SDL 2.0 new hardware accelerated alpha blending. |
Lesson 14 | Here we'll be using a sequence of sprites to animate them. |
Lesson 15 | Here we'll be using SDL 2.0's new texture rotation and flipping. |
Lesson 16 | Here we'll be rendering text from true type fonts using SDL_ttf. |
Lesson 17 | Here we'll learn to read mouse input using mouse events. |
Lesson 18 | There's other ways to read the keys besides event polling. Here will get the current states of the keyboard using get states. |
Lesson 19 | Here we'll learn to read input from a game controller. |
Lesson 20 | Another new feature for SDL 2.0 is rumble support using the SDL haptics. We'll make our controller rumble when a button is pressed. |
Lesson 21 | Here we'll be using SDL_mixer to add music and sound to our SDL App. |
Lesson 22 | Here we'll be using SDL's time capabilites. |
Lesson 23 | Here we'll extend SDL time capabilities to make our own custom timer. |
Lesson 24 | Here we'll use the timers we built to measure frame rate. |
Lesson 25 | If you need a constant frame rate when vsync isn't available, frame rate capping can be used as a fall back. |
Lesson 26 | Here we'll be taking what we learned about render and handling input to make a dot move around the screen. |
Lesson 27 | Here we'll have two objects interact with each other using bounding box collision detection. |
Lesson 28 | Here we'll have two object collide using per-pixel collision detection. |
Lesson 29 | Here we'll learn to detect collisions with circles and boxes. |
Lesson 30 | Here we'll be implement a camera to scroll levels larger than the screen. |
Lesson 31 | Here we'll using a scrolling background to give the illusion of an infinite level. |
Lesson 32 | Here we'll using SDL 2.0's new way of handling text input and its new clip board handling feature. |
Lesson 33 | Here we'll using SDL's RWOps API to do binary file IO. |
Lesson 34 | SDL 2.0.8 supports audio recording. Here we'll be copying from the audio device to record and copying to the audio device to play back. |
Lesson 35 | Here we'll be handling events from a resizable window. |
Lesson 36 | A new feature in SDL is the ability to support more than one window. Here we'll make an application that has 3 windows. |
Lesson 37 | Another new feature of SDL 2.0 is the ability to handle more than one physical display. Here we'll make our window jump from display to display. |
Lesson 38 | Here we'll use a simple particle effect to create a simple trail effect. |
Lesson 39 | Here we'll make a simple level using a tiling engine. |
Lesson 40 | Here we'll be directly accessing and manipulating a texture's pixels. |
Lesson 41 | Here we'll be using a texture as a font using bitmap font techniques. |
Lesson 42 | Here we'll be rendering from a streaming data source using texture streaming. |
Lesson 43 | Here we'll be taking a scene and rendering it to a texture. |
Lesson 44 | Here we'll be making the dot move independent of the current frame rate. |
Lesson 45 | SDL has another timing mechanism called timer callbacks. Here we'll be setting a function to be called back after a certain amount of time. |
Lesson 46 | Multithreading allows your program to do things simultaneously. Here we'll make things print to the console from outside our main thread. |
Lesson 47 | A major issue in multithreaded applications is that you need to make sure that they don't try to access the same data at the same time. Semaphores are a way to make sure only a certain amount of threads are performing an action at the same time. |
Lesson 48 | Atomic operations are another way to synchronize threads. Here we'll be redoing the previous tutorial with atomic counters. |
Lesson 49 | Mutexes and conditions are yet another way to synchronize threads. Here we'll be using the added benefit that they allow threads to communicate with each other. |
Lesson 50 | SDL is a powerful tool when combined with OpenGL. If you're just starting out with OpenGL or want to maximize compatibility, you can use SDL with OpenGL 2.1. In this tutorial we will make a minimalist OpenGL 2.1 program. |
Lesson 51 | SDL 2.0 now has support for OpenGL 3.0+ with context controls. Here we'll be making a minimalist OpenGL 3+ core program. |
Lesson 52 | Here we'll be loading and displaying an image in our first mobile app! |
Lesson 53 | Here we'll be using SDL extension libraries and handling changing orientation. |
Lesson 54 | Here we'll be handling single touch input. |
Lesson 55 | Here we'll be handling multitouch events like pinches and rotation. |
FROM: