jwatte's picture

Bad font antialiasing in WPF menu items

I'm using WPF 3.5, Visual Studio 2008 SP1, and developing for Windows XP SP3.

No matter what I do, the menu bar and menu items of my application are ugly, blurry, anti-aliased. WinForms, MFC and Win32 applications however have nice, crisp, clear menu items.

I've tried checking the "align to device pixels" box, but it only gives a marginal improvement.

jwatte's picture

XNA, light mapping, specular

I've been working on a GPU accelerated light map generator for XNA for a little while. I'm using the light map only to tell shadow/light for each surface for each light, and then solving the basic light equation (ambient + diffuse + specular + emissive) per pixel, multiplied by shadow.

jwatte's picture

HLSL and Effect file syntax highlighting language definition file for the Notepad++ editor

Attached, please find a syntax highlighting file for HLSL and Effect files for Notepad++. This file is substantially better than the one available on the Notepad++ main download site:

  • It adds all of the Effect file tokens, in UPPERCASE and ProperCase forms.
  • It defines operators to let the built-in functions be recognized.
  • It recognizes preprocessor directives.
jwatte's picture

Drawing silhouetted characters behind smoke particle systems

A question came up on the XNA forums: "how do I draw the silhouettes of objects in red when they are covered by smoke?"

Here is my proposal on how to use destination alpha to do it:

0) When setting up the back buffer, make sure you get destination alpha:
  graphics.PreferredBackBufferFormat = SurfaceFormat.Color; // has alpha

jwatte's picture

Triggers in XNA games using C#

"So," you may ask yourself, "what if I figure out a way to detect that the player has hit a button, or stepped on a landmine, or entered a goal zone?

jwatte's picture

Can't get custom MFC CSettingsStore to work :-(

I want to implement my own CSettingsStore that stores data in a file in local application data, rather than the registry. (I note that the documentation claims this is a good idea from a security point of view, but I'm doing it for other reasons).

jwatte's picture

Making a sprite follow a path

A while back, I posted a simple program on the XNA forums that showed how to define a path, and then have objects follow that path. I figured I'd copy the code from there onto this site, for easy reference. The program below is a command-line C# program; you can compile it from the command line with "csc flypath.cs" and run it to test it out. Or you can copy the "follower" class from the middle, and use it in your XNA project. (The additional code, including the declaration of Vector2, is just there to make the test program work stand-alone)

jwatte's picture

Wavemix -- a simple command-line wave file mixing tool for Windows

Wavemix is a command line WAVE file mixer. It is somewhat intelligent about mixing
multiple channels and might even be able to re-sample various sample rates. The
source code is included (requires STK to build).

Usage: wavemix [/SR 44100] [/16] [/GAIN g] infile1.wav ... outfile.wav

Supports at most 19 input files and one output file.

jwatte's picture

XNA Creators Club game ratings categories

I realized that there is no available description of the different XNA game ratings other than on the actual game submit and review forms, which aren't easily found through search engines (and require sign-up and attempted game submissions to actually get to read). So here are an excerpt of the descriptions, as of 2008-12-18:

jwatte's picture

Ah, yes, GCC and MSVC... Or, two compiler bugs in two hours.

Why is it that seemingly every week-end project ends up in tears and teeth gnashing over broken tools, instead of sweet progress? Why do computer companies keep cramming useless features into bloatware, instead of just making what they have, actually work?

Syndicate content