1. C++ Cross Platform Build System - Celeste Clone

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 42

  • @Cakez77
    @Cakez77  Год назад +11

    🚨🚨 IMPORTANT🚨🚨 The Vim extension is optional and changes how you do text input, if you don't know what it does, please don't use it! Sorry about that.
    Build Systems in C++ can be annoying to deal with. This Tutorial aims to create an unorthodox, yet simple Build System that can be used on Windows, Linux and Mac at the same time.

  • @JoaoSouza-qn9gh
    @JoaoSouza-qn9gh Год назад +10

    i love the fact that you're doing these tutorials while actually focusing in doing a game

    • @Cakez77
      @Cakez77  Год назад +2

      Thanks bro I appreciate the kind words!

  • @soykiokin
    @soykiokin 2 месяца назад

    I found gold with this series, I'm new in OpenGL and this series is basically for every level on programming, thank you so much for the series

  • @rmt3589
    @rmt3589 Год назад +5

    I'm so lucky to have found this! Just started working on my own engine, and need more tutorials like these. (Still in planning stage)

    • @Cakez77
      @Cakez77  Год назад +2

      That's cool, good luck bro

  • @mikk5428
    @mikk5428 Год назад +4

    Its a good decision to clarify this stuff.

    • @Cakez77
      @Cakez77  Год назад

      Yeah I think so, too. It sucks because the original video was doing great, but it shouldn't be at the expense of the viewer and if they are following along

  • @prodigiart
    @prodigiart Год назад +2

    Excellent tutorial! You've achieved a remarkable balance between providing in-depth coverage of crucial steps for a seamless start and maintaining a brisk pace which allows developers to dive straight into action. As a contributor within the Mac platform community, your work inspires me to crack-on and complete my own contributions, ensuring that developers on any platform, including Mac 😉, can benefit from these tutorials.☺

    • @Cakez77
      @Cakez77  Год назад

      Glad you like the tutorial, would be really cool if we get mac to work too. The final engine is not gonna change much, so take your time.

  • @tictactoc9311
    @tictactoc9311 Год назад +2

    This is great please continue

    • @Cakez77
      @Cakez77  Год назад

      Sure sure, working on more

  • @Giga4ever
    @Giga4ever Год назад +5

    Wow, surprised that you addressed the issue that quickly, so kudos for that.
    I don't get your argument, though, because whether you pass libs to clang++ or to your CMake target doesn't really change how it works under the hood. Same with warnings, definitions, etc. The only thing CMake abstracts are just some default flags for the profiles, but you could just specify them yourself. The rest is just boilerplate. Also, CMake will even print out the compiler commands with the arguments when building.
    The important concepts will be the same.
    Your old CMake example feels like a strawman, because you are comparing the "single source file with no non-system dependencies" with a "bunch of source files with tons of dependencies and even a package manager". Try to add a package manager to your bash file and see how complex THAT gets.. Also, you don't know what "project" does, but in your bash file pgrep, if -z, and tasklist | grep are clear? You need to learn the commands and syntax for either of them anyway..
    I wouldn't care for it, since you just might have very specific preferences. However, you are actually presenting your videos as a tutorial, which means beginners will pick up that non-standard way, which causes more harm than good for them. Kinda how the Cherno spread the silly practice of macros around GL calls. They are now locked into a very specific setup(they can't even use basic Visual Studio with your solution, despite having to install it anyway, which is kinda nuts if you ask me). Also, there are more issues than just the incremental build times, but you only chery-picked one of the drawbacks that I mentioned before.

    • @thesun___
      @thesun___ Год назад +2

      I have been using just a Makefile to compile my code for the reason being that I don't like the workings and syntax of CMake, so I can understand his stance on not liking CMake. I still think it is strange for him to use a shell script as a build system, but sometimes it is fun to make things from scratch.

  • @tamir3441
    @tamir3441 Год назад +1

    This feels like an accelerated handmade hero, will follow it for sure! Thanks for doing this

    • @Cakez77
      @Cakez77  Год назад

      Handmade Hero was a great inspiration for sure, and yeah unfortunately his videos are very long, but also filled with lots of information

  • @MiteBlueRuby
    @MiteBlueRuby Год назад +2

    7:30 If you don't know how Vim works, dont use the extension. Vim is really hard to learn, but if you do know it, can speed up development. Vim emulation changes VSCode's entire input system, so only install if you know what you are doing.
    EDIT: just saw ShadowDrakken's comment and that sums it up better.

    • @Cakez77
      @Cakez77  Год назад +1

      Yeah I should have talked about that in the video, thanks for the feedback

  • @ShadowDrakken
    @ShadowDrakken Год назад +5

    omfg, don't tell people to install VIM without warning them that it will completely break all the default keyboard shortcuts in Windows. Took me an age to figure out Vim was why copy/paste no longer worked and Vim was causing every other shortcut to do random ass crap. It was also causing cout to have extra non-printing characters at the end, which was f*ing annoying.

    • @Cakez77
      @Cakez77  Год назад

      Oh, I thought it was obvious that VIM is a different mode to type in, maybe I should have mentioned that. Sorry to hear that is gave you trouble, yeah VIM does change the entire input system

    • @jorgevillarreal2245
      @jorgevillarreal2245 7 месяцев назад +1

      hahaha this is why you always read the youtube comments, I also had to spend some amount of time to figure this out. Glad to see I wasn't the only one hahaha

  • @GillesLouisReneDeleuze
    @GillesLouisReneDeleuze Год назад +5

    You don't need an .sh file
    Just put this on top of your main.cpp:
    #if 0
    clang++ -o game.exe main.cpp ... all the other build arguments ...
    exit
    #endif
    Now your main.cpp can build itself.
    It's also possible to make it work as a batch script on Windows, just a little more complicated:
    #if 0
    :; clang -o "bin/game" main.cpp ...
    :; exit
    cl.exe -Fe"bin/game.exe" main.cpp ...
    exit
    #endif
    In batch script, the colon ":" means a label and all the commands after it are ignored.
    In Linux shell, the colon ":" is a noop (and also true).
    You can make this script even more sophisticated with OS and compiler detection, etc.

    • @Cakez77
      @Cakez77  Год назад +2

      That's actually very interesting lol. Never seen that. I think the sh file still makes sense as a file to build, like an installation file, really cool that this is possible tho

    • @bluesillybeard
      @bluesillybeard 8 месяцев назад

      This is actually genius, although as soon as you have multiple files things might get a bit dicey

    • @arl-t8d
      @arl-t8d 3 месяца назад

      What? I don't understand

    • @GillesLouisReneDeleuze
      @GillesLouisReneDeleuze 3 месяца назад

      @@bluesillybeard #include "other_file.c"

    • @bluesillybeard
      @bluesillybeard 3 месяца назад +1

      @@GillesLouisReneDeleuze Oh yeah, unity builds exist lol

  • @mirrir
    @mirrir Год назад +1

    Goddamn clang gave me about an hour of troubleshoot time and still doesn't recognize the standard libraries.
    I'll keep using it for its intended purpose: linting, and stick with g++, which actually works as a compiler
    yes I am on Linux, how could you tell

    • @Cakez77
      @Cakez77  Год назад

      What was the perform with clang? Did you use the wrong version?

  • @GeorgiyChipunov-C65
    @GeorgiyChipunov-C65 11 дней назад

    I’m compiling llvm on my big box machine but in my bedroom my computer is minimally running compiling off mingw without visual studio . I was able to compile the ogl samples but also didn’t install glee yet so modern-tutorials-master can’t compile yet. Mingw uses g++ to compile on windows 10. I’m trying to start making a simple 2D game for windows and android and webgl (maybe) . I worked in Source engine 1 and Amazon lumberyard engine before so I have my heavy setup on my big box computer in garage with visual studio while my bedroom computer is has Android studio also installed with oldest ndk 9r for trying to make older device apps. The idea is to make games also for windows 7 possibly and other 32 but devices like raspberry pi zero arm 32 and windows 7 32 bit. Using notepad++ and command line to compile . Too avoid gradle and vs . Thank you for mentioning in detail about sh.exe this will help me. I’ll see how it goes when I start working on etc1 and kts textures and also net sockets for trying to add some multiplayer with this minimalist setup

    • @GeorgiyChipunov-C65
      @GeorgiyChipunov-C65 11 дней назад

      cmake -G "MinGW Makefiles" -S . -B . -DCMAKE_INSTALL_PREFIX=C:\mingw64\x86_64-w64-mingw32
      mingw32-make all
      mingw32-make install

  • @calderarox
    @calderarox Год назад +5

    i think using a script instead of CMake is a good and clean approach we want to learn how to make a games with c++, not how CMake works

    • @Cakez77
      @Cakez77  Год назад +3

      You are right about that, but the feedback about the build system is still valid. Nonetheless the build system is decided, in the future I can add CMake for fun to see how it works

  • @nejathakan5521
    @nejathakan5521 Год назад +1

    👍

    • @Cakez77
      @Cakez77  Год назад

      Glad you like it bro

  • @CalebCleavinger
    @CalebCleavinger 6 месяцев назад

    lol. I'll just stick with premake

  • @ulrich-tonmoy
    @ulrich-tonmoy Год назад +1

    Can you make one build system with Zig

    • @Cakez77
      @Cakez77  Год назад +2

      I suppose we can do that in the future when the tutorial is finished, like an addition for fun. Same with CMake and then add that as an option

    • @happygofishing
      @happygofishing Год назад

      zig has its own build system.

  • @darknetworld
    @darknetworld 6 месяцев назад

    cmake is good and bad if not enough knowledge and proper setup. It a lot digging. But for SDL2 it not easy way to set up. But there couple way to do set up by youtubers. Knowing the docs aim for expert for beginner it not easy.