mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 00:58:30 -05:00
Cleanup.
This commit is contained in:
parent
af2bb3874d
commit
1cf4f92152
3 changed files with 59 additions and 33 deletions
2
3rdparty/ocornut-imgui/imgui.cpp
vendored
2
3rdparty/ocornut-imgui/imgui.cpp
vendored
|
@ -9707,6 +9707,8 @@ void ImFontAtlas::ClearInputData()
|
|||
ImGui::MemFree(ConfigData[i].FontData);
|
||||
ConfigData[i].FontData = NULL;
|
||||
}
|
||||
|
||||
ConfigData.clear();
|
||||
}
|
||||
|
||||
void ImFontAtlas::ClearTexData()
|
||||
|
|
|
@ -86,7 +86,7 @@ struct OcornutImguiContext
|
|||
, uint16_t(bx::fmin(pcmd->ClipRect.z, 65535.0f)-bx::fmax(pcmd->ClipRect.x, 0.0f))
|
||||
, uint16_t(bx::fmin(pcmd->ClipRect.w, 65535.0f)-bx::fmax(pcmd->ClipRect.y, 0.0f))
|
||||
);
|
||||
union { void* ptr; bgfx::TextureHandle handle; } texture = { pcmd->TextureId };
|
||||
union { void* ptr; bgfx::TextureHandle handle; } texture ={ pcmd->TextureId };
|
||||
|
||||
bgfx::setTexture(0, s_tex, 0 != texture.handle.idx
|
||||
? texture.handle
|
||||
|
@ -185,7 +185,7 @@ struct OcornutImguiContext
|
|||
|
||||
io.Fonts->GetTexDataAsRGBA32(&data, &width, &height);
|
||||
|
||||
m_texture = bgfx::createTexture2D( (uint16_t)width
|
||||
m_texture = bgfx::createTexture2D((uint16_t)width
|
||||
, (uint16_t)height
|
||||
, 1
|
||||
, bgfx::TextureFormat::BGRA8
|
||||
|
|
|
@ -1063,4 +1063,28 @@ namespace Scintilla
|
|||
|
||||
} // namespace Scintilla
|
||||
|
||||
ScintillaEditor* ImGuiScintilla(const char* _name, bool* _opened, const ImVec2& _size)
|
||||
{
|
||||
ScintillaEditor* sci = NULL;
|
||||
|
||||
if (ImGui::Begin(_name, _opened, _size) )
|
||||
{
|
||||
ImGuiStorage* storage = ImGui::GetStateStorage();
|
||||
|
||||
ImGuiID id = ImGui::GetID(_name);
|
||||
sci = (ScintillaEditor*)storage->GetVoidPtr(id);
|
||||
if (NULL == sci)
|
||||
{
|
||||
ImVec2 size = ImGui::GetWindowSize();
|
||||
sci = ScintillaEditor::create(size.x, size.y);
|
||||
storage->SetVoidPtr(id, (void*)sci);
|
||||
}
|
||||
|
||||
sci->draw();
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
return sci;
|
||||
}
|
||||
|
||||
#endif // defined(SCI_NAMESPACE)
|
||||
|
|
Loading…
Reference in a new issue