Whenever I try to use the following line from Casey's code I get multiple compile errors:
| WNDCLASS WindowClass = {};
|
When defining:
| WindowClass.lpszClassName = "GameWindowClass";
|
the compiler complains about type of the string not being wide unless prefixed with L. RegisterClassA(&WindowClass) is also refused due to type incompatibility with WNDCLASS.
Redefining WNDCLASS as WNDCLASSA allows it to compile but the window title is using Chinese characters?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 | WNDCLASS WindowClass = {}; // OR WNDCLASSA
WindowClass.style = CS_HREDRAW|CS_VREDRAW|CS_OWNDC;
WindowClass.lpfnWndProc = Win32MainWindowCallback;
WindowClass.hInstance = Instance;
//WindowClass.hIcon;
WindowClass.lpszClassName = "GameWindowClass";
if(RegisterClassA(&WindowClass))
{
HWND Window =
CreateWindowExA(
0,
WindowClass.lpszClassName,
"Game",
WS_OVERLAPPEDWINDOW|WS_VISIBLE,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
0,
0,
Instance,
0);
}
|