displaying text

Started by
14 comments, last by phil67rpg 11 years, 6 months ago
Did you call D3DXCreateFont anywhere to initialize g_font? g_font seems to be NULL.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Advertisement
I tried initializing D3DXCreateFont g_font = NULL; I am still stuck.
I have done extensive research on this topic and have done a lot of reading, I don't know what to do next.
well I finally solved this problem thanks for all the help.
The fix is .c_str() on the std::string you are passing in. DrawText wants a pointer to the first character of the string array. When documentation states that it wants a pointer to a text string and is defined as LPCSTR it means that it wants a pointer to the first element of the character array of a string. Std::string is a wrapper over a dynamically resizing character array, to get access to the raw memory you need to use the function "c_str()"

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

cool thanks I solved my problem

This topic is closed to new replies.

Advertisement