My Code:
const wchar_t *foo = reinterpret_cast<const wchar_t *>(glGetString(GL_SHADING_LANGUAGE_VERSION));
LPCTSTR sversion = foo;
MessageBox(NULL, sversion, TEXT("GL_SHADING_LANGUAGE_VERSION"), MB_OK);
The problem:
This results into some weird content of mostly Chinese and some other characters instead of the GL_SHADING_LANGUAGE_VERSION
, as the reinterpret_cast
"interprets" the thing as something else as I've wanted it to. I've also tried to do it with normal C casts, but this results into the same problem and because glGetString returns an GLubyte* I cannot put the code directly into the MessageBox function as this requires an LPCTSTR as an input.
Note:
I've defined the UNICODE
keyword in my files. This is why I am using wchar_t
instead of char
.