Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Felt Cute, Might git rm --rf

Posted on Aug 12 A while back, I wrote an article on the evolution of game engines from beginner to intermediate architectures.https://dev.to/tythos/engines-evolution-10gkIt was based on a series of projects I had during grad school (a little over ten years ago), so there's definitely a lot of dust. My C++ days are largely behind me, but (after a lukewarm interview the other day) it seemed like an appropriate time to brush them off. Other than a few HackerRank exercises, I updated a few projects.This let to, among other thing things, a realization that C++ has really started to make a comeback. A lot of people would point to how active the committee is--and to be clear things like auto-iteration are an amazing improvement to the quality of life:But what's really struck me is how potent the combination of submodules (the git construct) and Cmake is. They complement each other so well that it's easy to see how isolated and archaic C++ code can suddenly leap into the modern era with an language-agnostic package management and automated, platform-neutral builds.Based on an explorer project I had put together last month, there's a pretty straightforward pathway for leveraging the latest-and-greatest SDL using this combination of tools:https://github.com/Tythos/sdlboxSo, the first step is to replace the library dependencies:SDL (which will be bumped to SDL3), straight from the authoritative https://github.com/libsdl-org/sdlglew (which needs a CMake-wrapped downstream mirror to completely automate the build hooks), from https://github.com/Perlmint/glew-cmakeWe can add cmake dependencies from submodules with two easy modifications to our CMakeLists.txt file:In addition to no longer needing glu (farewell! you caused so many compile issues, I can't say I will shed many tears), we also need to update SDL for v3 calls.The SDL_CreateWindow() signature has completely changed, and some parameters are no longer declared anywaySome event enumerations have changedSince we'll be consolidating runtime resources within the CMake-managed build destination folder, we'll also remove the relative path references from the file reads for .GLSL source.We can now do the usual CMake two-step:This is sufficient to build our project, and now we can git rm -rf msvc our way to happiness!Before we run, though, we do need to copy in the runtime dependencies. Specifically, there are .GLSL source files and a .DLL to copy over for SDL3:(You'll note I'm using Windows/MSVC path assumptions here, but it should be easy to find your own folders regardless. There's probably a way in CMake to do this automatically, which would be great to add later.)CMake and git submodules mean we never have to worry about maintaining separate projects (including relative paths and versions) for dependencies, and we don't even need to worry about maintaining a .SLN file for Microsoft Visual Studio.In a more general sense, though, what they mean is C++ is ready for the modern world.Templates let you quickly answer FAQs or store snippets for re-use.How hard is the GL to Vulkan (or w/e SDL is doing) going to be? Oh God, please, I just barely caught up with this one... ROFLWho needs Rust? lol Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Samina Rahman Purba - Nov 9 '22 Ridhi Singla - Nov 9 '22 Bek Brace - Nov 6 '22 Alexandre Plt - Nov 6 '22 Once suspended, Tythos will not be able to comment or publish posts until their suspension is removed. Once unsuspended, tythos will be able to comment and publish posts again. Once unpublished, all posts by tythos will become hidden and only accessible to themselves. If tythos is not suspended, they can still re-publish their posts from their dashboard. Note: Once unpublished, this post will become invisible to the public and only accessible to Brian Kirkpatrick. They can still re-publish the post if they are not suspended. Thanks for keeping DEV Community safe. Here is what you can do to flag tythos: tythos consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy. Unflagging tythos will restore default visibility to their posts. DEV Community — A constructive and inclusive social network for software developers. With you every step of your journey. Built on Forem — the open source software that powers DEV and other inclusive communities.Made with love and Ruby on Rails. DEV Community © 2016 - 2023. We're a place where coders share, stay up-to-date and grow their careers.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

Felt Cute, Might git rm --rf

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×