So, there was the world of C++ before the lambda. And now there’s the world of C++ since the lambda – and I’ve got to say, if you aren’t using lamdas, then your’e probably still in the C++ stone age. This post is going to be all about lamdas and how rad they are. DoContinue reading “C++ lambda and how the world is different now”
Monthly Archives: February 2020
Staggering Vector
So in my current game project, I want to have a some what real-time simulation in which stuff happens. This boils down to doing stuff periodically in a game loop. In my game, the game loop is running at 30 frames per second. I was having problems maintaining this rate, and I did not wantContinue reading “Staggering Vector”
SOA sorting
So in my current project, I’m using a library which uses a programming methodology called, SOA, or structure of arrays, which is different than OOP ( object-oriented-programming). Basically, in SOA, instead of having an object with 10 properties, and a vector of those objects, you have a structure with 10 vectors each containing one property.Continue reading “SOA sorting”
Going Faster With Alignment
So, in the previous post I talked about, fast_remove_if, and going faster than the std::remove_if function. Now there is a further improvement that can be made to go *even* faster, but with no need to modify any functions – instead it involves modifying the alignment of the data in the vector. Here’s the object weContinue reading “Going Faster With Alignment”
fast_remove_if
So you may know about the “erase, remove_if” method of removing elements from a vector. Looks like this: This operation is an order-preserving operation, and “slow” if we don’t care about preserving the order. To remove stuff from an array quick, without preserving the order, you may have heard of something called, swap-remove. That’s whenContinue reading “fast_remove_if”
Programming Basics with C++ explained in Assembly
What the basics of c++ are actually doing under the hood.