From 59ba895727b69d8495c67bb619c35cc52eb88698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 22 Sep 2014 22:03:41 -0700 Subject: [PATCH] Windows: Clear window after initialization. --- examples/common/entry/entry_windows.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/examples/common/entry/entry_windows.cpp b/examples/common/entry/entry_windows.cpp index a45f4be05..252845a17 100644 --- a/examples/common/entry/entry_windows.cpp +++ b/examples/common/entry/entry_windows.cpp @@ -215,6 +215,8 @@ namespace entry bgfx::winSetHwnd(m_hwnd[0]); adjust(m_hwnd[0], ENTRY_DEFAULT_WIDTH, ENTRY_DEFAULT_HEIGHT, true); + clear(m_hwnd[0]); + m_width = ENTRY_DEFAULT_WIDTH; m_height = ENTRY_DEFAULT_HEIGHT; m_oldWidth = ENTRY_DEFAULT_WIDTH; @@ -272,6 +274,7 @@ namespace entry , (HINSTANCE)GetModuleHandle(NULL) , 0 ); + clear(hwnd); m_hwnd[_wparam] = hwnd; WindowHandle handle = { (uint16_t)_wparam }; @@ -546,6 +549,16 @@ namespace entry return invalid; } + void clear(HWND _hwnd) + { + RECT rect; + GetWindowRect(_hwnd, &rect); + HBRUSH brush = CreateSolidBrush(RGB(0, 0, 0) ); + HDC hdc = GetDC(_hwnd); + SelectObject(hdc, brush); + FillRect(hdc, &rect, brush); + } + void adjust(HWND _hwnd, uint32_t _width, uint32_t _height, bool _windowFrame) { m_width = _width;