What to do when your car alarm remote dies and nobody sells the right battery

The other night, my flatmate Dan’s car alarm remote died, and we couldn’t find anybody who was open that stocked the right size battery – we needed a 12 volt A27 size battery, the best we could get was an A26, which is too fat to fit in the remote.

So here’s a couple of pics of the scheme that I devised…

An external battery wired into the remote.

An

A blury pic of the external battery

A blury pic of the external battery

We took the next 12V battery we could get, and cellotaped some wires to it. We then twisted the other ends of the wires around the battery contacts of the remote, and wedged the old battery in to make it snug. Voila, one working car remote with external power-supply.

Learning DirectX and C++: Step 3, Timing and Text

I’ve pondered, for a while, on the merits of me writing out every lesson I learn on my journey to become a game programmer, and I think that the HOWTO format is not going to be sustainable. So, from now on I’ll be jotting down some notes, and some key points, but I’ll be dispensing with full code listings and blow-by-blow coverage of what’s going on.

So, on to timers and clocks in DirectX.

Continue reading

Learning DirectX and C++: Step 2, Initialise DirectX

In order to make the most simple use of DirectX we must set up the required infrastructure. This is as follows:

  • A swap chain (at least two areas of memory, one for drawing into, one for displaying to the screen).
  • A RenderTargetView (a reference to the area of memory from the swap chain for drawing into).
  • A Depth/Stencil buffer, and a view onto it. (Used to help decided whether any given pixel should be drawn).
  • Bind the RT (RenderTarget) and Depth/Stencil views to an Output Merger stage.
  • Set the Viewport (a sub-rectangle of the BackBuffer that we will draw to).

Naturally after we have set up this infrastructure we have repeatedly draw some sort of scene; we will get to that after we have discussed the topics above.

Continue reading