Writing 2D Games in C using SDL by Thomas Lively

June 29, 2020



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.

Nguồn: https://mensagensdamanha.com/

Xem thêm bài viết khác: https://mensagensdamanha.com/game/

All Comments

  • sudo apt install mono-devel
    sudo apt install mflag
    linux

    Locomotive Re44 June 29, 2020 3:28 am Reply
  • Thanks, man! Really really helpful introduction to SDL!

    Герри Питт June 29, 2020 3:28 am Reply
  • can you write a game using allegro library in c can you heelp men thanks

    abdulkerim yalçın June 29, 2020 3:28 am Reply
  • If you're on macOS and your window doesn't seem to be popping up (as it was not for me), it's because you need to poll for events. It seems that on the creation of the window there are a few events that are queued before the window appear event. So try something like this:

    SDL_Event event;
    bool isRunning = true;

    while (isRunning) {
    while (SDL_PollEvent(&event)) {
    if (event.type == SDL_QUIT) {
    isRunning = false;
    }
    }
    }

    instead of using the delay method. Hope this helps!

    Harris crews June 29, 2020 3:28 am Reply
  • Please note that your makefile is not portable as it requires GNU make. Also the include convention is SDL.h not SDL/SDL.h.

    David Demelier June 29, 2020 3:28 am Reply
  • This is for when C++ just doesn't bring enough tears and pain

    RainingArtillery June 29, 2020 3:28 am Reply
  • damn lm about to watch this video.

    what l was doing all this years?

    Giancarlo Andre Bravo Abanto June 29, 2020 3:28 am Reply
  • I spend some time looking for lerning materal for game development wit C. I did not find annything useful. If i found something SDL based it was about C++ and not C. So is it just my personal preference which language i choose at the énd ? what are the benefits of using pure C insead of C++ with SDL ?

    Manuel Kvarda June 29, 2020 3:28 am Reply
  • cs5 does it again. thank you guys so much for everything

    karim kohel June 29, 2020 3:28 am Reply
  • great presentation mate, nice intro this crazy hell

    Syed Baryalay June 29, 2020 3:28 am Reply
  • There's no libsdl2-dbg package in Ubuntu anymore.

    Téssio Fechine June 29, 2020 3:28 am Reply
  • When I run this it just says not responding and the window never appears, there is no error though, and it waits 5 seconds and then quits. (I am on mac)

    DashL June 29, 2020 3:28 am Reply
  • I appreciate the tutorial, but why the hell linux? Why not default to Windows?

    UltimatePiccolo June 29, 2020 3:28 am Reply
  • and how configure SDL to Visual Studio 2010?

    Junior Santos Gerry June 29, 2020 3:28 am Reply
  • My PC runs linux. PC is not another word for Windows.

    Digital Insan1ty June 29, 2020 3:28 am Reply
  • thanks man its really helpful 😍❤❤

    Salim Trabelsi June 29, 2020 3:28 am Reply
  • Hello,thank your video,where tutorial code that download them?
    https://manual.cs50.net/appliance/2015/
    this link can't open and download.

    Rose Black June 29, 2020 3:28 am Reply
  • Most SDL demo video I find on the youtube is C++ in Windows, and thank you for making a demo in C and Linux.

    Hsin Hung Lin June 29, 2020 3:28 am Reply
  • I am bachelor 1st year student and i wanna learn c to the fullest
    Idk the codes how can i learn the graphics code and other code.
    Is there any book.?
    Please help me anyone😕

    Rambabu Upreti June 29, 2020 3:28 am Reply
  • But where is the game dude?
    I have an example. This rpg has been made with allegro and sdl.
    You can switch between them.

    https://www.youtube.com/watch?v=nuLi_lB6c4Y

    Decrypt Blessing June 29, 2020 3:28 am Reply
  • You were wrong about Unions. They are made to store only one of the specified types of data, and they output only one and the most recently added data. They don't store 'the largest data' in it, as you said.

    The Ultimate Lizard June 29, 2020 3:28 am Reply
  • Thank you, Dr. Chase, that was very helpful.

    The Ultimate Lizard June 29, 2020 3:28 am Reply
  • Don't we have cs50 appliance available to download anymore??

    Marcelino Borges June 29, 2020 3:28 am Reply
  • Awesome presentation! I am new to SDL 2 programming and loved it. Thank you!

    Vishal June 29, 2020 3:28 am Reply
  • huhu Im vietnamese I don stan enythink

    SCVG dương June 29, 2020 3:28 am Reply
  • Loved this video

    Abraham Manuel June 29, 2020 3:28 am Reply
  • Спасибо большое за видео! мы изучаем эту библиотеку в университете, но преподаватели не очень хорошо нам её объясняют. Мы даже не догадывались, что есть официальный сайт с подробным описанием каждой функции.

    Alex Falsh June 29, 2020 3:28 am Reply
  • So I'm planning to make a small platformer for my Data Structure class, this tutorial helped me A LOT to understand and begin the development.
    Next step, reading the documentation!

    Nyume June 29, 2020 3:28 am Reply
  • CXXXXXX

    Dgafecb June 29, 2020 3:28 am Reply
  • Is this useful for windows compiles?

    Gadour Mn June 29, 2020 3:28 am Reply
  • Excellent tutorial! Gonna give it a bash now:)

    Evil Diesel June 29, 2020 3:28 am Reply
  • Hey thanks guy. I've been using lazy foo's tutorial to get farmiliar with sdl, but I think I'll start using the wiki now.

    Michael Woodruff June 29, 2020 3:28 am Reply
  • Excellent!

    Chester Hackenbush June 29, 2020 3:28 am Reply
  • awesome

    plushoom June 29, 2020 3:28 am Reply
  • Thank you mit

    Shrek V June 29, 2020 3:28 am Reply
  • This has rendered great help and allowed me to surface above a lot of troubles, thank you. Deserves better applause at the end.

    Josh Li June 29, 2020 3:28 am Reply
  • I was wondering if anybody has difficulties installing libsdl2-dbg. For some reason it doesn't find the package on ubuntu 17.04 zesty. When I add a different source it does find the package but shows me: The following packages have unmet dependencies:
    libsdl2-dbg : Depends: libsdl2-2.0-0 (= 2.0.2+dfsg1-3ubuntu1.1) but 2.0.5+dfsg1-2ubuntu3 is to be installed

    Any advise on how to solve this?
    Thanks in advance 🙂

    I am running:
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 17.04
    Release: 17.04
    Codename: zesty

    Mo June 29, 2020 3:28 am Reply
  • Undefined reference to SDL_INIT . why? I installed sdl just like in the tutorial?

    Zayani Meriam June 29, 2020 3:28 am Reply
  • Why doesn t this work for meeee T-T

    Zayani Meriam June 29, 2020 3:28 am Reply
  • when I try to run the make file I get this error :
    clang : not found
    recipe for target (blabla) failed

    Zayani Meriam June 29, 2020 3:28 am Reply
  • how to dwonload this

    Amchy June 29, 2020 3:28 am Reply
  • Please help me, I am stuck at when I type make. It came up with this: make: * No rule to make target 'hello_window.o', needed by 'game'. Stop.

    Wicqed Eyebot June 29, 2020 3:28 am Reply
  • That's an awesome introduction but I still have a small problem https://github.com/tlively/sdl_seminar.git this link works well but I can't sdl_seminar-master

    Fabrice Irambona June 29, 2020 3:28 am Reply
  • Awesome

    Red Queen Official June 29, 2020 3:28 am Reply

Leave a Reply

Your email address will not be published. Required fields are marked *