Added return value for imguiCube().

This commit is contained in:
Dario Manesku 2014-10-06 06:29:03 +02:00
parent 657234f002
commit d25990487e
2 changed files with 16 additions and 6 deletions

View file

@ -1619,10 +1619,10 @@ struct Imgui
imageChannel(_image, _channel, _lod, int32_t(width), int32_t(height), _align);
}
void cubeMap(bgfx::TextureHandle _cubemap, float _lod, bool _cross, ImguiAlign::Enum _align)
bool cubeMap(bgfx::TextureHandle _cubemap, float _lod, bool _cross, ImguiAlign::Enum _align)
{
uint32_t numVertices = 14;
uint32_t numIndices = 36;
const uint32_t numVertices = 14;
const uint32_t numIndices = 36;
if (bgfx::checkAvailTransientBuffers(numVertices, PosNormalVertex::ms_decl, numIndices) )
{
bgfx::TransientVertexBuffer tvb;
@ -1692,6 +1692,8 @@ struct Imgui
indices += quad(indices, 10, 12, 13, 11);
}
const uint32_t id = getId();
Area& area = getCurrentArea();
int32_t xx;
int32_t width;
@ -1717,6 +1719,10 @@ struct Imgui
const int32_t yy = area.m_widgetY;
area.m_widgetY += height + DEFAULT_SPACING;
const bool enabled = isEnabled(m_areaId);
const bool over = enabled && inRect(xx, yy, width, height);
const bool res = buttonLogic(id, over);
const float scale = float(width/2);
float mtx[16];
@ -1734,7 +1740,11 @@ struct Imgui
);
setCurrentScissor();
bgfx::submit(m_view);
return res;
}
return false;
}
bool collapse(const char* _text, const char* _subtext, bool _checked, bool _enabled)
@ -3271,9 +3281,9 @@ void imguiImageChannel(bgfx::TextureHandle _image, uint8_t _channel, float _lod,
s_imgui.imageChannel(_image, _channel, _lod, _width, _aspect, _align);
}
void imguiCube(bgfx::TextureHandle _cubemap, float _lod, bool _cross, ImguiAlign::Enum _align)
bool imguiCube(bgfx::TextureHandle _cubemap, float _lod, bool _cross, ImguiAlign::Enum _align)
{
s_imgui.cubeMap(_cubemap, _lod, _cross, _align);
return s_imgui.cubeMap(_cubemap, _lod, _cross, _align);
}
float imguiGetTextLength(const char* _text, ImguiFontHandle _handle)

View file

@ -178,7 +178,7 @@ void imguiImage(bgfx::TextureHandle _image, float _lod, int32_t _width, int32_t
void imguiImage(bgfx::TextureHandle _image, float _lod, float _scale, float _aspect, ImguiAlign::Enum _align = ImguiAlign::LeftIndented, bool _originBottomLeft = false);
void imguiImageChannel(bgfx::TextureHandle _image, uint8_t _channel, float _lod, int32_t _width, int32_t _height, ImguiAlign::Enum _align = ImguiAlign::LeftIndented);
void imguiImageChannel(bgfx::TextureHandle _image, uint8_t _channel, float _lod, float _scale, float _aspect, ImguiAlign::Enum _align = ImguiAlign::LeftIndented);
void imguiCube(bgfx::TextureHandle _cubemap, float _lod = 0.0f, bool _cross = true, ImguiAlign::Enum _align = ImguiAlign::LeftIndented);
bool imguiCube(bgfx::TextureHandle _cubemap, float _lod = 0.0f, bool _cross = true, ImguiAlign::Enum _align = ImguiAlign::LeftIndented);
float imguiGetTextLength(const char* _text, ImguiFontHandle _handle);
bool imguiMouseOverArea();