mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 00:58:30 -05:00
Toggle window frame on F11, Alt-Enter.
This commit is contained in:
parent
d3ef0e407a
commit
37c88fb749
2 changed files with 1056 additions and 1038 deletions
18
src/bgfx_p.h
18
src/bgfx_p.h
|
@ -2870,6 +2870,15 @@ namespace bgfx
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_KEYDOWN:
|
||||||
|
case WM_SYSKEYDOWN:
|
||||||
|
if (WM_KEYDOWN == _id && VK_F11 == _wparam
|
||||||
|
|| WM_SYSKEYDOWN == _id && VK_RETURN == _wparam)
|
||||||
|
{
|
||||||
|
toggleWindowFrame();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2893,6 +2902,8 @@ namespace bgfx
|
||||||
|
|
||||||
void adjust(uint32_t _width, uint32_t _height, bool _windowFrame)
|
void adjust(uint32_t _width, uint32_t _height, bool _windowFrame)
|
||||||
{
|
{
|
||||||
|
m_width = _width;
|
||||||
|
m_height = _height;
|
||||||
m_aspectRatio = float(_width)/float(_height);
|
m_aspectRatio = float(_width)/float(_height);
|
||||||
|
|
||||||
ShowWindow(g_bgfxHwnd, SW_SHOWNORMAL);
|
ShowWindow(g_bgfxHwnd, SW_SHOWNORMAL);
|
||||||
|
@ -2996,8 +3007,15 @@ namespace bgfx
|
||||||
private:
|
private:
|
||||||
static LRESULT CALLBACK wndProc(HWND _hwnd, UINT _id, WPARAM _wparam, LPARAM _lparam);
|
static LRESULT CALLBACK wndProc(HWND _hwnd, UINT _id, WPARAM _wparam, LPARAM _lparam);
|
||||||
|
|
||||||
|
void toggleWindowFrame()
|
||||||
|
{
|
||||||
|
adjust(m_width, m_height, !m_frame);
|
||||||
|
}
|
||||||
|
|
||||||
RECT m_rect;
|
RECT m_rect;
|
||||||
DWORD m_style;
|
DWORD m_style;
|
||||||
|
uint32_t m_width;
|
||||||
|
uint32_t m_height;
|
||||||
float m_aspectRatio;
|
float m_aspectRatio;
|
||||||
bool m_frame;
|
bool m_frame;
|
||||||
bool m_update;
|
bool m_update;
|
||||||
|
|
Loading…
Reference in a new issue