主要是參考 3D繪圖程式設計這一本書,恩。
code : http://damody.googlecode.com/files/DX9Font.7z



用法簡介:
初始化
    device->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
    device->SetRenderState(D3DRS_LIGHTING, FALSE);
    device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
    device->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
    device->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);


DX9Font dxfont, dxfont2;
dxfont.Init(hwnd, device, 512, 512, 128);
dxfont.PutsAndBuildMesh(50, 50, 50, NULL, L"你好神!");
dxfont.SetColor(255,0,0);
dxfont.PutsAndBuildMesh(100, 100, 200, NULL, L"你好神!");


device->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(0, 100, 100, 100), 1.0f, 0 );
device->BeginScene();
dxfont.Render();
device->EndScene();
device->Present( NULL, NULL, NULL, NULL );


讓地獄深紅的天亮 發表在 痞客邦 PIXNET 留言(0) 人氣()