Most SDL demo video I find on the youtube is C++ in Windows, and thank you for making a demo in C and Linux.
@haseldanprince96584 жыл бұрын
@PussyIsHere Hey now, we all have our perks and cons. Try coding with OOP in C.
@hugo-garcia3 жыл бұрын
@Zed hahahaha
@m3hdim3hdi3 жыл бұрын
“The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.” - Joe Armstrong
@s7v7n972 жыл бұрын
@@m3hdim3hdi WTF LOL
@dancom6030 Жыл бұрын
@@haseldanprince9658 object orientation is pretty easy to emulate in C when it is necessary.
@reconmaster9073 ай бұрын
There are nearly no competent sdl c teachers on youtube. This is the only sdl c tutorial i found which actually helped me build something useful and become familiar with the library and documentation. Thanks.
@notdeus38342 ай бұрын
The average SDL Tuber: Hi guys.... waffling waffling afflin... 40 mins later, so yeah, that's how you draw a triangle
@PatrioticGestalt3 жыл бұрын
5 years later, still useful. Thumbs up.
@qwerty2733 жыл бұрын
By far the best video I’ve watched so far on SDL with C. Quick, and easy.
@harriscrews12824 жыл бұрын
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!
@joshli53097 жыл бұрын
This has rendered great help and allowed me to surface above a lot of troubles, thank you. Deserves better applause at the end.
@thomaslively81777 жыл бұрын
Hi Josh, I'm glad you found the seminar helpful! Good luck in your projects :)
@a.v79988 ай бұрын
Loved it man. This is the best SDL tutorial with C language!
@NeilRoy8 жыл бұрын
Note: If you stick in a *default:* for the switch statements, that will get rid of the warnings. If you wanted, you could put some code in the default to output the key that was pressed to the console for debugging. To compile this for Windows I recommend Code::Blocks which comes with MinGW, or grab MinGW and Notepad++ which will colourize the text like gedit and you can compile as he does in a console. Personally I prefer Code::Blocks as you can also download it for Linux which makes it VERY nice for cross platform stuff. It fits perfectly with SDL. The only differences with compiling this with Windows is you have to create your main function like: int main(int argc, char *argv[]) { and you have to link in SDL2main BEFORE you link in anything else -lSDL2main -lSDL2 -lSDL2_Image Otherwise, everything else works as expected.
@w花b2 жыл бұрын
Thanks, I'm in the exact same situation and was tired of making ASCII graphics for my game.
@vaslot6 жыл бұрын
Awesome presentation! I am new to SDL 2 programming and loved it. Thank you!
@yusufmalikul2 жыл бұрын
As of today (2022) your code still works, and I use a mac. Thanks!
@nyume8156 жыл бұрын
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!
@_trion8 жыл бұрын
Awesome introduction to sdl and great teacher, made it easy to understand :-)
@juanpisani92977 жыл бұрын
Awesome CRAP... Where is the CODE ?????????????????????????????????? Were you able to get it ???????????????????????????????????????????????????????????????????????/ Awesome
@vncsdev7 жыл бұрын
github.com/tlively/sdl_seminar/ he told us where to get the code during the first 5 minutes of the video...
@jonathanmoore56193 жыл бұрын
@@juanpisani9297 coding is "not for you", Jen...
@michaelwoodruff57527 жыл бұрын
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.
@karimkohel32405 жыл бұрын
cs5 does it again. thank you guys so much for everything
@UnifyRadar10 күн бұрын
If you use GCC and not Clang, your console will be filled from top to bottom with warnings about unhandled key codes, easiest way to get rid of those warnings is to add a default case to your switch statement that just says default: break; Remember to do this for both the SDL_KEY_DOWN and SDL_KEY_UP switches.
@atiedebee10203 жыл бұрын
This tutorial was great, thank you for this!
@ГерриПитт4 жыл бұрын
Thanks, man! Really really helpful introduction to SDL!
@electricimpulsetoprogramming2 жыл бұрын
this guy explains very good
@FernandoBasso8 жыл бұрын
Wow! This lesson is overwhelmingly informative. Thanks a lot! Superb work!!!
@lev43923 жыл бұрын
Super, super helpful! Thank you so much!
@syedbaryalay58495 жыл бұрын
great presentation mate, nice intro this crazy hell
@beb96323 жыл бұрын
Me: Im gonna write a game with SDL! Segmentation fault (core dumped): Hello
@abhilashsinha1153 жыл бұрын
That's exactly the perfect way to get started, cheers mate!!
@not_herobrine37522 жыл бұрын
its been seven months, any further progress?
@altaghyeer3 жыл бұрын
very good presentation thank you very much
@AikHuMuslim2 жыл бұрын
Thanks for the great content for the c language
@alaindevtecchannel22323 жыл бұрын
This video is quite fantastic, but I'm actually lost on the hello4 and 5 files ... Especially concerning the x and y positions, as long as I'm a beginner in SDL.
@kevinnudel96822 ай бұрын
Thank you.
@evildiesel17097 жыл бұрын
Excellent tutorial! Gonna give it a bash now:)
@gabrielbap13 жыл бұрын
Great class!
@abraham43746 жыл бұрын
Loved this video
@chronicsnail66754 жыл бұрын
You are the best thanks alot !
@yashwanthcb8 жыл бұрын
I would feel happy if cs50 provides a tutorial on openGL/c++
@kopuz.co.uk.6 жыл бұрын
get a book.
@aidensmith62776 жыл бұрын
@@kopuz.co.uk. we got a negative nancy here xd
@kopuz.co.uk.6 жыл бұрын
@@aidensmith6277 because books are negative?
@aidensmith62776 жыл бұрын
@@kopuz.co.uk. no, just the very abrupt reply was a bit... abrupt? Hahaha
@kopuz.co.uk.6 жыл бұрын
@@aidensmith6277 No!
@RJPG_73 ай бұрын
Can i do that in termux?
@LisandroLorea3 жыл бұрын
Why is SDL_PollEvent void? I mean I guess it could also be defined so that you do SDL_Event event = SDL_PollEvent(). I don't have much experience with C. Is it just a convention or is there any advantage in asking for pointers to fill with return values over just returning the values?
@slowbro132153 жыл бұрын
One reason is that it can have more than 1 return value, which is normally impossible in C. SDL_PollEvent also returns an int that tells whether there is another pending event. Sometimes passing by reference instead of value can save memory, depending on the size of the data structure of course. In the case of SDL_PollEvent I would guess it is just to have more than 1 return value. Someone else can correct me if I'm wrong here, I'm still a beginner!
@salimtrabelsi21635 жыл бұрын
thanks man its really helpful 😍❤❤
@katiacor2 жыл бұрын
Hi! I hope you can help me with this. I have Linux running on a virtual machine (VirtualBox + Vagrant), and I use VS Code for access to the Shell and compile from there with the gcc. I just compiled my first SDL2 mini program that should just prompt a window for 2 seconds, however, nothing is showing up. I had no issues at compilation, but nothing pops up when I run the executable (./main). I know the program had no issues cause it returned 0 by the end, and I cannot input anything for those 2 seconds. So I was wondering what is missing in my set up so I can see the window from my program. I apologize if I'm not clear enough, but I only learnt programming in C 3 months ago. Thanks!
@rambabuupreti56696 жыл бұрын
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😕
@stefanluginger36826 жыл бұрын
Rambabu Upreti good idea. I want that, too. I had some C++ in university but C ist still more used and has a lot of interesting use cases C++ does not
@ChristianTheChicken3 жыл бұрын
The C Programming Language by Brian Kernighan and Dennis Ritchie.
@GCKteamKrispy6 ай бұрын
CS50 please make this course for 3D in GD50
@PaketNAParkete6 жыл бұрын
Спасибо большое за видео! мы изучаем эту библиотеку в университете, но преподаватели не очень хорошо нам её объясняют. Мы даже не догадывались, что есть официальный сайт с подробным описанием каждой функции.
@TheUltimateLizard6 жыл бұрын
Что за университет и что за факультет?
@RedQueenOfficial7 жыл бұрын
Awesome
@openmarkand4 жыл бұрын
SDL include convention is SDL.h only though.
@chesterhackenbush7 жыл бұрын
Excellent!
@primalaspid71974 жыл бұрын
Very interresting
@dashl50695 жыл бұрын
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)
@bigboysteen76385 жыл бұрын
make you sure you downloaded and inclused the SDL2 image library, it isn't mentionned here but it is necessary in order to run the program also don't forget to copy the SDL2 dll's in your project's folder
@marcelinoborges50886 жыл бұрын
Don't we have cs50 appliance available to download anymore??
@thomaslively81776 жыл бұрын
This should work with almost no modification on a linux distro like Ubuntu as well.
@openmarkand4 жыл бұрын
Please note that your makefile is not portable as it requires GNU make. Also the include convention is SDL.h not SDL/SDL.h.
@krystof70594 жыл бұрын
on mac its with / and on windows its just SDL.H
@openmarkand4 жыл бұрын
@@krystof7059 no, you have to configure your build system but the official include convention as detailed on the official documentation is SDL.h. that's how CMake configuration packages and pkg-config files are configured when you invoke them.
@wicqedeyebot56317 жыл бұрын
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.
@thomaslively81777 жыл бұрын
Hi John, please make sure you're in the directory with all the .c files when you run `make`!
@wicqedeyebot56317 жыл бұрын
I am in the right directory /Downloads/sdl_seminar-master$. I have been trying to find solution the whole night but it still came up with this: clang -o game hello1_sdl.o `sdl2-config --libs --cflags` -ggdb3 -O0 --std=c99 -Wall -lSDL2_image -lm /usr/bin/ld: cannot find -lSDL2_image clang: error: linker command failed with exit code 1 (use -v to see invocation) Makefile:26: recipe for target 'game' failed make: *** [game] Error 1 . Any idea to make it work without any error as I have never use or install SDL on linux before but I have been programming c on cli.
@@wicqedeyebot5631 Are you sure you installed libsdl2-image-2.0-0 ?
@TheUltimateLizard6 жыл бұрын
Thank you, Dr. Chase, that was very helpful.
@zayanimeriam69267 жыл бұрын
when I try to run the make file I get this error : clang : not found recipe for target (blabla) failed
@zayanimeriam69267 жыл бұрын
I installed clang via the command apt-get install clang and it worked lol
@becomeengineer5 жыл бұрын
@@zayanimeriam6926 GOOD FOR YOU
@kataiho21927 жыл бұрын
IMG_Load does not exist? How do you import it? Also, why doesn't it come with SDL?
@Elsuisse7 жыл бұрын
You should install SDL_image
@abdulkerimyalcn39114 жыл бұрын
can you write a game using allegro library in c can you heelp men thanks
@ThatOneAgarAgarioThePro7 жыл бұрын
how to dwonload this
@manuelkvarda52854 жыл бұрын
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 ?
@wiktorwektor1233 жыл бұрын
Making games is difficult even for professionals. You don't want to make it more difficult than it already is. Use language that you like typing code in. It will be one less hassle in game dev. Booth C and C++ are capable to make AAA games. If you think C is simpler, more fun or you just hate OOP then stick to C. If you can't live without OOP or you need templates and you think that C is too simple then use C++. For end user who will be playing your game it doesn't matter at all. I personally use C, because it fits my style more, but thats my personal preference. As a bonus I get faster compile times, because C and it's compiler is much simpler.
@zayanimeriam69267 жыл бұрын
Undefined reference to SDL_INIT . why? I installed sdl just like in the tutorial?
@fonkytommy5 жыл бұрын
There is no SDL_INIT. I think you wanted to use SDL_Init() --- >It's a function. SDL hints are ALL CAPS and function are like SDL_Function.
@RainingArtillery4 жыл бұрын
This is for when C++ just doesn't bring enough tears and pain
@antohamusician4 жыл бұрын
Fk C++ ))
@giancarloandrebravoabanto70914 жыл бұрын
damn lm about to watch this video. what l was doing all this years?
@axpanos7 жыл бұрын
Thank you mit
@pchandu19958 жыл бұрын
which debian linux distro is that ?
@pchandu19958 жыл бұрын
thanks for the link,it's a Ubuntu based,maybe vanilla debian,by custom VM you mean all the dependency,packages are preinstalled for this cs50(SDL)
@AlexanderEndless3 жыл бұрын
Why nothing for Windows?
@kitsumi023 жыл бұрын
It's for windows too
@rolandbrake7 жыл бұрын
where i can find the source code?
@thomaslively81777 жыл бұрын
Hi Roland, you can find the source code here: github.com/tlively/sdl_seminar
@tessiof5 жыл бұрын
There's no libsdl2-dbg package in Ubuntu anymore.
@LANstorm.5 жыл бұрын
okay
@tessiof5 жыл бұрын
@@LANstorm. okay you too
@LANstorm.5 жыл бұрын
@@tessiof thanks for the info.
@krystof70594 жыл бұрын
download it from official sites
@juniorsantosjerry41885 жыл бұрын
and how configure SDL to Visual Studio 2010?
@Omar_Little8 жыл бұрын
I assume this is for people that are very adept C programmers?
@blackoutgo25978 жыл бұрын
if you’ve finished cs50, im guessing that should be enough
@abandoned75015 жыл бұрын
No, you just need to learn math, a lot of math
@Thelavendel7 ай бұрын
should you still make games with these things?
@EvilRamin7 ай бұрын
If it's just a simple project, then why not?
@Thelavendel7 ай бұрын
@@EvilRamin you could make it a hell of a lot simpler using some other tools?
@gadourmn31506 жыл бұрын
Is this useful for windows compiles?
@ignacionr4 жыл бұрын
In general, good stuff. Just please pay a bit of attention and learn how to use the flags gotten from sdl2-config; the idea is that when you pass "--cflags" you put that on the c compiler flags, and "--libs" is for LDFLAGS (for the linker) that is the reason you get those warnings.
@TheUltimateLizard6 жыл бұрын
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.
@thomaslively81776 жыл бұрын
Hi Michael, it's true that unions only hold one of their members at a time, but in order to do that their size in memory needs to be the same as the size of their largest possible contents. They do not change their size in memory depending on what member had the latest store.
That's an awesome introduction but I still have a small problem github.com/tlively/sdl_seminar.git this link works well but I can't sdl_seminar-master
@zayanimeriam69267 жыл бұрын
Why doesn t this work for meeee T-T
@mahee964 жыл бұрын
Does it still not work? ....just curious 😬
@mikedev52632 жыл бұрын
2022
@locomotivere44974 жыл бұрын
sudo apt install mono-devel sudo apt install mflag linux
@gabrielwilliams63734 жыл бұрын
Nobody: Thomas Lively: The human eye only sees 12FPS.
@UltimatePiccolo5 жыл бұрын
I appreciate the tutorial, but why the hell linux? Why not default to Windows?
@LANstorm.5 жыл бұрын
because linux is superior to windows.
@UltimatePiccolo5 жыл бұрын
@@LANstorm. debatable.
@LANstorm.5 жыл бұрын
@@UltimatePiccolo no not really.
@UltimatePiccolo5 жыл бұрын
@@LANstorm. yes, yes really.
@LANstorm.5 жыл бұрын
@@UltimatePiccolo no.
@texturator9367 жыл бұрын
Very nice tutorial. There were one mistake, or lack of detail. TV and Film: 25 frames per second PAL, and 30 frames per second NTSC world. While Movies in cinema got 24 frames. (That gives special look, with smooth camera movement, and bigger screen, for immersion ) Computer screen movies: usually 30 fps, and new hype on 60fps :)
@BoredChinese7 жыл бұрын
It's CS bud, not film school. What you're saying is already unnecessary information. Computer screen movies? What? If you check the refresh rate of today's monitors then they are almost always 60hz, unless you get a 144hz monitor.
@hetaeramancer Жыл бұрын
this should be named "tutorial on setting up sdl and makefile" ! >:( smh...
@cinder92456 жыл бұрын
CXXXXXX
@duongtricker95316 жыл бұрын
huhu Im vietnamese I don stan enythink
@bahayesilyurt15105 жыл бұрын
what a meme
@voiceoftreason17605 жыл бұрын
My PC runs linux. PC is not another word for Windows.