Original Post
Hi, I'm a beginner at DirectX and I'm trying to make a small driving game, so I need to print 2d text on the screen. Here's how I do my text...uhm...stuff: I get these compilation errors: Can anyone help me out on this? Thanks EDIT: I'm using Visual C++ Express Edition [Edited by - Arangol on January 20, 2007 12:46:51 PM]
LPD3DXFONT m_font;
//in Init_Graphics()
D3DXCreateFont( d3ddev,
20, 0,
FW_BOLD, 0,
FALSE, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
TEXT("Arial"), &m_font );
//In Render_Frame()
D3DCOLOR fontColor = D3DCOLOR_ARGB(255,0,0,255);
RECT rct;
rct.left=2;
rct.right=780;
rct.top=10;
rct.bottom=rct.top+20;
m_font->DrawText(NULL, "Hello World", -1, &rct, 0, fontColor );
//And finally
m_font->Release();
1>c:\program files\microsoft directx sdk (december 2006)\include\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800
1>c:\documents and settings\henrik stenius\my documents\visual studio 2005\projects\small game\small game\small game.cpp(152) : warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data
1>c:\documents and settings\henrik stenius\my documents\visual studio 2005\projects\small game\small game\small game.cpp(268) : error C2664: 'ID3DXFont::DrawTextW' : cannot convert parameter 2 from 'const char [12]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast