Coding a Starfield Animation in C

starfield 情報局

✘ Get Access to Source Code and Unpublished Videos on Patreon:
https://www.patreon.com/c/HirschDaniel

✘ How I Study:
How I Learned Vim: https://amzn.to/3ONVG5R
How I Learned C Programming: https://amzn.to/41pvkhU

Coding a starfield animation in C using SDL and very little C knowledge. Hope you enjoy it!

Views:1892
Taqs:動画,ビデオ,共有,カメラ付き携帯電話,動画機能付き携帯電話,無料,アップロード,チャンネル,コミュニティ,YouTube,ユーチューブ

コメント

  • コメント (23)

  • トラックバックは利用できません。

    • @HirschDaniel
    • 2025年 6月 24日 9:55pm

    Boost your creativity, level up your coding, and support my work — all at once.
    Get full access to all source code from my videos, plus 🧪 bonus content, on my Patreon:
    👉 patreon.com/HirschDaniel

    • @kickbaktube
    • 2025年 6月 24日 9:55pm

    Following your video I got it working with SDL3 and c++ 🙂

    • @MrEniroxOfficial
    • 2025年 6月 24日 9:55pm

    So glad to see you have returned ! Hope you’re doing well in your life ! Always amazing videos, I absolutely love it because I can picture myself as you !

    • @Milliliter_kun
    • 2025年 6月 24日 9:55pm

    The issue you encountered at 1:13:18 is because, in C, compound literals can only be used for initialization during declaration. Using them in an assignment statement will cause an error. (If I remember correctly, this kind of syntax is actually allowed in C++.)

    Your solution works just fine, but you already came across a more general approach in your search results—assigning each member individually. In your program, for example, that would look like stars[i].x = x;.

    I really enjoy your videos—watching you build a program from start to finish is a pleasure!

    • @meetjoysar295
    • 2025年 6月 24日 9:55pm

    next time you can use just
    SDL_FillRect(psurface, NULL, COLOR_BLACK);
    no need to create another rect, this does that what you want to erase the whole scene

    • @piqletpiolet2969
    • 2025年 6月 24日 9:55pm

    What color theme are you using?

    • @RiptideBS101
    • 2025年 6月 24日 9:55pm

    Love your videos so much man keep up the amazing work

    • @kickbaktube
    • 2025年 6月 24日 9:55pm

    I really like watching your thought process in action. It helps me to understand the why and how of getting my own codes to work
    Thanks for making these videos.

    • @SiabulHassan
    • 2025年 6月 24日 9:55pm

    Why dont use SDL3? It has better documentation and it’s better than SDL2.

    Btw i’m gonna try this via SDL3. 😊

    • @smelliottelliott
    • 2025年 6月 24日 9:55pm

    this is fascinating to watch, especially since I have no clue what’s going on

    • @p0k3r1st
    • 2025年 6月 24日 9:55pm

    hi which distro and desktop env. do you using man?

    • @ashersamuel958
    • 2025年 6月 24日 9:55pm

    building random stuff just for the sake of programming. I love it!!

    • @Ed_pm
    • 2025年 6月 24日 9:55pm

    Please do you have courses on udemy ?

    • @RiteshRanjan-x4k
    • 2025年 6月 24日 9:55pm

    Missed it

    • @bullyracer2567
    • 2025年 6月 24日 9:55pm

    SDL C IS BACK BABY
    Hope to see you do sand simulation next time.
    Keep it up G.

    • @MilitaryInsights
    • 2025年 6月 24日 9:55pm

    sheesh, in years, especailly in era of AI, i’ve not seen anyone cookin code in vim with C and doin all from scratch no AI and making beatutiful animations, love that man, honestly you are cracked programmer of this century, I want to have the code to this repo if possible Thanks

    • @rokkistart
    • 2025年 6月 24日 9:55pm

    Really love the way you’re thinking, and challenging the tasks. This is so natural and inspiring. Maybe it’s because you’re not trying to pose as superprogrammer, but do it in a simple human friendly way. Thanks 🎉

    • @user-fn5hk8oo9q
    • 2025年 6月 24日 9:55pm

    Let’s gooooooo he did it! 🥳I asked for C last video and you already made one W Video btw I’m gonna make this animation as well, Loved the process so far I’m quarter way done with the video

    • @Acer11818
    • 2025年 6月 24日 9:55pm

    SDL3 in my opinion has a slightly better API, and it’s a bit easier to setup with CMake than in SDL2. you’re right that its not a big deal though

    • @Acer11818
    • 2025年 6月 24日 9:55pm

    39:49 “Zed” would be correct since you’re in Europe and most english speakers (including the British) say it that way. U.S. speakers say it like “Zee”

    • @ZachVFX
    • 2025年 6月 24日 9:55pm

    I love your C video its very relaxing to watch with your voice and great personality, pls keep up ! (and finish the login system in python)

    • @therealer_
    • 2025年 6月 24日 9:55pm

    I just finished building an encryption method in C using the instructions from your video, crazy coincidence you just dropped a new one! Keep it up, man. I have to get professional with C.

    • @Artoria-qn3ib
    • 2025年 6月 24日 9:55pm

    Hi mannn I really missed u. I love ur videos