Aug 15, 2016 - Floats

I have quite recently learnt things about floating point math, or, to be clear, about IEEE 754.

So, I thought I knew most things about them. And then sadly I read way too many bad sources and got quite confused (some good as well!). To get to the bottom of it, I did what I always do; try it out myself. Debug it!!

This is in the specific context of game development. So, fast, and perhaps not extremly precise? Also x86/x64 specific. And I only know the options name/existance in VS2015.


Read more.

Jul 17, 2016 - Update

Haven't updated in a long time. Mostly busy with work. ( Vermintide PC version released in October 2015. Console versions being worked on. )

I'm really liking Visual Studio 2015. Even if it made one of my previous post on using clang in Visual Studio superfluous.
And now with that, all the C++ features are available! Normal Microsoft compiler has come a long way, but there are still a few things missing. Not that I use a lot myself. The newest feature I use is variadic templates. My logging class doesn't have macros anymore, and it is typesafe!

I plan to actually do some proper coding very soon.
Not just tiny examples to help relieve my curiosity for new features and such. :)

Jul 30, 2015 - Timing: Only use QueryPerformanceCounter if needed? (UPDATED 2016.03.28)

Short story: I did some profiling (I do a lot of profiling) and QueryPerformanceCounter showed up a lot more than..I felt it should. So, some reading up and testing later, I am now using rdtsc/rdtscp.

Longer story: A long time ago, before computers had more than one core, and if the CPU supported it, the fastest way to time things where by using the rdtsc instruction. The granularity you got was a lot higher than any other kind of timing instruction available at the time. Partly because it wasn't really a timing instruction; it returned instructions executed since boot-up.

The problems:

  • If a CPU changes speed, the rate of instructions per second was not constant; hard to use for timing.

  • Multi-core. One cores rdtsc instruction might give a whole different value than another. Our thread might switch core, a lot. The cure for this; setting thread... more.

Mar 1, 2015 - Using Clang with Visual Studio

I like C++11. Actually, I really like C++11. And C++14, etc.

I am using Windows though, with Visual Studio (2012 usually), and, this makes the C++11 part hard. Don't get me wrong, Visual Studio has gotten a lot better at following the C++ standard. And it gets "new features" faster than ever before. But it is still too bad and to slow. They did fix some issues by releasing an update (CTP - Community Technology Preview) to the C++ compiler for VS2012 that you can download here: ( This made my dabbles into Variadic Templates work. And a few other things work..better. But I really want to be able to use things like override, = delete etc. No luck for that.

VS2013 has better C++ support, and I'm quite sure 2015 has even better support; I have not tried yet. Not good enough though.

So, what can we do... more.