graphics_framebuffer.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <QDockWidget>
  6. #include "graphics_breakpoint_observer.h"
  7. class QComboBox;
  8. class QLabel;
  9. class QSpinBox;
  10. class CSpinBox;
  11. class GraphicsFramebufferWidget : public BreakPointObserverDock {
  12. Q_OBJECT
  13. using Event = Pica::DebugContext::Event;
  14. enum class Source {
  15. PicaTarget = 0,
  16. Custom = 1,
  17. // TODO: Add GPU framebuffer sources!
  18. };
  19. enum class Format {
  20. RGBA8 = 0,
  21. RGB8 = 1,
  22. RGB5A1 = 2,
  23. RGB565 = 3,
  24. RGBA4 = 4,
  25. };
  26. public:
  27. GraphicsFramebufferWidget(std::shared_ptr<Pica::DebugContext> debug_context, QWidget* parent = nullptr);
  28. public slots:
  29. void OnFramebufferSourceChanged(int new_value);
  30. void OnFramebufferAddressChanged(qint64 new_value);
  31. void OnFramebufferWidthChanged(int new_value);
  32. void OnFramebufferHeightChanged(int new_value);
  33. void OnFramebufferFormatChanged(int new_value);
  34. void OnUpdate();
  35. private slots:
  36. void OnBreakPointHit(Pica::DebugContext::Event event, void* data) override;
  37. void OnResumed() override;
  38. signals:
  39. void Update();
  40. private:
  41. QComboBox* framebuffer_source_list;
  42. CSpinBox* framebuffer_address_control;
  43. QSpinBox* framebuffer_width_control;
  44. QSpinBox* framebuffer_height_control;
  45. QComboBox* framebuffer_format_control;
  46. QLabel* framebuffer_picture_label;
  47. Source framebuffer_source;
  48. unsigned framebuffer_address;
  49. unsigned framebuffer_width;
  50. unsigned framebuffer_height;
  51. Format framebuffer_format;
  52. };