Making a Game With C++ and SDL2

Поділитися
Вставка
  • Опубліковано 22 тра 2024
  • Making a Game With C++ and SDL2 - GMTK Game Jam 2021
    A year ago, in my "Learning SDL2 in 48 Hours" video, I used the 2020 GMTK Game Jam as an opportunity to try to learn how to use C++ with SDL2 (a low level audio, input, and graphics library that you've probably heard of). In this video, I attempt the challenge again, for the GMTK Game Jam 2021!
    Check out Twini-Golf here: polymars.itch.io/twini-golf
    → Source Code: github.com/PolyMarsDev/Twini-...
    Codergopher's SDL2 series: • C++/SDL2 RPG Platforme...
    → Twitter: / polymarsyt
    → Twitch: / polymars
    → Join the PolySpace Discord: / discord
    --Chapters--
    0:00 Intro
    0:29 Setting Up SDL2
    0:45 The Theme (bruh)
    1:11 My Secret Plan...
    1:34 Entity & RenderWindow Class
    1:46 Drawing a Sprite
    2:12 My Game Idea
    2:37 Initial Prototype
    2:55 Prototype Code Explanation
    3:39 Prototype Art
    3:49 Tiles & Collisions
    4:05 Collision Code Explanation
    4:23 More Art & Directional Indicator
    4:34 Level Saving/Progression
    5:17 wait frick
    5:38 Creating UI
    6:07 DESIGNING LEVELS FAST
    6:40 Sound Effects
    6:47 Finishing Touches
    7:08 Secret "Feature"
    7:33 Conclusion
    --Music (in order played)--
    "Smooth and Cool" - Nico Staf ( • Video )
    "Westview" - INTRNLCMD ( / intlcmd )
    "Trance Music for Racing Game" - Bobby Cole ( • Trance Music for Racin... )
    "Playtime" - Peter Godfrey ( • Playtime )
    "il vento doro" - JoJo's Bizarre Adventure: Golden Wind
    "Dreaming" - Stevia Sphere ( • Stevia Sphere - Dreami... )
    "I Miss Summer" - Sro ( • Sro - I Miss Summer [V... )
    "Bush Week" - Nihilore ( • Bush Week - Nihilore (... )
    "Glider" - INTRNLCMD ( / intlcmd )
    "Operatic 3" - Vibe Mountain ( • 🎵 Operatic 3 - Vibe Mo... )
    "Breeze" - PolarChips ( • Breeze )
    "Palms and Seagulls" - Timecrawler 82 ( • Timecrawler 82 - Palms... )
    "Above All" - HOME ( • HOME - Above All [Synt... )
    -If you liked this video, here are similar ones you might enjoy!--
    PolyMars - Learning SDL2 in 48 Hours - GMTK Game Jam 2020
    • Learning SDL2 in 48 Ho...
    PolyMars - Learning Python in 2 Days - Pygame Community Jam
    • C++ Developer Learns P...
    PolyMars - Making a Game Using Discord's Bot API
    • Making a Game With Dis...
    Barji - Making a C++ Game with No Experience!
    • Making a C++ Game with...
    Randall - Programming a New Physics Engine for my Game
    • Programming a new phys...
    CodyCantEatThis - I Made The Legend of Zelda Boss Fights but they’re 3D
    • I Made The Legend of Z...
    Dani - Adding a Dragon Boss to my Game Because Steam is Mad at me
    • Adding a Dragon Boss t...
    Dani - He said I Couldn’t Make a 3D Game… So I Made One!
    • He said I Couldn't Mak... ​
    Sam Hogan - I Made a Game with Intentional Bugs
    • I Made a Game with Int... ​
    Sam Hogan - I Made the Hardest Game Ever
    • I Made the Hardest Gam... ​
  • Наука та технологія

КОМЕНТАРІ • 1,2 тис.

  • @PolyMars
    @PolyMars  2 роки тому +1282

    subscribe or get golfed 🏌

    • @anupambhakta3879
      @anupambhakta3879 2 роки тому +9

      🧍‍♂️

    • @topiaz
      @topiaz 2 роки тому +5

      G O L F E D.

    • @topiaz
      @topiaz 2 роки тому +3

      @@cherryberry1345 this was probably a privated video 9 hours ago, he commented, and 9 hours later (aka now) he unprivated the video to be released to the public

    • @russori5758
      @russori5758 2 роки тому +1

      anything but golfed

    • @AntChannel
      @AntChannel 2 роки тому +1

      @@cherryberry1345 was programmed i think

  • @_Guigui
    @_Guigui 2 роки тому +1141

    I love how your game was so good it decided to take the entirety of the available ram

    • @not_herobrine3752
      @not_herobrine3752 2 роки тому +108

      unused ram is wasted ram

    • @jased8461
      @jased8461 2 роки тому +40

      im running it and its currently taking 32gb and counting help

    • @not_herobrine3752
      @not_herobrine3752 2 роки тому +11

      @@jased8461 goated setup

    • @achtsekundenfurz7876
      @achtsekundenfurz7876 2 роки тому +20

      There's also that innocent look... It wouldn't look out of place on the SNES with those shades of green and 2D shapes. You could build a golf level that looks like a Super Mario World screen. Inside a program that leaks more RAM than the SNES ever had - in a single frame.

    • @sophiacristina
      @sophiacristina Рік тому +3

      @@not_herobrine3752 I guess i never waste my ram, i even use virtual memory so there is more to not waste!

  • @Tantandev
    @Tantandev 2 роки тому +2075

    Idk why but watching people create stuff without game engines is always oddly satisfying

    • @user-hl7lr8ld2i
      @user-hl7lr8ld2i 2 роки тому +32

      hey Tantan, please create more rust games :)
      love to watch your videos

    • @klanehz6291
      @klanehz6291 2 роки тому +5

      Hi tantan

    • @Dorbellprod
      @Dorbellprod 2 роки тому +7

      It truly is.

    • @PolyMars
      @PolyMars  2 роки тому +165

      this is so true

    • @inv41id
      @inv41id 2 роки тому +40

      Imo it's the bestest way of making games... though I personally think of it as writing a custom engine for the game, not as "not using" a game engine

  • @Dorbellprod
    @Dorbellprod 2 роки тому +815

    I haven’t yet seen anyone talk about your game art, seriously, it’s very clean

    • @bytblox3366
      @bytblox3366 2 роки тому +5

      frrrr

    • @EpicVideoGamer7771
      @EpicVideoGamer7771 2 роки тому +10

      was thinking the same thing

    • @WinterNox
      @WinterNox 2 роки тому +2

      Why does he draw them blurry tho

    • @Dorbellprod
      @Dorbellprod 2 роки тому +5

      ​@@WinterNox because anti-aliasing is pretty cool I suppose

    • @WinterNox
      @WinterNox 2 роки тому +3

      @@Dorbellprod He over uses it imo

  • @barj
    @barj 2 роки тому +4278

    Dude you're gonna have to teach me how you always get memory leaks in your games! I've always wanted to implement memory leaks but don't know where to start :(

    • @Chadderbox
      @Chadderbox 2 роки тому +231

      I might be able to help you there

    • @yeppiidev
      @yeppiidev 2 роки тому +235

      @@PolyMars haha nice deal
      nope

    • @RobLang
      @RobLang 2 роки тому +185

      Savage.

    • @frosty7674
      @frosty7674 2 роки тому +173

      Just make everything public in a class, or overload lot of functions or kinda just badly organize your code and you're done. No need to pay $20,000

    • @yeppiidev
      @yeppiidev 2 роки тому +23

      @@frosty7674 lmao

  • @nishantmogha7679
    @nishantmogha7679 2 роки тому +592

    Memory leaks could be a really good theme for a game. Just finish the game before the game crashes, or worst your computer crashes.
    At the end the score can be calculated based on the total amount of memory leaked throughout the game. The least the better.

    • @coronaklledmebot4856
      @coronaklledmebot4856 Рік тому +3

      ok mogba

    • @greg77389
      @greg77389 Рік тому +69

      Yeah but then it becomes pay to win since more RAM = easier gameplay

    • @nishantmogha7679
      @nishantmogha7679 Рік тому +39

      @@greg77389 You can complete the game with more ram but that wouldn't help with the overall score. More the memory leak lesser the score.

    • @ZqTi0
      @ZqTi0 Рік тому

      @@nishantmogha7679 Then there has to be an inital score or a set time limit. More RAM = more time to play = more score to accumalate.

    • @anon_y_mousse
      @anon_y_mousse Рік тому

      That would certainly be an interesting form of code golf. Shorter code, shorter play time, win!

  • @SoicBR
    @SoicBR 2 роки тому +152

    Most MBs of memory leaks per second any% speedrun

  • @SummonerArthur
    @SummonerArthur 2 роки тому +554

    You know this is just BEGGING to be ported for the nintendo ds, right?
    I mean, two screens... Stylus...

    • @PolyMars
      @PolyMars  2 роки тому +203

      ohno

    • @slomg_
      @slomg_ 2 роки тому +50

      @@PolyMars you have to do it now (◕ᴗ◕✿)

    • @slitnotgm
      @slitnotgm 2 роки тому +34

      @@PolyMars port it for nintendo 3ds. *now.*

    • @sweetcorm
      @sweetcorm 2 роки тому +14

      @@PolyMars oh yeah

    • @rogerwinright2290
      @rogerwinright2290 2 роки тому +14

      @@PolyMars Now, it must happen

  • @CunningBard
    @CunningBard 2 роки тому +339

    Polymars: * hears the theme *
    Polymars: My disappointment is immeasurable and my day has been ruined

    • @silverthehedgehog8989
      @silverthehedgehog8989 2 роки тому +3

      Next Year: we need a new Game Jam idea!
      Game Jam: No we do-
      PolyMars: YES, YOU DO.

  • @joshkanyinda5569
    @joshkanyinda5569 2 роки тому +113

    I love that you included the actual math in these videos. I try to pause and think how it works in a math equation.

    • @stxnw
      @stxnw 2 роки тому

      u have to THINK? how old r u?

    • @joshkanyinda5569
      @joshkanyinda5569 2 роки тому +13

      @@stxnw he included the Pythagorean theorem and slope form into code? I read it to understand how the hell he did it. I’m 15 btw.

    • @stxnw
      @stxnw 2 роки тому +1

      @@joshkanyinda5569 oh ok then it’s fine. i was like that at 15 too

    • @prodbytukoo
      @prodbytukoo 2 роки тому +13

      If you are interested in getting into gamedev, you will be using the Pythagoras theorem all the time, and try to understand the atan2(x, y) function, it's really important.
      I recommend you getting into interesting pre-calculus stuff, mainly trigonometry, it's used a ton in everything.
      For example sin(angle) returns a 'y' position and cos(angle) returns a 'x' position of a circle, that's something that usually high schools don't teach, but it's very important. The movements of the ball of this game are for sure using sin(angle vs mouse) for 'y' velocity and cos(angle vs mouse) for 'x' velocity.
      If you graph it you will see that if you draw a line for each position in the circumference starting from the middle, the length will be the same, which in linear algebra is called magnitude, this means that the force that it is applying is the same for each direction.
      Hope you find it interesting, good luck.

  • @giovanniluddeni663
    @giovanniluddeni663 2 роки тому +166

    The actual friction law would have the friction to be proportional to the velocity (maybe plus a little constant to lower the final tail of the movement). I think that way the movement would look more realistic

    • @PolyMars
      @PolyMars  2 роки тому +51

      oh that's interesting, thanks!

    • @greg77389
      @greg77389 Рік тому +1

      But IRL the golf ball will do some bouncing at higher speeds, meaning it has no ground contact at those times and thus will have less friction than a slower moving ball. Plus, you'd actually be simulating a particle moving through a fluid of a certain viscosity rather than simulating a ball rolling on a rough surface.

    • @silience4095
      @silience4095 Рік тому +1

      Friction is independent of speed tho.

    • @fuji_films
      @fuji_films Рік тому +4

      @@silience4095 Well, not really. Friction in a fluid is directly proportional to the speed, when v is small, or to the square of the speed, when v is big.
      Look up, for example, Stokes equation for a sphere moving into a fluid.

    • @silience4095
      @silience4095 Рік тому

      @@fuji_films That is aerodynamic/hydrodynamic drag. Also, there's pressure drag, friction drag, wave drag, and induced drag. You're talking about the total, which is only partly due to friction. So, no, I wouldn't say that friction can be used interchangeably with drag. They don't mean the same thing.
      In the comment thread, we are talking about the classic friction. Static, rolling, and sliding. None of those 3 depend on speed.

  • @devilxnuxify
    @devilxnuxify 2 роки тому +167

    4:34 Maybe it would be nicer if you store level configuration in a JSON file then deserialize them on the fly using libraries such as nlohmann/json or similar. Then you don't need to painstakingly hardcode every level. And by using external data it would be easier to expand your game

    • @programaths
      @programaths 2 роки тому +9

      LDTK, which spit out a JSON. So you even have a very competent level editor!

  • @vurtua7
    @vurtua7 2 роки тому +8

    I literally love your use of graphics to visually explain how your code works. 10 outa 10

  • @StrongLoneWolfPack
    @StrongLoneWolfPack 2 роки тому +4

    Was getting into c++ myself finally and in a breif handful of frames you solved my compiler needs, thank you

  • @Lee14G
    @Lee14G 2 роки тому +13

    Well done. Amazing job. I wouldn't stress too much about the memory leaking. This is how we learn and become better developers. Keep going!

  • @nineephe
    @nineephe 2 роки тому

    The editing is just top notch! I really like your style.

  • @10dvvks.d.r.tharun15
    @10dvvks.d.r.tharun15 2 роки тому +5

    well done, I participated in that game jam too, really excited to see your work for the upcoming brakeys game jam 2021.

  • @mrmath519
    @mrmath519 2 роки тому +4

    I lovve your videos, they motivate me so much to learn new libs and c++ itself!

  • @MansoorCodes
    @MansoorCodes 2 роки тому +704

    The king is back 👑

  • @CharcoolDev
    @CharcoolDev 2 роки тому +1

    He is back! Great video polymars, great attempt 2 of the challenge

  • @Goodgis
    @Goodgis 2 роки тому +6

    Another banger as always. Great work, Dude!

  • @Skeffles
    @Skeffles 2 роки тому +14

    Fantastic spin on the theme! It's unfortunate about the memory leak because it looks great.
    Also you're so close to 100k subs! You'll get there soon :D

  • @WannibeManisha
    @WannibeManisha 2 роки тому +41

    Really liked the game concept. Too bad about the memory leaks but it's definitely a learning experience! Great stuff!!

  • @SprintKeyz
    @SprintKeyz 2 роки тому

    Wow! 100k! Congrats, keep up the great work!

  • @mahyellaw
    @mahyellaw 2 роки тому

    i relate too much on your reaction to the theme lol. great video as always man, also you're close to 100k! :DDD

  • @lolliepop112
    @lolliepop112 2 роки тому +282

    I havent looked at the code, but seeing it from just this, most likely you are passing a texture by value instead of a reference, this makes your game building duplicates and pushing the memory pretty quick. Been there ;)

    • @nikkiofthevalley
      @nikkiofthevalley 2 роки тому +58

      Pointers, pointers, pointers!

    • @celmaibunsamper4283
      @celmaibunsamper4283 2 роки тому +8

      @@nikkiofthevalley i think every1 hate pointers..

    • @nikkiofthevalley
      @nikkiofthevalley 2 роки тому +4

      @@celmaibunsamper4283 At this point (ha!) I hate them even more than I did when I posted that, I've had to do a lot of pointer arithmetic and binary operations recently

    • @karankumarmageswaran1550
      @karankumarmageswaran1550 2 роки тому +1

      @@celmaibunsamper4283 fr

    • @milktobo7418
      @milktobo7418 2 роки тому +16

      ​@@celmaibunsamper4283 If you hate pointers then C/C++ is too powerful for you. Stick with scripting languages.

  • @Maxforce12Maxforce12
    @Maxforce12Maxforce12 2 роки тому +61

    "So basically I wasted 48 hours" Ahh yes, the life of coding

  • @CowsDaBest
    @CowsDaBest 2 роки тому

    Top quality editing! Also, you're so close to 100k!

  • @eboatwright_
    @eboatwright_ 2 роки тому

    Ayyyy Congrats on 100k! I remember when you were at like 200! :D

  • @user-id3fc8qs7y
    @user-id3fc8qs7y 2 роки тому +13

    Your videos with making games with SDL are so amazing that I want to launch Visual Studio and make some games with SDL2!

  • @GamesBySaul
    @GamesBySaul 2 роки тому +20

    Great video! I really need to read into memory leaks more, and discover how not to do them, as I've just started doing more C++!
    The game looks pretty fun and cute though! :D

    • @EricWAtchesVideos
      @EricWAtchesVideos 2 роки тому +1

      I ran valgrind on the resulting binary. The only memory leaks were in the Intel DRI graphics driver on my system. There were uninitialized variables for SDL funtions called which should be initialized in anything that would be released. But, this is a quick game example. I did find that the strokes counter should have used std::str.append() instead of +. Also, I wouldn't want to make it too easy, but if the mouse is moved outside of the window area (or screen if you use SDL_WINDOW_FULLSCREEN) it stops increasing the stroke power. I might accomplish that via keyboard or fix this.

  • @nob209
    @nob209 2 роки тому

    I always wanted to make games like yours, its just so cool and interesting how people make games, especially in a Game Jam. Good job!

  • @NikoTeam-ks9ht
    @NikoTeam-ks9ht 2 роки тому

    Love the video and the explanation of how the game works, good work

  • @citrinesanimations
    @citrinesanimations 2 роки тому +4

    Pog you’re about to hit 100k!! Good job buddy!

    • @PolyMars
      @PolyMars  2 роки тому +1

      thank you lego man!!!

    • @yeppiidev
      @yeppiidev 2 роки тому

      @@PolyMars wait what last time i saw you, your sub count were on 50k how did your subcount go high

    • @Ansh77K
      @Ansh77K 2 роки тому

      @@yeppiidev yt reccomended his video a lot ,

  • @ZygerGFX
    @ZygerGFX 2 роки тому +7

    i really like the way it turned out. not using an engine is a challenge in itself but this game is actually very fun. awesome work !

  • @redcubedev
    @redcubedev 2 роки тому +1

    the 200 megs / second are probably the funniest thing i heard all day
    love your videos

  • @benqbtw8881
    @benqbtw8881 2 роки тому

    Congratulations on 100k!

  • @slumberdemon
    @slumberdemon 2 роки тому +9

    When the world needed him the most he returned

  • @haukauntrie
    @haukauntrie 2 роки тому +3

    "Don't get me wrong, I'm still gonna steal his code."
    Too relatable.

  • @justyose9616
    @justyose9616 2 роки тому

    Congrats on 100k subscribers!

  • @mohammadshaf4390
    @mohammadshaf4390 2 роки тому +1

    Dude I am not into game dev that much but your content is great love the humour and sarcasm
    I was waiting for your video plz upload more often ✌

  • @hohi5046
    @hohi5046 2 роки тому +7

    7:09 hey thats me

  • @ThatNiceDutchGuy
    @ThatNiceDutchGuy 2 роки тому +4

    The memory leak is a bonus feature, it is all connected you know. 😂 Well done, none the less!

  • @rallyman94
    @rallyman94 2 роки тому +1

    Great video, as always!

  • @glaseeze
    @glaseeze 2 роки тому +1

    Very good video! Enjoyed it very much!

  • @UseQPixinDune
    @UseQPixinDune Рік тому +9

    Here's a tip:
    Use a debug flag with the compilation command and then use a program like valgrind to analyse the executable. This'll help you track down memory leaks

  • @logosking2848
    @logosking2848 2 роки тому +8

    Would've been chadly if you simply said the memory leaks were a feature and not a bug. Also you make great content. I've learned a lot about game development and art design from you. Your games always look really nice and have a really consistent style.

  • @TylerGreen
    @TylerGreen 2 роки тому

    The level saving code was very intense, great video!

  • @realGrantT
    @realGrantT 2 роки тому

    I’ve just started gamedev so these videos to me are amazing to watch. BTW you are still better than me so congrats

  • @helpmereach45ksubswithoutvideo
    @helpmereach45ksubswithoutvideo 2 роки тому +4

    Fun fact: these videos makes our days better

  • @dragon_pro69420
    @dragon_pro69420 2 роки тому +11

    5:40 Among us!

  • @sfmAmqaqmqeasm2356
    @sfmAmqaqmqeasm2356 2 роки тому

    Congrats on 100k my guy

  • @B8Code
    @B8Code 2 роки тому +1

    Can't wait for you to get your 100k Plaque btw great video 👍🏼

  • @topiaz
    @topiaz 2 роки тому +15

    Yay, a new PolyMars video! Maybe I guess this night could get better after all!
    Also, you're so close to 100k, Glad you've gone so far!
    edit: yay poly got 100k :>>>>>>

  • @idedary
    @idedary 2 роки тому +3

    Cool, can't wait for you to review Opera's GX "No-Internet" Jam. I'm also participating :D

  • @ericlee6029
    @ericlee6029 2 роки тому

    100k subs :D Congrats!

  • @Unpug
    @Unpug 2 роки тому

    100K! Congratulations!

  • @Keyshooter
    @Keyshooter 2 роки тому +6

    i can see it in a near future
    "so, i use java to avoid memory leaks since the garbage collector should take care of that for me but i still got memory leak"
    just kidding tho, great job making it, will try it for sure

  • @oussamaplaysyt90
    @oussamaplaysyt90 2 роки тому

    This is so entertaining and motivating, tnx mah man

  • @jackkjac
    @jackkjac 2 роки тому

    Congrats on 100k subs!!

  • @PossiblyAxolotl
    @PossiblyAxolotl 2 роки тому +3

    Niiiccceee I’ve always wanted to have memory leaks in my games but could never figure out how to get them to work

  • @kilgarragh
    @kilgarragh 2 роки тому +5

    When used improperly old things like c and even c++ can cause issues, be slow, break systems, and be very insecure…
    But when harnessed correctly C is one of the fastest most efficient and powerful programming languages you can write

  • @TehVulpez
    @TehVulpez 2 роки тому

    Love your video editing, it's hilarious

  • @Hexedbug
    @Hexedbug 2 роки тому

    poly mars videos are always a treat

  • @metalbroga
    @metalbroga 2 роки тому +3

    I liked it because you didn’t used any engine, just some c++libs! That’s cool! I’ll check your channel for more content like this, it’s my first time here

  • @alexismandelias
    @alexismandelias 2 роки тому +4

    I'd love to see a video where you fix the memory leak. Should be a fun experience.

  • @kyonas6047
    @kyonas6047 2 роки тому +2

    its so funny last time i watched this vid i knew nothing about game dev and now somehow im using SDL2 to make a game and now i can relate to everything in this vid lol

  • @Willeexd1337
    @Willeexd1337 2 роки тому +1

    Congratz to 100K subs!!

  • @nukeemyeah7293
    @nukeemyeah7293 2 роки тому +4

    “ I guess it was a learning experience or something” lol

  • @DylanMatthewTurner
    @DylanMatthewTurner 2 роки тому +5

    It was a fun jam for sure. My brother and I participated as well

  • @makra42069
    @makra42069 2 роки тому

    These challenge videos keep getting more interesting xD

  • @Nate27
    @Nate27 2 роки тому +2

    Dham good vid, you just earned a sub my man!

  • @lefantastique59
    @lefantastique59 2 роки тому +5

    When I saw you didn't unload your level when it's finished I knew something would happens with memory leaks lmao

  • @casters._.
    @casters._. 2 роки тому +6

    7:31 IM IN THE VIDEO

    • @YessoN-YT
      @YessoN-YT Рік тому

      x)

    • @casters._.
      @casters._. Рік тому

      @@YessoN-YT tu fais quoi ici ????

    • @YessoN-YT
      @YessoN-YT Рік тому

      @@casters._. Toi aussi tu fais quoi ici x)

    • @casters._.
      @casters._. Рік тому

      @@YessoN-YT tu connais ce youtuber ?

  • @LittleBigLucas51
    @LittleBigLucas51 2 роки тому

    Nice, the first sprite you created was a perfectly timed ad for me! ^^

  • @sliver5554
    @sliver5554 2 роки тому

    congratulations 100k!!!

  • @shinystick241
    @shinystick241 2 роки тому +5

    How the hell are you so creative?

  • @brainfl2360
    @brainfl2360 2 роки тому +4

    You don't need to fix memory leaks, just give it a description like: "Use less than () strokes or the game will crash" :)

  • @skchh
    @skchh 2 роки тому

    Happy 100k Poly!

  • @saadtab0156
    @saadtab0156 2 роки тому

    this was real informative, thanks for sharing

  • @immortaldev1489
    @immortaldev1489 2 роки тому +5

    I highly recommend using visual studio instead since it shows the amount of memory being used by the application, or just have task manager running when you run the program

  • @nextProgram
    @nextProgram 2 роки тому +9

    Looks sick. Did you figure out where the memory leak was coming from?

    • @PolyMars
      @PolyMars  2 роки тому +13

      yeah, I apparently can't use SDL properly- I was creating a texture from raw pixel data every frame without destroying it

    • @WinterNox
      @WinterNox 2 роки тому +1

      @@PolyMars I'm not a programmer >:(

    • @Unit_00
      @Unit_00 2 роки тому +1

      @@PolyMars this applies for a lot of things in programming, but generally resource loading/initializing is very intensive, and you should do it just once somewhere in a constructor or something like that

  • @LeftoverAtoms
    @LeftoverAtoms 8 місяців тому

    Thank you for getting me into C++! Now I know what a real programming language feels like after using C# for years.

  • @dawndev2740
    @dawndev2740 2 роки тому

    Congrats on 100K subs!!

  • @carsextendedwarranty
    @carsextendedwarranty Рік тому +2

    0:22 *he touched the lens so many times...*

  • @platinumdiamond1445
    @platinumdiamond1445 2 роки тому +10

    I wish I could be on your level of programming. I'm an amateur at Godot a separate game engine

    • @user-hl7lr8ld2i
      @user-hl7lr8ld2i 2 роки тому +3

      Then learn to make a game without a game engine
      Right now i am making my own simple engine with plain C and OpenGL with the GLFW library
      I have learned so many things because of the decision to not use a game engine

    • @michaelsanjaya2553
      @michaelsanjaya2553 2 роки тому

      @@user-hl7lr8ld2i Hello, im kinda new to programming. If i want to make my own game, should i first study using game engine such as unity or not using game engine like SDL with c++? Thank you

    • @user-hl7lr8ld2i
      @user-hl7lr8ld2i 2 роки тому +1

      @@michaelsanjaya2553 well if you want to make a game you should use a game engine
      But if you want to learn how to program and maybe get a job later, learning how to make a game engine (or how to make a game with a library) will teach you so many things about programming in general
      If you use a game engine you will learn how to program in that game engine but most of your skills will be useless ouside of that engine
      If you make your own game engine or use a library like for example: SFML, Allegro or SDL you learn how to reder object and make your own systems
      TL;DR:
      if you want to make a game, use a game engine like unity or godot BUT if you want to learn how to program, making your own engine or using a library will teach you so much and will maybe be able to get you a job.
      Have a great day and tell me what you are gonna do

    • @michaelsanjaya2553
      @michaelsanjaya2553 2 роки тому +1

      @@user-hl7lr8ld2i Thank you very much for the detailed explanation! I think im going to do the 2nd option that is make my own game engine because i love to code. Is there any recommendation for the library in c++ or just start learning SDL like in the video??

    • @user-hl7lr8ld2i
      @user-hl7lr8ld2i 2 роки тому +1

      @@michaelsanjaya2553 you said you were new to programming, then i would go with SFML. There are a lot of tutorial here on youtube and it is a lot easier then SDL.

  • @videosextra9434
    @videosextra9434 4 місяці тому

    Wow amazing video great effort man..Inspiring to watch and learn and make myslef too Thanks for sharing 👌👍😊🎉

  • @etaigabbai
    @etaigabbai 2 роки тому

    Congrats on 100k!

  • @ScratchRZL
    @ScratchRZL 2 роки тому +5

    5:41 when the UI is sus

  • @askcookie1
    @askcookie1 2 роки тому +23

    Next challenge: Learn to integrate LUA(or other scripting language) interpreter with any engine, then learn this scripting language and use it as main game logic code.

    • @defaulttool
      @defaulttool 2 роки тому +1

      pretty sure he did that in the pixel art one

    • @Austinkeith2010
      @Austinkeith2010 2 роки тому

      and then import the code to roblox. (Roblox code is in lua)

  • @kimbring2727
    @kimbring2727 2 роки тому

    Nice work, I am using this project for learning the SDL2 C++ game programming.

  • @SparkY-Minecraft
    @SparkY-Minecraft 2 роки тому +1

    Yo almost 100k! An early congrats !!

  • @christophercampbell6884
    @christophercampbell6884 2 роки тому +2

    2:26 That's what she said.

  • @Gamer081
    @Gamer081 2 роки тому +12

    Note for programmers:steal everyone's code

  • @natweast1842
    @natweast1842 2 роки тому

    Congrats on 100k subs

  • @knowlife4486
    @knowlife4486 10 місяців тому

    You smart af bruh ! Keep making stuff

  • @urbigboywilly
    @urbigboywilly 2 роки тому +3

    3:20 ratio

  • @masterpig5s
    @masterpig5s 2 роки тому

    99K subs, congrats in advance for 100K

  • @Negativation
    @Negativation 2 роки тому

    Congrats! You hit 100k subscribers.

  • @-nafa-3229
    @-nafa-3229 7 місяців тому

    The ending made me laugh ;) Thanks! C++ rocks! :)