summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Debugger/DebuggerPanel.h
blob: cc300373668dd14fc06d46ab0f06864c431be261 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright 2009 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#pragma once

#include <wx/panel.h>
#include "VideoCommon/Debugger.h"

class wxButton;
class wxChoice;
class wxTextCtrl;

class GFXDebuggerPanel : public wxPanel, public GFXDebuggerBase
{
public:
  GFXDebuggerPanel(wxWindow* parent, wxWindowID id = wxID_ANY,
                   const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
                   long style = wxTAB_TRAVERSAL, const wxString& title = _("GFX Debugger"));

  virtual ~GFXDebuggerPanel();

  void SaveSettings() const;
  void LoadSettings();

  bool bInfoLog;
  bool bPrimLog;
  bool bSaveTextures;
  bool bSaveTargets;
  bool bSaveShaders;

  void OnPause() override;

  // Called from GFX thread once the GFXDebuggerPauseFlag spin lock has finished
  void OnContinue() override;

private:
  wxButton* m_pButtonPause;
  wxButton* m_pButtonPauseAtNext;
  wxButton* m_pButtonPauseAtNextFrame;
  wxButton* m_pButtonCont;
  wxChoice* m_pPauseAtList;
  wxButton* m_pButtonDump;
  wxChoice* m_pDumpList;
  wxButton* m_pButtonUpdateScreen;
  wxButton* m_pButtonClearScreen;
  wxButton* m_pButtonClearTextureCache;
  wxButton* m_pButtonClearVertexShaderCache;
  wxButton* m_pButtonClearPixelShaderCache;
  wxTextCtrl* m_pCount;

  void OnClose(wxCloseEvent& event);
  void CreateGUIControls();

  void GeneralSettings(wxCommandEvent& event);

  // These set GFXDebuggerPauseFlag to true (either immediately or once the specified event has
  // occurred)
  void OnPauseButton(wxCommandEvent& event);
  void OnPauseAtNextButton(wxCommandEvent& event);

  void OnPauseAtNextFrameButton(wxCommandEvent& event);
  void OnDumpButton(wxCommandEvent& event);

  // sets GFXDebuggerPauseFlag to false
  void OnContButton(wxCommandEvent& event);

  void OnUpdateScreenButton(wxCommandEvent& event);
  void OnClearScreenButton(wxCommandEvent& event);
  void OnClearTextureCacheButton(wxCommandEvent& event);
  void OnClearVertexShaderCacheButton(wxCommandEvent& event);
  void OnClearPixelShaderCacheButton(wxCommandEvent& event);
};