WCHAR_T problems

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Sindromequijote
Posts: 6
Joined: Tue Oct 11, 2005 9:15 pm

WCHAR_T problems

Post by Sindromequijote »

I have seen that irrlicht uses const wchar_t pointers to write "GUI" texts.
I haven't found any function to copy the content of a "const wchar_t *" to another "const wchar_t *", not copying only the pointer to the same content.
:oops:
I would like to know if exists any fuction that does this work or another easy way to do it instead of making a function to copy wchar to wchar myself.

Thanks.
Conquistador
Posts: 340
Joined: Wed Sep 28, 2005 4:38 pm
Location: Canada, Eh!

re:

Post by Conquistador »

I don't quite understand what you're getting at, could you be a bit more specific, maybe give us the code you're using?
Sindromequijote
Posts: 6
Joined: Tue Oct 11, 2005 9:15 pm

Post by Sindromequijote »

I'll try to be more specific.

I want to use this function of the IGUI::Font:
virtual void draw (const wchar_t *text, const core::rect< s32 > &position, video::SColor color, bool hcenter=false, bool vcenter=false, const core::rect< s32 > *clip=0)=0

The first parameter is a const wchar_t pointer so:
const wchar_t * text1 = L"Hello";
const wchar_t * text2;
text2 = text1; //this only copies the pointer not the content, I want to have two different Hello's
I was asking for a function or an easy way to do this. I'm not very good using pointers, I'm an Ada programmer XD

Sorry about my English, it isn't my native language :oops:
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

this code is in most of the tutorials

Code: Select all

wchar_t tmp[1024];
swprintf(tmp, 1024, L"[%s] fps:%d", driver->getName(), fps);
device->setWindowCaption(tmp);
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Sindromequijote
Posts: 6
Joined: Tue Oct 11, 2005 9:15 pm

Post by Sindromequijote »

Thank you very much for the help. :D

I'm using wstrings, something like that:

const wchar_t * palabra = titulo_panel.c_str();

Where titulo_papel is a wstring.
Post Reply