Mandelbrot Set In C++ with SDL2 Tutorial 👨‍💻️ | Project in 50 lines of code

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

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

  • @DestinyAwaitsChannel
    @DestinyAwaitsChannel 2 года назад +6

    One of those things that seems complicated due to the complexity(heh) of the end result, but is actually simple both in concept and implementation. Excellent introduction to SDL2 and the basics of C++, no stone left unturned.

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

    Enjoyed it a lot. Had to do a similar exercise for my C class before and recently tried to reproduce it in C++.
    I didnt know about the lerp function, saves a lot of efford to not have to manually convert coordinates.
    What i want to know now is how much performance could be gained by not using the complex class and the pow function.
    Edit:
    Using doubles instead of std::complex results in an about 5x performance gain.
    For an 1000x1000 image, it takes my pc about 1.3 seconds to render using doubles and 6.5 seconds using the complex class

  • @TonyRios
    @TonyRios 2 года назад +3

    I haven't touched C++ in 5 years thanks for sharing.

    • @TheBuilder
      @TheBuilder  2 года назад

      if you are getting back into it, i recommend taking a look at c++20 ranges

  • @anime_erotika585
    @anime_erotika585 Год назад +8

    It's so hilarious "If you don't know how it works, i'll show you in python" lmfao

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

    After playing with variables, I realized that to zoom image, you can decrease the values ​​​​passed to the std::lerp function. In this way, you can bind the + and - keys to zoom-in and zoom-out. And what should be changed in the function to move the fractal left and right?

  • @rewixx69420
    @rewixx69420 2 года назад +4

    15:00 [megolovania starts playing]

    • @Pyro-jdy
      @Pyro-jdy 2 года назад

      lmao

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

      You'd have to explain this to me, I'm not up to what you young kids listen to these days

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

      @@TheBuilder megalovania is the soundtrack of a boss in the game undertale, but im not sure how that timestamp is related to that.

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

      @@treudden "Otherwise, you're gonna have bad time" is what sans saying before starting beat sht out of you

  • @zacharyhansen1474
    @zacharyhansen1474 2 года назад +3

    Great tutorial! However, I only get a black/empty screen when the program runs. Any obvious ideas why?

    • @TheBuilder
      @TheBuilder  2 года назад +4

      give it a few seconds

    • @zacharyhansen1474
      @zacharyhansen1474 2 года назад

      @@TheBuilder Yessss!! Thank you so much. It works beautifully.

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

    SDL_main must return a value error. How to fix it?

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

      why are you asking me? I just made the video

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

      @TheBuilder 👀 I followed your tutorial and got an error. Searched online and didn't get a solution. So wouldn't it be natural for me to ask you?

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

      @@Codeynamics i'd ask ChatGPT

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

      ​@@TheBuilder I tried man. It didn't work. Fine if you don't want to help. 😑.

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

    How did you enable SDL code snippets and highlighting in vs code?

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

      C/C++ extension from microsoft plus maybe a dedicated SDL one