Game Font Generator – BMFont
Somebody may face the difficult of drawing text by using directX or OpenGL directly. We have to generate character bitmap then use it as texture for showing texts.
BMFont helps us with this task. BMFont provides both GUI window mode and command line mode. In GUI window mode, you can tick what character you need to generate, you will receive a png format font image and configuration file for accessing the font image.
Command line mode is suitable for automatic generating purpose. For example, you write an Unicode encoded text file with the text that you need to display. Then use command line to generate. For example:
bmfont.com -c config.bmfc -o gamefont.fnt -t text.txt
This command line tell bmfont load config.bmfc and output as gamefont.fnt while all characters present in the text.txt will be added to the font.
Windows 7 下的串口調試

最近的項目涉及到RS232通訊,創建虛擬的RS232串口來調試是開發時最方便的選擇。許多年前曾經可以用的一些虛擬串口工具在Windows 7下均失效了,於是又另外找了一個,與大家分享。
工具的名字叫:HW VSP3 , 推薦它因為他是FREEWARE,而且支持Windows 7 64bit。它的工作原理是虛擬出串口並且轉發到所設定的TCP地址。注意選SinglePort版本的,Multiport是commercial version。
這時候只需要一個TCP測試工具,例如 TCP&UDP調試工具,即可與你當前的程序之間相互收發信息。當然也可以是你撰寫的單元測試工具,或者程序的客戶端模擬工具。
HLSL Notes 1
Getting Started
Shader is a very powerful tool that enhanced the computer graphics. Since several years ago, computer graphic cards have supported hardware-accelerated shader. The picture below shows an example of shader effects.

Shader is written in a so-called shader language. The shader language files are complied and are put into the graphic hardware running in parallel. There are some different kinds of shader languages. OpenGL provided a C-liked shader language, called OpenGL Shader Language (GLSL). In Microsoft DirectX 9 or later, shaders are programmed by High Level Shader Language (HLSL).
Concept
In shader programming, pixels are processed in parallel. So in shading language, we are dealing with single pixels. To simply the shader programming, the shader can be written in the following formulation:
F(x,y,z) = value
It tell the system what color will be shown in the position (x,y,z).
Vertex Shader & Pixel Shader

Due to the limitation of hardware pipeline, shader are divided into different types, such as vertex shader and pixel shader. They are processed in sequence in the graphics pipeline. (The latest newest shader model, the unified shader model has already simplified and unified the shading programming) However, since there are still many machine that does not support the latest shader model, this note will focus just on shader model 2.0.
HLSL example
In HLSL, like C programming, there will be an entry function, such as main().
For example:
sampler2D inputTexture : register(s0);
float4 ps_main (float2 texCoord: TEXCOORD0) : COLOR
{
float4 color = tex2D(inputTexture, texCoord);
return color;
}
This shader do NOTHING changed like directly rendering.