Skip to content
0:00 / 0:00

#sdl#sdl2#c

Writing 2D Games in C using SDL by Thomas Lively

CS50

2.5M subscribers • 35 videos on Hallway • University channel

YouTube
  • Recommended by 3 people: 3 in engineering communities.
  • Presented by Thomas Lively
  • May be out of date. Uploaded 10 years ago, in an area where tools change fast.

Beginner. No background in the topic needed.

208K views10 years ago3 recommendations

Game developmentProgramming languagesGame programmingC

Thomas Lively teaches how to use the SDL library in C to initialize windows, handle input, and build 2D games.

SDL, the Simple DirectMedia Layer, is the cross-platform game library used in everything from small indie games to Valve’s blockbuster triple-A games to other applications with rich media needs. This seminar will teach you how to use this powerful C library to write your own 2D games. We will talk about the structure of game code and cover the installation and initialization of the SDL library, the creation and management of the game window, how to draw images onto the window, and how to handle keyboard and mouse input. By the end of the seminar you will have created a small demo that you can later build on as much as you want.

Why it's here

3 people recommend this

What people say. Recommended as a helpful starting point for beginners wanting to build graphical or 2D game projects in C.

u/jsalsmanin r/C_Programming • Recommends

On “Introduction to C GUI programming”

> cs50 link to this video Thank you!

u/Mattlonnin r/C_Programming • Recommends

On “I’m new to C and i want to be creative with my first project.”

sounds like you are a little to green. You should start with a guessing game once you know loops and selection Once you have done a few programs that rusn fine in a console this could help you: [video But its very hard to get it to work in the begining when you dont know so much

u/atiedebeein r/C_Programming • Recommends

On “New to C and would a code check please.”

I personally learnt most of my SDL from CS50. For the rest I used the documentation. I fixed the compiler error by just replacing FPS with 60. You can use the preprocessor `#define FPS 60` if you won't be changing the value in the program. I'd recommend it over global constants.