Thursday, November 12, 2009

Installing DirectX SDK – Error S1010


Recently I needed to setup a new computer at work. I will use this new computer for development. The computer already had Windows XP SP3 installed as the operating system. The software I needed to install for development purposes were the following:

  • .NET Framework 3.5 SP1
  • Visual Studio 2008
  • DirectX SDK (Aug 2009)

Every one of those installations gave me trouble. None of the above installed without hassle. I managed to get .NET Framework and Visual Studio 2008 installed after numerous tries, but DXSDK just wouldn’t install.

I couldn’t find a solution to why the SDK wouldn’t install. I tried a  few different things without luck. The SDK installation exe file was downloaded with IE8. I then tried, as a last resort, and downloaded the file with Firefox instead. And guess what. The SDK installed without a problem! How strange is that? I have verified by downloading the SDK again several times with IE8 on that computer and that downloaded file just doesn’t work. The files are identical in byte size as the picture below shows (The text is in Swedish):


Both file sizes are 580,228,040 bytes.

(The only noticeable difference between the files is the Security Block showing up beneath Attributes. However, I removed the Security Blockage and tried installing it without any success).

Wednesday, September 9, 2009

Visual Studio Watch Window Tip #2

Did you know the Watch Window can not only display the values of your variables, but also execute code? This is a very handy feature which allows you to call functions in your code directly from the Watch Window. In the example above I call the sizeof operator to check the size of my variable 'test', and I also call my own function.

Friday, August 21, 2009

Visual Studio Watch Window Tip #1

A very usefull debugging tip that I use a lot is the ability to watch dynamically allocated arrays. Look at the code above. An array is allocated dynamically and the debugger most often can't display the content of the array in the "watch window" since it often can't determine the size of the array. The array in the watch window will look like this:

The debugger shows only the first entry in the array. Usually when you want to watch a dynamically allocated array you "kind of" know it's size. In the above example I know the size of the array is 10. I can simply tell Visual Studio how many elements to display to get a proper view of the content of the array like this:

All you do is add the size of the array after the variable name, separated by a comma ",". Now you can watch the contents of any array.

Saturday, August 8, 2009

id Tech 5 Challenges

Course notes from SIGGRAPH 2009: Beyond Programmable Shading are available. I enjoyed reading the slides from J.M.P. van Waveren, id software. He writes a bit about the virtual texturing in Id Tech 5 and also about their approach to distribute the engine over multiple cores. He does not describe anyting in great detail. It's more like a coarse overview with some nice screenshots.

Friday, July 24, 2009

Microsoft BizSpark

We are since a couple of weeks back a Microsoft BizSpark Member. This is a great opportunity for us (and other small companies) to be able to save a great deal of money on software licenses. We are currently running Visual Studio 2008 & Office 2007 in the office and the licenses cost us nothing. Another great aspect of this membership is the ability it gives us to test various softwares without any restrictions whatsoever.

Thursday, July 16, 2009

Converting VC8 Solution To VC9

Ok, so I installed VS 2008 (see previous post). Were there any complications involved? Not really. Only 1 major and 1 minor. First, since I wanted to keep all vc8 projects and solutions, I copied all vc8-projects & vc8-solutions and renamed the copies to *_vc9.proj & *_vc9.sln. Then I edited all vc9.sln files to use vc9.proj files instead of the vc8.proj files. I fired up vc9.sln and VS converted the solution and the project files without problems. All fine. Was I able to build the solution? No.

There were 1 warning and 1 error. The warning was easy. It was the warning about wp64 (the option which checks for 64-bit compatibility issues) have been deprecated. All I had to do to remove this warning was to disable 64bit compatibility check in the projects options (It's deprecated anyway. You should build in 64-bits mode instead).

The error I got was from the resource compiler. I have used the resource editor and some Win32 API programming to show some simple editor dialogs in the game. When I installed VS2005 I included the MFC files which enables you to use MFC. Since I have never used MFC (I use the core Win32 API instead) I did not include it when I installed VS2008. What I didn't know (and what I think is a bug(?) from Microsoft) is that the resource editor includes a dependency on "afxres.h" in your resource file. This "afxres.h" only gets included in your install when you choose to install MFC. The solution to fix this (I do not want to install MFC) is to copy 2 files from the MFC dir of VS2005 to the same dir in VS2008.
  • VS8\VC\atlmfc\include\afxres.h -> VS9\VC\atlmfc\include\afxres.h
  • VS8\VC\atlmfc\include\winres.h -> VS9\VC\atlmfc\include\winres.h

Wednesday, July 15, 2009

Visual Studio 2005 To 2008

Today I decided to upgrade my Visual Studio from 2005 to 2008 (Team System Developer Edition). The installation failed almost immediately due to an error while installing .NET Framework 3.5. For some reason I couldn't upgrade my .Net Framework version to 3.5 which is a requirement for VS2008. I tried several different ways but without any luck. The solution I found was to download .NET Framework Cleanup Tool . This tool can remove all your previous versions of .Net Framework and make your system clean of .Net Framework. After cleaning my system I downloaded .Net Framwork 3.5 SP1 installer from Microsoft and ran it. It worked like a charm. Now let's see what VS2008 have to offer me...

Friday, July 3, 2009


When working in a team you *must* use some kind of revision control sytem. Examples of such systems are SVN, CVS, Perforce & Sourcesafe. Here at the office we use SVN. As client software we choose to use TortoiseSVN. I guess we are not alone using this great piece of software since to date there have been roughly 16,000,000 downloads of it.
Now, I have had a problem in the past. I often work on several differnet computers and often when you work on some piece of a game engine, it might take a couple of days, weeks, before something is ready (stable enough) to be commited to the revision control repository. But since I might start work on something on my laptop in the office, I want to continue the work at my stationary computer at home. I DO want to keep the files synchronized but I do not want to commit my changes to the repository since no other should be bothered with temporary/broken/test - code.
Previously I have synchronized manually. Moving files back and forth on a USB stick. This can really be a pain since it's hard to keep track of changes, and newly added files. It's no fun at all I tell you. And when I'm in a hurry, I always seem to forget at file or two. One exciting new piece of software which can help you a great deal in this situation is DropBox. It gives you 2GB of free server space, and it automatically tracks changes to files. You can use it as a simple revision control system or backup software. Whenever I add/change files in my "DropBox folder" the files get synced on the server and when I log in on my other computer I get all the changes automatically. It works really well.

Saturday, June 27, 2009

Good Indie Developers

There are thousands of us out there really loving the art of making games. Me, as a programmer, is mainly interested in the technical bits and pieces of a game and I find it very entertaining just reading about other game developments or viewing the plain sourcecode for other projects.
Here are some projects you must check out if you are in to game development candy:
  • Radioactive-Software (Homepage) - Fenomenal. Dr Green does it all. Coding, Gfx, Sfx. Just read about his projects.
  • Journal of Ysaneya - A very ambituous journal of a promising spaceshooter. Great information about the insides of the game engine.
  • Sauerbraten - Full source code for this one.

Friday, June 19, 2009


At SimWay, where I work, we are a small development team. We are always on a tight schedule. One tool which I find very efficient to use for small development teams is AntTweakBar.

AntTweakBar is a small, easy-to-use, C/C++ library which allows programmers to quickly add a gui to applications based on OGL, DX9 & DX10.
We use it for many things that requires fast editing such as light conditions.

The current version contains a bug in the ogl-rendering system which will, according to the creator, be fixed in the next version. If you want to fix it yourself in the meantime you can rebuild the library with the following changes:

AntTweakBar will not render properly if you have several Texture Coordinate Arrays enabled at the same time. Looking into the AntTweakBar source code it looks like this:



This only disables the currently active TexCoordArray. Replace the code with this to disable all TexCoordArrays:

# define GL_MAX_TEXTURE_COORDS 0x8871


int maxTexCoords;
_glGetIntegerv(GL_MAX_TEXTURE_COORDS, &maxTexCoords);

for(int i=0; i<maxTexCoords; i++)



To disable all texarrays.

Thursday, June 18, 2009

New blog from the games industry

Hi All,

Welcome to my journal. Here I will write (mostly) about games development. Feel free to leave comments about anything.