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.
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
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?
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.
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
I haven't touched C++ in 5 years thanks for sharing.
if you are getting back into it, i recommend taking a look at c++20 ranges
It's so hilarious "If you don't know how it works, i'll show you in python" lmfao
yes
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?
15:00 [megolovania starts playing]
lmao
You'd have to explain this to me, I'm not up to what you young kids listen to these days
@@TheBuilder megalovania is the soundtrack of a boss in the game undertale, but im not sure how that timestamp is related to that.
@@treudden "Otherwise, you're gonna have bad time" is what sans saying before starting beat sht out of you
Great tutorial! However, I only get a black/empty screen when the program runs. Any obvious ideas why?
give it a few seconds
@@TheBuilder Yessss!! Thank you so much. It works beautifully.
SDL_main must return a value error. How to fix it?
why are you asking me? I just made the video
@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?
@@Codeynamics i'd ask ChatGPT
@@TheBuilder I tried man. It didn't work. Fine if you don't want to help. 😑.
How did you enable SDL code snippets and highlighting in vs code?
C/C++ extension from microsoft plus maybe a dedicated SDL one