MahmudX / Awesome3dX

Graphics Programming with DirectX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Awesome3dX

Graphics Programming with DirectX

Note

CreateWindowEx is a macro, which expands to either CreateWindowExA or CreateWindowExW based on whether UNICODE has been defined. Many WinAPI functions work this way: they have a macro which switches between the appropriate functions based on UNICODE, then have the A and W versions.

Now, the difference between the A and W versions is simple.

The A version handles text based on Windows code pages, while the W version handles Unicode text.

If we use A version and set window title, we get freaking Chinese characters in the title area.

image

But if we switch to the W version, we get a nice result.

image

CreateWindowExA accepts LPCSTR data type as the title, on the other hand, CreateWindowExW accepts LPCWSTR as the title. We can simply place an L in front of the char array/string to convert LPCSTR to LPCWSTR.

About

Graphics Programming with DirectX

License:MIT License


Languages

Language:C++ 100.0%