Moving imgui to the new ImmediateDrawer.
This commit is contained in:
@@ -28,11 +28,11 @@
|
||||
#include "xenia/base/threading.h"
|
||||
#include "xenia/cpu/frontend/ppc_disasm.h"
|
||||
#include "xenia/cpu/stack_walker.h"
|
||||
#include "xenia/debug/ui/imgui_renderer.h"
|
||||
#include "xenia/gpu/graphics_system.h"
|
||||
#include "xenia/kernel/xmodule.h"
|
||||
#include "xenia/kernel/xthread.h"
|
||||
#include "xenia/ui/gl/gl_context.h"
|
||||
#include "xenia/ui/imgui_drawer.h"
|
||||
|
||||
DEFINE_bool(imgui_debug, false, "Show ImGui debugging tools.");
|
||||
|
||||
@@ -91,7 +91,7 @@ bool DebugWindow::Initialize() {
|
||||
|
||||
window_->on_closed.AddListener([this](UIEvent* e) {
|
||||
// Kill now while we have a GL context.
|
||||
imgui_renderer_.reset();
|
||||
imgui_drawer_.reset();
|
||||
});
|
||||
loop_->on_quit.AddListener([this](UIEvent* e) { window_.reset(); });
|
||||
|
||||
@@ -120,8 +120,7 @@ bool DebugWindow::Initialize() {
|
||||
window_->set_context(std::move(context));
|
||||
|
||||
// Setup ImGui.
|
||||
imgui_renderer_ =
|
||||
std::make_unique<ImGuiRenderer>(window_.get(), window_->context());
|
||||
imgui_drawer_ = std::make_unique<xe::ui::ImGuiDrawer>(window_.get());
|
||||
window_->on_key_char.AddListener([](xe::ui::KeyEvent* e) {
|
||||
auto& io = ImGui::GetIO();
|
||||
if (e->key_code() > 0 && e->key_code() < 0x10000) {
|
||||
|
||||
@@ -21,12 +21,16 @@
|
||||
#include "xenia/ui/window.h"
|
||||
#include "xenia/xbox.h"
|
||||
|
||||
namespace xe {
|
||||
namespace ui {
|
||||
class ImGuiDrawer;
|
||||
} // namespace ui
|
||||
} // namespace xe
|
||||
|
||||
namespace xe {
|
||||
namespace debug {
|
||||
namespace ui {
|
||||
|
||||
class ImGuiRenderer;
|
||||
|
||||
class DebugWindow : public DebugListener {
|
||||
public:
|
||||
~DebugWindow();
|
||||
@@ -91,7 +95,7 @@ class DebugWindow : public DebugListener {
|
||||
Debugger* debugger_ = nullptr;
|
||||
xe::ui::Loop* loop_ = nullptr;
|
||||
std::unique_ptr<xe::ui::Window> window_;
|
||||
std::unique_ptr<ImGuiRenderer> imgui_renderer_;
|
||||
std::unique_ptr<xe::ui::ImGuiDrawer> imgui_drawer_;
|
||||
uint64_t last_draw_tick_count_ = 0;
|
||||
|
||||
uintptr_t capstone_handle_ = 0;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,55 +0,0 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2015 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_DEBUG_UI_IMGUI_RENDERER_H_
|
||||
#define XENIA_DEBUG_UI_IMGUI_RENDERER_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "third_party/imgui/imgui.h"
|
||||
#include "xenia/base/clock.h"
|
||||
#include "xenia/base/logging.h"
|
||||
#include "xenia/base/math.h"
|
||||
#include "xenia/ui/gl/circular_buffer.h"
|
||||
#include "xenia/ui/gl/gl_context.h"
|
||||
#include "xenia/ui/window.h"
|
||||
|
||||
namespace xe {
|
||||
namespace debug {
|
||||
namespace ui {
|
||||
|
||||
class ImGuiRenderer {
|
||||
public:
|
||||
ImGuiRenderer(xe::ui::Window* window, xe::ui::GraphicsContext* context);
|
||||
~ImGuiRenderer();
|
||||
|
||||
private:
|
||||
static ImGuiRenderer* global_renderer_;
|
||||
|
||||
void Initialize();
|
||||
void InitializeShaders();
|
||||
void InitializeFontTextures();
|
||||
void Shutdown();
|
||||
|
||||
void RenderDrawLists(ImDrawData* data);
|
||||
|
||||
xe::ui::Window* window_ = nullptr;
|
||||
xe::ui::GraphicsContext* context_ = nullptr;
|
||||
|
||||
GLuint program_ = 0;
|
||||
GLuint vao_ = 0;
|
||||
xe::ui::gl::CircularBuffer vertex_buffer_;
|
||||
xe::ui::gl::CircularBuffer index_buffer_;
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
} // namespace debug
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_DEBUG_UI_IMGUI_RENDERER_H_
|
||||
Reference in New Issue
Block a user