Code Snippet

This article contains a little code.

Managing a World of Entities in XNA

A structure that I find works very well when managing entities in games is the world/entity/component pattern. Entities in the world are nothing more than collections of components, where the components have the responsibility to "do something" with the entity.

jwatte's picture

Improved XNA Thread Pool object

This post includes a thread pool class for the XNA Framework that works better on the Xbox than the thread pool class in the Compact CLR. The main thread can choose to get notified about task completion with a callback function, or by waiting on a pre-allocated wait handle, or do fire-and-forget on the thread tasks.

jwatte's picture

Finding entities within a game world

In most games, you'll need to know where everything is.

jwatte's picture

Extracting Vertices and Triangles from an XNA Model

Here is some code that lets you extract the vertices and indices from a loaded XNA Model. You do not need to use any special processor, such as the JigLibX VertexProcessor or some derivative of the ModelProcessor -- it works straight out of the box!

jwatte's picture

A simple buffer class for network receive

When you develop socket receive code, you will soon run into the problem that TCP will send data in arbitrary blocks. Even if you send a given string in a single call to send(), that string may arrive as two separate recv() calls -- or may arrive glued together with some previous or following data. Or both.
jwatte's picture

How To Get Rid of Threads

It appears that school, tutorials, or whatever is teaching
about threads a whole lot these days, and most designs I see
from people learning the ropes involves a number of threads.
However, threads cause bugs, and cause extra synchronization
cost that's not easily visible, and not easily redeemable.

jwatte's picture

Win32 Programming Basics: A Simple Application

Todays assignment is to get a red block on the screen of a Win32 program.

jwatte's picture

PC Timers -- why it's so hard to keep time

On PC hardware, there are basically three timers that are generally available. Neither of them is very reliable

jwatte's picture

VST Parameter Response

When you try to map between a linear multiplier (0.0 to 1.0) and a "curve" value, which is exponential, you may be tempted to use exp(x), because it goes between linear and exponential. However, that's not good enough.

jwatte's picture

Memory bandwidth optimization

Note that what I'm saying is sort of x86-centric, with specific illustration for Pentium II/III, although it'll also work on AMD and even on other platforms (like PowerPC). The more PC/workstation like the platform, the more truth this holds. DSPs with SRAMs aren't anything like this, though -- programmer beware.

Syndicate content