Skip to main content
GameDev.net gamedev.net
🔒 Locked

D3D Rendering Issues

Started by XoreDevelopment Apr 5, 2006 at 4:44 PM 2 replies 550+ views
Original Post
XoreDevelopment
XoreDevelopment
I'm getting these errors when I try to compile:
Quote:
.\d3drender.cpp(292) : error C2664: 'CreateFontW' : cannot convert parameter 14 from 'char [32]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast .\d3drender.cpp(311) : error C2664: 'GetTextExtentPoint32W' : cannot convert parameter 2 from 'char [2]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast .\d3drender.cpp(318) : error C2664: 'GetTextExtentPoint32W' : cannot convert parameter 2 from 'char [2]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast .\d3drender.cpp(327) : error C2664: 'ExtTextOutW' : cannot convert parameter 6 from 'char [2]' to 'LPCWSTR'
Here is where I am getting the errors:
Quote:
HFONT hFont = CreateFont(iHeight, 0, 0, 0, (m_dwCreateFlags&FCR_BOLD ? FW_BOLD : FW_NORMAL), m_dwCreateFlags&FCR_ITALICS, false, false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, VARIABLE_PITCH, m_szFontName);
Mushu
Mushu
Its because your compiler is (probably by default) defining a unicode flag. You don't want that flag.

In VC2005 - try changing

Project Properties (Settings) > Configuration Properties > General > Character Set

To "Not Set" and see if that does anything. Or, for another compiler (I've no idea how to use others) try putting

#undef UNICODE
#undef _UNICODE


Before including windows/d3d files and see if that changes anything. (the #undef is a messy solution - it should be changed via the compiler since its the compiler adding it in).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.