Jump to content
  • Advertisement
Sign in to follow this  
XoreDevelopment

D3D Rendering Issues

This topic is 4577 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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);

Share this post


Link to post
Share on other sites
Advertisement
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).

Share this post


Link to post
Share on other sites
I hate when that happens, and it's always random for me.
If I'm lazy casting to LPCWSTR works to an extent.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!