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... ..read more.

Mar 2, 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: (http://blogs.msdn.com/b/vcblog/archive/2012/11/02/visual-c-c-11-and-the-future-of-c.aspx) 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 if... ..read more.

Dec 8, 2014 - Revamping Of My Webpage

So! It was time (again, and again, I know)

Hopefully changing to Jekyll will make me write more, by being less in the way of actually making a webpage. Only time will tell.

Having played with it for.. 1½ day now and, apart from it not wanting to start its webserver ~80% of the time without any errors (Python saved me here: python -m http.server 8000 ftw!), recreating my old webpage with this new tool has been quite..easy. Also extending it is easy and quite fun. Even if it means you have to code a bit of Ruby (shudders).

I basically got this theme off of github and, have since mangled it to pieces; tried to make it suit my needs.

Now I just need to write new posts! Also merge a few more old ones to this format..

Aug 26, 2006 - Doom3 Documentation

This is a.. not even read-through thing. Very none-polished. Just so you know ;] Things to add: actual code for the structures, and maby a few functions?

To be able to use this info you need to know how to code, need to know something about BSP-trees or similar. You need to know how portals work. And some sort of 3D API. OpenGL for example ;]

I’ll try to outline what I have figured out about the Doom3 fileformats. When a level for Doom3 is made, the .map file is the one you edit with the level-editor, and when you are done you compile this into a .proc and .cm file.. maby the .aas?? files as well? The .proc file holds the geometry of the level. Unlike Quake3 Doom3 doesn’t have bezier-curves etc. There exists curved surfaces in the .map file but when it gets compiled that data is evaluated,... ..read more.