Qt: ImGui support

This commit is contained in:
Connor McLaughlin
2020-01-02 19:14:16 +10:00
parent 9de0bf0aaf
commit bea15c97cd
6 changed files with 57 additions and 14 deletions

View File

@ -130,6 +130,8 @@ void QtHostInterface::refreshGameList(bool invalidate_cache /*= false*/)
QWidget* QtHostInterface::createDisplayWidget(QWidget* parent)
{
m_display_window = new OpenGLDisplayWindow(this, nullptr);
connect(m_display_window, &QtDisplayWindow::windowResizedEvent, this, &QtHostInterface::onDisplayWindowResized);
m_display.release();
m_display = std::unique_ptr<HostDisplay>(m_display_window->getHostDisplayInterface());
return QWidget::createWindowContainer(m_display_window, parent);
@ -176,6 +178,11 @@ void QtHostInterface::doHandleKeyEvent(int key, bool pressed)
iter->second(pressed);
}
void QtHostInterface::onDisplayWindowResized(int width, int height)
{
m_display_window->onWindowResized(width, height);
}
void QtHostInterface::updateInputMap()
{
if (!isOnWorkerThread())
@ -352,16 +359,17 @@ void QtHostInterface::threadEntryPoint()
// rendering
{
// DrawImGui();
if (m_system)
{
DrawDebugWindows();
m_system->GetGPU()->ResetGraphicsAPIState();
}
DrawFPSWindow();
DrawOSDMessages();
// ImGui::Render();
m_display->Render();
// ImGui::NewFrame();
if (m_system)
{
m_system->GetGPU()->RestoreGraphicsAPIState();