I cant evean get ID3DXFont to work maybe there's something wrong with my compiler....
Code:
int DrawD3DScene()
{
HRESULT hr = D3D_OK;
ID3DXFont *g_font=NULL;
HRESULT WINAPI D3DXCreateFont(
pD3DDevice,
22,
0,
FW_NORMAL,
1,
false,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
ANTIALIASED_QUALITY,
DEFAULT_PITCH|FF_DONTCARE,
"Arial",
&g_font
);
pD3DDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,
D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.0f), 1.0f, 0 );
D3DXMATRIXA16 matWorld;
pD3DDevice->BeginScene();
pD3DDevice->SetFVF(D3DFVF_CUSTOMVERTEX);
pD3DDevice->SetStreamSource(0,pVertexBuffer, 0, sizeof(tVertex));
D3DXMatrixTranslation(&matWorld,-1.5,0.0f,6.0f);
pD3DDevice->SetTransform(D3DTS_WORLD,&matWorld );
pD3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST,0,1);
D3DXMatrixTranslation(&matWorld,1.5,0.0f,6.0f);
pD3DDevice->SetTransform( D3DTS_WORLD, &matWorld );
pD3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP,3,2);
g_font->Begin();
g_font->DrawText("this is a test",-1,NULL,DT_NOCLIP|DT_LEFT,0xFFFFFFFF);
g_font->End();
pD3DDevice->EndScene();
pD3DDevice->Present( NULL, NULL, NULL, NULL );
return TRUE;
}
Code:
------ Build started: Project: DX9, Configuration: Debug Win32 ------
Compiling...
main.cpp
c:\C++\DX9\main.cpp(142) : warning C4229: anachronism used : modifiers on data are ignored
c:\C++\DX9\main.cpp(142) : error C2078: too many initializers
c:\C++\DX9\main.cpp(142) : error C2440: 'initializing' : cannot convert from 'ID3DXFont **__w64 ' to 'HRESULT'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\C++\DX9\main.cpp(513) : warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data
Build log was saved at "file://c:\C++\Dx9\Debug\BuildLog.htm"
DX9 - 2 error(s), 2 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped