diff --git a/.vs/shader2/v14/.suo b/.vs/shader2/v14/.suo index ec3bdb4..10c9354 100644 Binary files a/.vs/shader2/v14/.suo and b/.vs/shader2/v14/.suo differ diff --git a/main.cpp b/main.cpp index d476477..8f79f9a 100644 --- a/main.cpp +++ b/main.cpp @@ -55,15 +55,17 @@ INT WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine int windowWidth = 800; int windowHeight = 600; + RECT rect; + rect.left = 0; + rect.right = windowWidth; + rect.bottom = windowHeight; + rect.top = 0; + + AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, false); + //窗口名称一定要和刚才注册窗口的保持一致 HWND hwnd = CreateWindowEx(NULL, L"GLWindow", L"OpenGL Window", WS_OVERLAPPEDWINDOW, 100, 100, windowWidth, windowHeight, NULL, NULL, hinstance, NULL); - //获取实际窗口大小 - RECT rect; - GetClientRect(hwnd, &rect); - windowWidth = rect.right - rect.left; - windowHeight = rect.bottom - rect.top; - //设置渲染环境 HDC dc = GetDC(hwnd);//获取设备上下文 PIXELFORMATDESCRIPTOR pfd;