Going from DirectX 9 to DirectX 10 in C++:

DX10 (at least the version of August 2007) seems to really dislike rendering to buffers that aren’t powers of two – e.g. rendering to a HDR buffer that’s 1280 by 720!

Here’s a table of roughly corresponding DX9 and DX10 expressions:

D3DFORMAT -> DXGI_FORMAT
D3DFMT_… -> DXGI_FORMAT_…
D3DUSAGE_… -> D3D10_USAGE_…
D3DVERTEXELEMENT9 -> D3D10_INPUT_ELEMENT_DESC
CreateVertexDeclaration -> CreateInputLayout
OnLostDevice -> not used?
D3DXCreateTexture -> ID3D10Device::CreateTexture1D, CreateTexture2D
D3DXCreateVolumeTexture -> ID3D10Device::CreateTexture3D
LockRect -> Map
UnlockRect -> Unmap
D3DLOCKED_RECT -> D3D10_MAPPED_TEXTURE2D
D3DLOCKED_BOX -> D3D10_MAPPED_TEXTURE3D
SetVertexDeclaration -> IASetInputLayout
ID3DXEffect::SetTexture -> ID3D10EffectShaderResourceVariable::SetResource
ID3DXEffect::SetVector -> ID3D10EffectVectorVariable::SetFloatVector
ID3DXEffect::SetFloat -> ID3D10EffectFloatVariable::SetFloat
D3DQUERYTYPE_ -> D3D10_QUERY_DESC
D3DXCreateTextureFromFile -> D3DX10CreateTextureFromFile
LPDIRECT3DSURFACE9, IDirect3DSurface9 * -> ID3D10RenderTargetView*, ID3D10DepthStencilView*
LPDIRECT3DTEXTURE9, IDirect3Texture9 -> ID3D10Texture1D, ID3D10Texture2D
D3DXHANDLE (for shader variables) -> ID3D10EffectScalarVariable*, ID3D10EffectVectorVariable*, etc.
LPDIRECT3DQUERY9, IDirect3DQuery9* -> ID3D10Query*
vs_1_1, etc. -> Not Supported
technique -> technique10
cullmode=none -> SetRasterizerState( RenderNoCull );
ZEnable = true; -> SetDepthStencilState( DisableDepth, 0 );
AlphaBlendEnable = false; -> SetBlendStateNoBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );