Creating a Game Loop with C & SDL (Tutorial)

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ก.พ. 2025

ความคิดเห็น • 154

  • @reconmaster907
    @reconmaster907 5 หลายเดือนก่อน +13

    This is an under rated teacher. The amount of knowledge i have collected just from a few hours of watching these videos is probably more than the knowledge i got from my college syllabus. Thanks.

  • @pavelnezamayev
    @pavelnezamayev ปีที่แล้ว +31

    This is very well explained. And the code is beautiful. I love the simplicity of C. Thanks a lot, Gustavo!

  • @cybergizmo6902
    @cybergizmo6902 ปีที่แล้ว +5

    Thank you. I am writing an emulator for the first time in C with SDL and this was a very useful resource!

  • @ulysses_grant
    @ulysses_grant ปีที่แล้ว +7

    I'm saving money to enroll in the 3D Computer Graphics Programming course. I love your videos!

  • @aceaspadesblack7399
    @aceaspadesblack7399 16 วันที่ผ่านมา +1

    Amazing tutorial, your teaching style is really good.

  • @demon_hunter9547
    @demon_hunter9547 ปีที่แล้ว +4

    This was a rather nice introduction to SDL, thanks for making this !!!!!

  • @alpha001
    @alpha001 ปีที่แล้ว +3

    Pretty well explained tutorial, Keep going! Helped me a lot to solve some problems i've been having during my journey on learning about SDL-based game dev :)

  • @abbasio
    @abbasio ปีที่แล้ว +2

    This is a fantastic video, thank you! Great introduction to lower level game programming.
    For anyone like me who might have had issues with the window loading initially - I'm working on Linux (Fedora 39), and when I tried to run the game at 1:07:39 it ran with no errors, but no window appeared. Apparently for some platforms, the window won't appear if you don't have anything to render - continuing with the tutorial and changing the render color made the window show up once I hit the 1:14:00 mark

    • @alnaif3241
      @alnaif3241 ปีที่แล้ว

      I'm also fedora 39 user everything worked perfectly but my window is not centered though I've written the same code.
      Would you please tell me whether your window was centered?

    • @abbasio
      @abbasio ปีที่แล้ว

      @@alnaif3241 My window was also not centered - but I wasn't too bothered by that, so I didn't look into it. My assumption is that there's just some difference in how the origin is calculated in SDL vs how it visually appears in Fedora, so you could probably just play around with the parameters there manually until it looks centered.

    • @alnaif3241
      @alnaif3241 ปีที่แล้ว

      @@abbasio I came to know that the window positioning doesn't work on wayland... So I used Xorg and it worked perfectly.

  • @luscapolo
    @luscapolo ปีที่แล้ว +1

    Amazing video! Thanks for sharing your knowledge here. I learned about capping and delta time in the past but the concepts never consolidated in my mind, now I really understand.
    Thanks again.

  • @gordonmccrary6279
    @gordonmccrary6279 ปีที่แล้ว

    this is one of the best channels on youtube for gamedev. thanks for your content!

  • @dhoncrisley
    @dhoncrisley 9 หลายเดือนก่อน +9

    O sotaque não nega, esse cara é BR

    • @pikuma
      @pikuma  9 หลายเดือนก่อน +7

      Óbvio! 😅

    • @heliofilho6566
      @heliofilho6566 4 หลายเดือนก่อน

      Seus cursos tem legenda BR ?

  • @SirenSeph
    @SirenSeph 6 หลายเดือนก่อน

    truly the best sdl explanation i have seen clear and concise thx very much!

  • @kwameopareasiedu
    @kwameopareasiedu ปีที่แล้ว +11

    I created a relatively simple game without an engine using Electron (Typescript) which ended up around 200mb. Feedback was the game consumed too much resources (I actually expected this from an Electron app running at 60fps on the Chromium browser).
    Ive started learning C and will port the project over to C and SDL. I think I can do way way better. Thanks for this amazing guide... ❤

  • @hapboyman
    @hapboyman 11 หลายเดือนก่อน

    Many thanks, Gustavo. I studied a lot from this very brief explanation.

  • @ChrisMabryTV
    @ChrisMabryTV ปีที่แล้ว +5

    Fantastic video. You are a great teacher - I look forward to doing your 2d game engine course soon!

  • @BryanChance
    @BryanChance ปีที่แล้ว +1

    What a great class! Great explanation of important points in game development concepts.

  • @rodrick2312
    @rodrick2312 ปีที่แล้ว +1

    The best explanation so far, thanks for this content!

  • @dhruvasambhoo3496
    @dhruvasambhoo3496 6 หลายเดือนก่อน

    Thanks a lot, you saved me a lot of time and effort!, GREAT EXPLANATION!, and so far the best video that really helped me on this topic!

  • @oytun3074
    @oytun3074 10 หลายเดือนก่อน +1

    this has helped me a LOT thanks for the lecture!

  • @ianmakesmashups
    @ianmakesmashups 3 หลายเดือนก่อน

    Anyone on the M1 mac, I had to add -I/opt/homebrew/include -L/opt/homebrew/lib to my compile flags to get SDL2 to work. Thanks for the tutorial!

  • @jayaganthan1
    @jayaganthan1 ปีที่แล้ว +1

    Great explanation! Thanks for making this video.

  • @Exotic69420
    @Exotic69420 8 หลายเดือนก่อน

    Haven't touched C before. Only some bare C++. I loved this eitheray and learned a lot.

  • @AnkitSinghKushwah
    @AnkitSinghKushwah ปีที่แล้ว

    Thanks Gustavo. You are always so helpful man

  • @caracal3892
    @caracal3892 11 หลายเดือนก่อน +1

    I have followed the tutorial up to 1:14. I am using vs2022 for c++ and SDL2.30, named the main.c main.cpp and everything compiles without errors. However the screen is black. The program reacts to closing with escape. The console output reports no errors. Not entirely sure where the issue is.
    All functions appear to work as intended, input reacts to the correct key, the window isUsing SDL 2.30the correct size. Just that it is all black.

  • @jasonboyd782
    @jasonboyd782 ปีที่แล้ว +7

    Hi Gustavo. I appreciate all your content and your book on graphics programming is great.
    I took a couple days to figure out, earlier this year, how to get SDL running on my Macbook. Contrary to what you say in this video, gcc/clang was not pre-installed, I had to install Xcode and do xcode-select install to get "command line tools" including clang. Beyond that, I installed homebrew and SDL (homebrew is also not pre-installed), and it took a while to figure out how to get a project in Visual Studio Code to know where the SDL headers and library files were. Finally, because VSCode for some reason was very buggy when trying to run my code in the debugger -- it would typically take a few minutes to start up and another few minutes to respond to each step over, I switched to XCode, where selecting the include and library files was another hurdle.
    I don't know why such things are not well documented somewhere (like SDL's site). It would be good if you could include such things. It was nowhere near as simple as one line of using homebrew to install.
    I'm also curious as I'm learning C and C++, why do we need both .lib files and .dll files on Windows, and what are the equivalent on OSX and Linux? I'm wondering how one bundles up their application for distribution. My understanding is for Windows you would just need to include the .dll file(s) alongside your app? But I'm not sure for Mac and Linux. Any help is welcome.

    • @pikuma
      @pikuma  ปีที่แล้ว +2

      I think I recorded that from what I did on my old Intel-based MacBook. I recently tried an M2 MacBook Pro and I had to install the Xcode command-line tools, yes!
      Also, with SDL now the easiest way of setting the compiler and linker flags is by using:
      `sdl2-config --libs --cflags`
      in your gcc/clang build command.
      Windows .DLLs are usually .SO (shared objects) files on Linux. This is actually a pretty big thing and I'd rather leave a link here to explain it:
      stackoverflow.com/questions/9688200/difference-between-shared-objects-so-static-libraries-a-and-dlls-so
      Even if we don't manually copy the .DLLs on Linux or MacOS, the correct equivalent .so and .dylib files are there in the OS and were installed by the apt or brew package manager.

    • @s1lkysl1m83
      @s1lkysl1m83 ปีที่แล้ว

      the documentation included with the SDL download from the site has all of the installation and configuration information included

  • @eugenevladoff2758
    @eugenevladoff2758 10 หลายเดือนก่อน

    This will now be my favorite video. And of course, I subscribed and liked)

  • @maxraj4280
    @maxraj4280 ปีที่แล้ว

    Really nice tutorial
    it almost made me cry that his channel only has 14k subs :(

  • @jyuart
    @jyuart ปีที่แล้ว

    Just what I needed. Thank you very much

  • @mecaniac9605
    @mecaniac9605 7 หลายเดือนก่อน +1

    cara como eu gostaria de que vc fosse meu professor, estou fazendo um curso seu de assembly de atari 2600 e achei este video por acaso, mt obg por disponibilizar esse material ❤!!
    dica: se puder ponha legendas em pt-br em alguns cursos da udemy issuo ajudaria mt a acelerar alguns topicos (a pesar do seu ingles ser otimo e mt compreensivel)

  • @a.v7998
    @a.v7998 10 หลายเดือนก่อน

    Damm! this was awesome! learned soo much from this video! look forward to follow along ;)

  • @shaikantest7646
    @shaikantest7646 3 หลายเดือนก่อน

    I've come here for pure theory on game loop (since i had generaly understaning, but still had missing a few things), and gladly i've got what i came here for. Thanks for the video.
    If anyone interested in pure theory - you may skip example-game related sections and jump directly to sections "Capping our framerate" and "Using SDL_Delay". While sdl is a thirdparty you probably wont use, the theory behind it is explained quite good. "delta time" is also nice part, just not that relevant to me.

  • @DougLopes
    @DougLopes ปีที่แล้ว +2

    Além da ótima didática, é exatamente o que eu tava procurando GameDev em C puro, porque escrever código sem orientação a objetos é bem difícil de entender depois de estar acostumado.

    • @pikuma
      @pikuma  ปีที่แล้ว

      That's great to hear. Gustavo usually uses C in his lectures.

  • @Mai_Tai_Meyers
    @Mai_Tai_Meyers 2 หลายเดือนก่อน +1

    I'm hoping to create a ray-casting algorithm (similar to the original Doom and Wolfenstein) and using this as a starting point. Wish me luck!

  • @Traiden_
    @Traiden_ 4 หลายเดือนก่อน

    I love this, but I also love whatever clicky keybaord you are using. What is it? I have to know! Keep up the good work.

  • @amund8821
    @amund8821 11 หลายเดือนก่อน

    Wanted to switch from using pygame and I know pygame uses SDL so I decided to try this out. Have to say I like this way of doing this a lot better.

  • @specialx9856
    @specialx9856 ปีที่แล้ว

    Very helpful, thanks for the video👏.

  • @simardeepsinghmudhar7065
    @simardeepsinghmudhar7065 9 หลายเดือนก่อน

    Fantastic Tutorial

  • @fabianrr
    @fabianrr ปีที่แล้ว +1

    Que bueno que lo subiste aca 👏

  • @peterjansen4826
    @peterjansen4826 7 หลายเดือนก่อน +1

    On Arch anyone who has a general gaming-setup has SDL2 too (used by many games) and the name of the package is sdl2 so people can figure that out. :)

  • @ductive
    @ductive 10 หลายเดือนก่อน

    Great lecture, thanks

  • @weitnow
    @weitnow ปีที่แล้ว +1

    Great video😊

  • @PolarisMyWay
    @PolarisMyWay ปีที่แล้ว +1

    Well done! Thank you!

  • @happygofishing
    @happygofishing ปีที่แล้ว +1

    Amazing video, I've always found game engines to be too high level, I keep loosing motivation to learn godot/unity etc, I want to see the raw functions, the render loop, whats really going on etc.

  • @spowrei
    @spowrei ปีที่แล้ว

    great video it really helped me

  • @paulooliveiracastro
    @paulooliveiracastro ปีที่แล้ว +12

    I wouldn't agree with the argument used when picking 24fps. We certainly can perceive less fps as smooth movement (Zelda ran at 20fps on n64). And we can certainly perceive high fps (just see how many people complain when their games are running under 30fps on newer consoles)

    • @pikuma
      @pikuma  ปีที่แล้ว +7

      Oh, I agree! What I meant to say is that ~24 fps (used by films) is about the lowest FPS that the human eye can perceive as animation (instead of frame by frame images). I remember playing Daytona USA back in the day, and the high FPS value was clearly visible! It was different than previous ~30 FPS games we were used to play.

    • @paulooliveiracastro
      @paulooliveiracastro ปีที่แล้ว

      ​@@pikuma what I mean is that even lower FPS can be perceived as animation.
      The game "The Legend of Zelda: Ocarina of Time" on the Nintendo 64 (and many other games on that platform) ran at just 20fps. Was it great? No way! 30 fps is actually much much smoother. But we still perceive that as animation and not as a series of photos.

    • @pikuma
      @pikuma  ปีที่แล้ว +3

      Yeah. I guess you're right. There were games in the past that ran even lower FPS numbers than that and they were still fun. Maybe the 24 FPS is mostly a soft value for the claim. Here's what HP said about it.
      www.hp.com/us-en/shop/tech-takes/what-is-frame-rate#:~:text=At%20a%20minimum%2C%2024%20fps,and%20viewing%20experience%20will%20be.
      It's not an academic journal, but I've seen the number 24 more than once in this claim. Still, not really something to sweat too much over.

    • @David_Raab
      @David_Raab 5 หลายเดือนก่อน

      @@paulooliveiracastro I guess we can even perceive 1 fps as an animation, as long there is not much change between the frames.

  • @shaikshakur
    @shaikshakur ปีที่แล้ว

    Best coding video ever

  • @costelinha1867
    @costelinha1867 ปีที่แล้ว +3

    Você é Brasileiro, Gustavo? Por que se sim, primeiramente, seu Ingles é MUITO BOM! E segundo, acho que esse é o primeiro tutorial de desenvolvimento de jogos em C que eu já vi que n foi postado a mais de 3000 séculos atrás. O que é bom, já que eu tive que usar C num curso que eu fiz alguns meses atrás, mas desde então n consegui achar nenhum motivo pra usar essa linguagem em expecifico. (O que é uma pena, já que eu até que gostava de usar C no curso.)

    • @pikuma
      @pikuma  ปีที่แล้ว +1

      Hi. Yes, Gustavo is Brazilian. 🙂

    • @zrIywcN8XJdHaY13K3tx
      @zrIywcN8XJdHaY13K3tx ปีที่แล้ว

      Notei o sotaque dele de br também

    • @joaobarreto3671
      @joaobarreto3671 ปีที่แล้ว

      @@pikuma Wow that's so nice to hear! knowing we have someone with so much knowledge out there to represent us, is a big motivation to the studies

    • @GameDevBoss
      @GameDevBoss 7 หลายเดือนก่อน

      Gustavo eu tb volto a esse video de tempos em tempos. Hoje eu desenvolvo em SDL por influência sua

  • @adamhafchadi4924
    @adamhafchadi4924 9 หลายเดือนก่อน

    greate video greate explnation! how can i avoid using all the global var that you have used? usally global var are bed practice , myby bulding a struct?

  • @brecoldyls
    @brecoldyls ปีที่แล้ว

    Thank you for the video. I have a question. At 1:45:55, why do we need the right hand side of the logical and expression in the if statement condition? Won't time_to_wait always be less than or equal to FRAME_TARGET_TIME? Or is this to handle integer underflow?

    • @FxWitch
      @FxWitch ปีที่แล้ว

      Did you figured out the answer? I think he added that to only sleep if the game updates slightly faster than the target frame just to sync with fps. Idk.

  • @heyheyheyhoev419
    @heyheyheyhoev419 ปีที่แล้ว

    20:01
    Maybe it's stupid question, but is there any way to skip the all "VC++ Directories" and etc. stuff in VStudio in interface?
    It's too confusing even if you have done this many times, it's always difficult to manage right parameters without errors.
    Only way I remember is to generate project files with CMake(GUI for example)

  • @chill8873
    @chill8873 ปีที่แล้ว

    Very good video!

  • @WojciechDomalewski
    @WojciechDomalewski หลายเดือนก่อน +2

    In C, a return value of zero indicates that the program has completed successfully. Therefore, a value of 0 should be returned.

    • @pikuma
      @pikuma  หลายเดือนก่อน

      @@WojciechDomalewski That is correct. This is not really a hard requirement but a social agreement for functions that return 0 if success, and an error code (different than 0) if they fail.

  • @detroit1988
    @detroit1988 ปีที่แล้ว

    Thanks for your tutorial. I get a fluid game (at 60 hz) like love2d when I put SDL_RENDERER_PRESENTVSYNC option (see my fork of your Github project). In this way it is like love2d : automatically sync. I have notices the SDL 3 wich is an improvement with for example stream sound.

  • @gameprogramming6550
    @gameprogramming6550 ปีที่แล้ว

    Great Content. Love it

  • @DogeOfWar
    @DogeOfWar 8 หลายเดือนก่อน

    Why is it not considered redundant effort by WIndows MSVC projects to have to manually add the lib to BOTH the library directories AND the linker? what is the reason for it not being able to deduce the linkage based on the included libs?

  • @nelbr
    @nelbr ปีที่แล้ว +1

    Loved your video. Just subscribed and will definitely check you book. Thanks for sharing.

  • @FabricioAngelDupraz
    @FabricioAngelDupraz 9 วันที่ผ่านมา

    ¡Buenísimo!

  • @adampassaretti9149
    @adampassaretti9149 ปีที่แล้ว

    Great video, can i ask you how to use the process monitor you used?

    • @pikuma
      @pikuma  ปีที่แล้ว

      Hi there. Gustavo used "htop" for that particular example.

  • @eugenevladoff2758
    @eugenevladoff2758 9 หลายเดือนก่อน

    Hello, Gustavo! Is it possible in SDL2 to find out when the SDL_RendererPresent() function finished working if the SDL_RENDERER_PRESENTVSYNC flag is turned on? Then I could start a new rendering of the back buffer. And I could accurately calculate FPS.

    • @eugenevladoff2758
      @eugenevladoff2758 9 หลายเดือนก่อน

      I tried to measure the FPS and it turned out that in this case no delays are needed. It looks like the render itself adds delays of up to 60 fps. The CPU load is minimal.

  • @mesmodev
    @mesmodev 11 หลายเดือนก่อน

    Hey Gustavo! Loved this course (I saw it back on Udemy)! Could you please tell me how do you record your terminal? I want to achieve a similar style in my videos. Do you record with OBS?

  • @dishtroyer142
    @dishtroyer142 ปีที่แล้ว

    1:32:57 best part of the video

  • @HypesReactive
    @HypesReactive ปีที่แล้ว

    great video!

  • @viylouu
    @viylouu ปีที่แล้ว

    i still get the linker issue after adding the linker stuff in
    im at 24:29

  • @hozunon
    @hozunon ปีที่แล้ว +1

    Was this previously not uploaded? Just having a deja vu moment that I've seen it before.. Unless its on the site

    • @pikuma
      @pikuma  ปีที่แล้ว +1

      Good eye. I'm in the process of removing all the free courses from our website to improve the quality of people enrolling. This was an old lecture that was free on the school website that is now being uploaded to TH-cam. 🙂

    • @hozunon
      @hozunon ปีที่แล้ว

      @@pikuma Sounds like a valid and reasonable plan!

  • @nxfoobarbaz
    @nxfoobarbaz ปีที่แล้ว

    I got a question about "unlimited" FPS.
    What happens if we have a very-very small delta time, such that multiplying a "x-speed" of a ball by its value we get something close to 0?
    Seems like it would be converted to int value (as we can not have 0.01 px), and it will be 0.
    Does it mean that on a very fast computer the ball will not move at all?
    UPDATE: just realized that the GameObject's x and y are floats

    • @FxWitch
      @FxWitch ปีที่แล้ว

      But then those float will be typecasted to int for rect, so still 0? how?

  • @mactheknifeguinness
    @mactheknifeguinness ปีที่แล้ว +1

    Great series. Do you have a book?

    • @pikuma
      @pikuma  ปีที่แล้ว

      No, unfortunately no. Only lectures. 😶

    • @mactheknifeguinness
      @mactheknifeguinness ปีที่แล้ว +1

      @@pikuma well its great to find you. I have a great interest in the didactics of mathematics and gameification and programming. I am also in the uk. I might get the 3D course seems like right what i have been looking for. So far your videos are perfect and the direction of this channel excellent.

    • @pikuma
      @pikuma  ปีที่แล้ว +1

      @@mactheknifeguinness Great to meet you. Let me know if you need any help or want to discuss ideas. 🙂

    • @mactheknifeguinness
      @mactheknifeguinness ปีที่แล้ว +1

      @@pikuma very nice to meet you too. I look forward to everything.

  • @radshahmaddaiyan1633
    @radshahmaddaiyan1633 11 หลายเดือนก่อน

    why after running "The application was unable to start correctly " is showing?

  • @alnaif3241
    @alnaif3241 ปีที่แล้ว

    I'm on Fedora 39, the problem is my window is not centered though I've written the same code.
    Will anyone please help me?

  • @idc2120
    @idc2120 ปีที่แล้ว +1

    I've often seen that substepping is used along with delta time, as a solution to get around some issues where the processing time between frames is large. For example, moving a object with delta time during a lag spike could cause the object to pass through collision that is smaller than the position delta. There are ways around this particular issue such as ray casting, but I just wanted to ask about how this substepping might be introduced in your example.

  • @SABaruj
    @SABaruj ปีที่แล้ว

    currently there are like 15 versions of SDL on windows and i dont know wich one to install, im asking everywhere and i dont know, i just need one that works and thats it, my system is 64 bits windows 10 but im aiming to do a game that can be launched even on 32 bits machines.

    • @pikuma
      @pikuma  ปีที่แล้ว

      If you're using Visual Studio, what you want is the dowload option that contains "devel-VC" in its name. This one comes with the development files (header files, .libs, .dlls) that work well with Visual Studio.
      Visit the SDL homepage, click the "Releases" link, and scroll down to find the "devel-VC" one.
      Here's a direct link to the page: github.com/libsdl-org/SDL/releases/tag/release-2.28.4

    • @pikuma
      @pikuma  ปีที่แล้ว

      This file also contains two folders, one with the library files for x86, and another folder for x64.

    • @SABaruj
      @SABaruj ปีที่แล้ว

      @@pikuma thanks, its on the "lib" folder, i will keep going with my proyect.

  • @Albertmars32
    @Albertmars32 หลายเดือนก่อน

    Can u explain why you are returning 0 for failures and 1 for success? In c++ i was taught the opposite

    • @Albertmars32
      @Albertmars32 หลายเดือนก่อน +1

      Nvm i see why, tho i think using bool would have been preferable

    • @pikuma
      @pikuma  หลายเดือนก่อน

      @@Albertmars32 Definitely. I agree. 🥲

  • @tempyreuz9469
    @tempyreuz9469 11 หลายเดือนก่อน

    Hey Gustavo, I was just wondering if you're currently working on any new courses or videos? Your twitter page seems to have been deleted.

    • @pikuma
      @pikuma  11 หลายเดือนก่อน

      We are the handle @pikuma on Twitter. And yes, full-force working on a new course.

  • @erzei
    @erzei ปีที่แล้ว

    just for anyone having the "error LNK2019: unresolved external symbol SDL_Init referenced in function main", instead of using x86 on the linker I used the x64 libs and the code works as shown on the video

  • @minhan4444
    @minhan4444 ปีที่แล้ว +3

    Can you give me name of C font in video, please ?

    • @pikuma
      @pikuma  ปีที่แล้ว +1

      Code Page 437

    • @minhan4444
      @minhan4444 ปีที่แล้ว +1

      @@pikuma thanks :3

  • @James-l5s7k
    @James-l5s7k 7 หลายเดือนก่อน +1

    Hurray! C rules!

  • @thomasnguyen1150
    @thomasnguyen1150 ปีที่แล้ว

    What’s the font you use?

  • @David_Raab
    @David_Raab 5 หลายเดือนก่อน

    It's not quite right that the fps doesn't matter as long we use some kind of deltaTime. I run into this problem lately where i didn't activated frame-cap and the game run over 12000 fps. I started and just let some ball bounce and it was somehow wrong. Activating a frame-cap made it right. The problem is simply that running at extremely high fps can lead to extremly small floating point values and floating-point arithmetic starts to break. I guess it is important because not restricting frames and starting with a new project where you literally do nothing will always yield extremely high fps.

  • @2dapoint424
    @2dapoint424 ปีที่แล้ว +2

    Can you do a game tutorial using Raylib?

    • @pikuma
      @pikuma  ปีที่แล้ว +3

      I'll probably focus my efforts on new courses at the school first, but I'll see if I can squeeze something small using Raylib here on TH-cam in the future. 👍

    • @2dapoint424
      @2dapoint424 ปีที่แล้ว +1

      @@pikuma thank you :)

  • @grenadier4702
    @grenadier4702 ปีที่แล้ว

    What font do you use?

    • @pikuma
      @pikuma  ปีที่แล้ว

      Code page 437

  • @tullman3craggs102
    @tullman3craggs102 8 หลายเดือนก่อน

    feel when now its github download link, and theres no lib folder

  • @jamessouza6927
    @jamessouza6927 ปีที่แล้ว

    👏👏👏👏👏👏👏👏👏👏👏👏

  • @tsukamigames
    @tsukamigames ปีที่แล้ว +2

    tu é br né?

    • @pikuma
      @pikuma  ปีที่แล้ว +1

      Sim.

  • @LauraCraig-b7z
    @LauraCraig-b7z 3 หลายเดือนก่อน

    Claudia Hollow

  • @clintonreisig
    @clintonreisig 11 หลายเดือนก่อน

    What is wrong with the sound?

    • @pikuma
      @pikuma  11 หลายเดือนก่อน

      Probably the old mic I had when I started to record these videos years ago. Hopefully the newer videos are a bit better.

  • @patrickjaeger9714
    @patrickjaeger9714 6 หลายเดือนก่อน +1

    why is main() returning FALSE?

    • @pikuma
      @pikuma  6 หลายเดือนก่อน +1

      GOod question. So, a C executable might be called by the operating system or other application, and some of these applications or OS would expect a return from your C program. This return is basically an "error code". In our case, since everything ran perfectly and there were no errors, our return error is 0. If there was some issues mid-program, we might also return something else. But in this simple example, return 0 at the end is enough. Some modern versions of the C language also allow programmers to return the constant EXIT_SUCCESS, which is exactly the same as return 0.

  • @hobbit125
    @hobbit125 8 หลายเดือนก่อน

    Creating a Game Loop in an extremely old version of C & SDL.

  • @RegenerationOfficial
    @RegenerationOfficial ปีที่แล้ว

    Explains what he doesn't want to do like foreshadowing

  • @FrankBudino
    @FrankBudino 6 หลายเดือนก่อน

    bro yappin

    • @pikuma
      @pikuma  6 หลายเดือนก่อน +1

      I was not aware of what that meant in English.
      "Yapping" means to talk a lot in a very annoying way."
      I guess it all checks out. 😅

    • @FrankBudino
      @FrankBudino 6 หลายเดือนก่อน

      @@pikuma It's kind of a zoomer phrase nowdays, just a joke. Appreciate the SDL2 tutorial very much, as there are virtually no pure C tutorials around and most use C++. It is much easier to build a 2D engine using just C.

  • @rexoverwatch
    @rexoverwatch ปีที่แล้ว

    i need a very simple 15v15 first person shooter game made for me, do you know of any programmers willing to take on small projects? thank you

  • @Oaifee
    @Oaifee ปีที่แล้ว +1

    Você é Brasileiro não é?

    • @pikuma
      @pikuma  ปีที่แล้ว +5

      Sim. 🙂🇧🇷

  • @designordu159
    @designordu159 8 หลายเดือนก่อน

    install on linux: quite easy.
    install on mac: hmmm! easy too
    install on windows: incantations n magic spells, windows need true love kiss to work

  • @jvega1793
    @jvega1793 ปีที่แล้ว

    Promo>SM 👉

    • @pikuma
      @pikuma  ปีที่แล้ว

      Sorry, I don't understand what that means. 😔

  • @Sniffer194
    @Sniffer194 หลายเดือนก่อน

    bro coding on GameBoy Color

  • @StellarHarbour
    @StellarHarbour 2 หลายเดือนก่อน

    I wish there was more C content, you finish C programming playlist by watching and writing useless stuff and don't know anything about development after that and if you're that unlucky one who wants to make games and not high speed quantum calculators or whatever, you literally have no content...

  • @ShaunPrince
    @ShaunPrince 4 หลายเดือนก่อน

    No, gcc does not use clang "under the hood". gcc uses IR, were Clang uses LLVM IR. not reason to invent facts to sound cool... when you clearly are not.

    • @pikuma
      @pikuma  4 หลายเดือนก่อน

      @@ShaunPrince I am most definitely not "cool." But I believe you are confused about what I meant by "gcc executes clang" in the video. What I meant is that on macOS, the /usr/bin/gcc file points to clang. Even though both Linux and macOS users can type the same "gcc" command in the shell it's useful to let them know that they are *not* really invoking the GCC compiler if they are on macOS.

    • @ShaunPrince
      @ShaunPrince 4 หลายเดือนก่อน +1

      @@pikuma interesting to know, as I tested in Ubuntu and got upset very quickly and made an emotional comment. In my culture, only rich people use MacOS, so I made an assumption, and I was wrong.

    • @pikuma
      @pikuma  4 หลายเดือนก่อน

      @@ShaunPrince I was also really confused when I saw that the first time. But really, Apple decided to include a file called gcc that simply calls the clang compiler behind the curtains. It tricks some students but at the end of the day I can *theoretically* just use one build command when teaching and it will still work for everyone. 😬

  • @kalekold
    @kalekold ปีที่แล้ว +1

    Jesus, use a proper font!

    • @pikuma
      @pikuma  ปีที่แล้ว

      Sorry, I don't understand what that means.

    • @kalekold
      @kalekold ปีที่แล้ว

      @@pikuma That doesn't surprise me.

    • @paulooliveiracastro
      @paulooliveiracastro ปีที่แล้ว +7

      Wtf? This font is great. Please keep that

  • @c3vette47
    @c3vette47 ปีที่แล้ว

    my makefile build command gives me 'build' is up to date. It doesn't build. Yet if I enter gcc -Wall -std=c99 ./src/*.c -o game directly in the terminal I get a build. I can then make run and make clean and the Makefile executes as it should. Can you help me out please?

    • @ianmakesmashups
      @ianmakesmashups 3 หลายเดือนก่อน

      you may have to add the *.c files as dependencies in the makefile recipe

  • @TheBitProgress
    @TheBitProgress ปีที่แล้ว

    You can use...
    #linux
    timeval timeout;
    timeout.tv_sec = 0;
    timeout.tv_usec = ms * 1000;
    select_(0,NULL,NULL,NULL,@timeout);
    #windows
    WaitForSingleObject(event_, ms);
    ...instead of delay. I think you will get higher precision.