Seemingly, the GCC implementation of the API differs from the VC++ mainly in that GCC uses normal (simple char) for string arguments like in MessageBox and refuses to compile when using wide strings. This is somewhat silly because VC++ is the exact opposite; it refuses to compile if wide strings aren't used. That's just weird.
Either way, I decided to stick with the VS08 because it has a nice IDE and I can plug in the resource editor, so I have everything available at hand. But I'm encountering a problem with my text drawing functions in the back buffer.
Here's a picture of the numbers being drawn properly when compiled with GCC:
And here is a picture of the numbers drawn when compiled with VS08:
The functions are pretty much the same with some differences.
GCC version:
bool BackBuffer::DrawText(std::string argStr, int xPos, int yPos){ if (argStr.empty()) { MessageBox(0, "String is empty", "Error!", MB_OK); return 0; } TextOut(mhDC, xPos, yPos, argStr.c_str(), argStr.length()); return 1;}
and the VS08 version:
bool BackBuffer::DrawText(std::string argStr, int xPos, int yPos){ if (argStr.empty()) { MessageBox(0, L"String is empty", L"Error!", MB_OK); return 0; } TextOut(mhDC, xPos, yPos, (LPCWSTR)argStr.c_str(), argStr.length()) return 1;}
I've tried looking through a debugger since VS08 provides one, but everything seems to be fine. I have no idea what might be causing this problem. Can anyone help me out? Thanks!