Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <d2d1.h>
- #include <d2d1_1.h>
- LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
- {
- if(uMsg == WM_DESTROY){PostQuitMessage(0); return 0;}
- };
- int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPWSTR cmd, int nCmdShow)
- {
- WNDCLASSEX windowclass;
- ZeroMemory(&windowclass, sizeof(WNDCLASSEX));
- windowclass.cbSize = sizeof(WNDCLASSEX);
- windowclass.hbrBackground = (HBRUSH) COLOR_WINDOW;
- windowclass.hInstance = hInstance;
- windowclass.lpfnWndProc = WindowProc;
- windowclass.lpszClassName = "MainWindow";
- //windowclass.style = CS_HREDRAW | CS_VREDRAW;
- RegisterClassEx(&windowclass);
- HWND windowhandle = CreateWindow("MainWindow", "Game window", WS_OVERLAPPEDWINDOW, 100, 100, 800, 600, NULL, NULL, hInstance, 0);
- if(!windowhandle) return -1;
- ShowWindow(windowhandle, nCmdShow);
- MSG message;
- while(GetMessage(&message, NULL, 0 , 0))
- {
- DispatchMessage(&message);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement