Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have been following this code from "Introduction to 3D Game Programming with Directx 10" and I am typing out the main class. While I was typing I noticed a few errors. I tryed googling them but there were no results. So I ask you if you can help me.

The code:

    HR(md3dDevice->CreateTexture2D(&depthStencilDesc, 0, &mDepthStencilBuffer));
    HR(md3dDevice->CreateDepthStencilView(mDepthStencilBuffer, 0,  &mDepthStencilView));
    HR(mSwapChain->ResizeBuffers(1, mClientWidth, mClientHeight, DXGI_FORMAT_R8G8B8A8_UNORM, 0));

where the error is: "argument type 'const wchar_t*' is incompatible with parameter of 'const char*'"

and

 wcscpy(fontDesc.FaceName, L"Times New Roman");

where the error is: "argument of type 'CHAR*' is incompatible with parameter of type 'wchar_t*'" EDIT: The error is at fontDesc.FaceName

share|improve this question

closed as off topic by Byte56, Darth Satan, Sean Middleditch, Patrick Hughes, Josh Petrie Jun 20 '13 at 23:47

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
This is off topic for gamedev. It's not strictly related to game development and is a general coding problem. Coding related questions should be asked on stackoverflow.com. The error is telling you exactly what's wrong. You're using the wrong types in your functions. –  Byte56 Jun 20 '13 at 22:46
2  
Might want to back up and focus on learning C++ before doing DirectX. –  ClassicThunder Jun 20 '13 at 22:47
    
@ClassicThunder - this specific problem isn't C++, it's Unicode vs Multi-byte in the project settings, but agree that the OP needs to back up a little and agree that this is a general programming question and shouldn't be here. –  Darth Satan Jun 20 '13 at 23:01

1 Answer 1

up vote 0 down vote accepted

As noted in the comments, this isn't strictly a gamedev question, but it was easy to answer. Assuming you're using Visual Studio, you need to enable Unicode in the project settings:

enter image description here

Make sure "All Configurations" and "All Platforms" are selected, then under the "General" tab, select "Use Unicode Character Set" as shown. Then rebuild the solution and those errors should go away.

share|improve this answer
    
Sorry for being in wrong section. But thank-you so much! –  ThatOneCoder Jun 21 '13 at 0:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.