diff options
author | 2016-01-04 19:00:51 +0100 | |
---|---|---|
committer | 2016-01-04 19:00:51 +0100 | |
commit | fc07cc3621be84d6b54b9a02f946ca9e33272758 (patch) | |
tree | 8e906945079bd6b41eb6051a2b71f0f196c06c04 /3rdparty/bgfx/examples/common/imgui/imgui.cpp | |
parent | 3f4fe77c75571ff17436909c3e579da27b646368 (diff) |
Added latest BX and BGFX (nw)
Diffstat (limited to '3rdparty/bgfx/examples/common/imgui/imgui.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/common/imgui/imgui.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp index 073191fde57..3bc68d3d61d 100644 --- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp +++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp @@ -1,6 +1,6 @@ /* - * Copyright 2011-2015 Branimir Karadzic. All rights reserved. - * License: http://www.opensource.org/licenses/BSD-2-Clause + * Copyright 2011-2016 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ // This code is based on: @@ -532,7 +532,7 @@ struct Imgui fs_imgui_image = bgfx::makeRef(fs_imgui_image_dx11, sizeof(fs_imgui_image_dx11) ); fs_imgui_image_swizz = bgfx::makeRef(fs_imgui_image_swizz_dx11, sizeof(fs_imgui_image_swizz_dx11) ); break; - + case bgfx::RendererType::Metal: vs_imgui_color = bgfx::makeRef(vs_imgui_color_mtl, sizeof(vs_imgui_color_mtl) ); fs_imgui_color = bgfx::makeRef(fs_imgui_color_mtl, sizeof(fs_imgui_color_mtl) ); @@ -838,7 +838,7 @@ struct Imgui const int32_t my = int32_t(float(_my)*yscale); IMGUI_beginFrame(mx, my, _button, _scroll, _width, _height, _inputChar, _view); - nvgBeginFrameScaled(m_nvg, m_viewWidth, m_viewHeight, m_surfaceWidth, m_surfaceHeight, 1.0f); + nvgBeginFrame(m_nvg, m_viewWidth, m_viewHeight, 1.0f); nvgViewId(m_nvg, _view); bgfx::setViewName(_view, "IMGUI"); @@ -3415,12 +3415,14 @@ bool imguiCheck(const char* _text, bool _checked, bool _enabled) return s_imgui.check(_text, _checked, _enabled); } -void imguiBool(const char* _text, bool& _flag, bool _enabled) +bool imguiBool(const char* _text, bool& _flag, bool _enabled) { - if (imguiCheck(_text, _flag, _enabled) ) + bool result = imguiCheck(_text, _flag, _enabled); + if (result) { _flag = !_flag; } + return result; } bool imguiCollapse(const char* _text, const char* _subtext, bool _checked, bool _enabled) |