Lots more work on making the frame aui stuff functional.
[dolphin.git] / Source / Plugins / Plugin_VideoDX9 / Src / Debugger / Debugger.h
blob20f9cdfdcd7a6c685cd1eeaff8e96f3e4c1a2b0c
1 // Copyright (C) 2003 Dolphin Project.
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, version 2.0.
7 // This program is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // GNU General Public License 2.0 for more details.
12 // A copy of the GPL 2.0 should have been included with the program.
13 // If not, see http://www.gnu.org/licenses/
15 // Official SVN repository and contact information can be found at
16 // http://code.google.com/p/dolphin-emu/
18 #ifndef _DX_DEBUGGER_H_
19 #define _DX_DEBUGGER_H_
21 #include <wx/wx.h>
22 #include <wx/notebook.h>
24 #include "../Globals.h"
26 class IniFile;
28 class GFXDebuggerDX9 : public wxPanel
30 public:
31 GFXDebuggerDX9(wxWindow *parent,
32 wxWindowID id = wxID_ANY,
33 const wxPoint& pos = wxDefaultPosition,
34 const wxSize& size = wxDefaultSize,
35 long style = wxTAB_TRAVERSAL,
36 const wxString &title = wxT("DX9 Debugger"));
38 virtual ~GFXDebuggerDX9();
40 void SaveSettings() const;
41 void LoadSettings();
43 bool bInfoLog;
44 bool bPrimLog;
45 bool bSaveTextures;
46 bool bSaveTargets;
47 bool bSaveShaders;
49 void EnableButtons(bool enable);
51 private:
52 DECLARE_EVENT_TABLE();
54 wxPanel *m_MainPanel;
56 wxCheckBox *m_Check[6];
57 wxButton *m_pButtonPause;
58 wxButton *m_pButtonPauseAtNext;
59 wxButton *m_pButtonPauseAtNextFrame;
60 wxButton *m_pButtonGo;
61 wxChoice *m_pPauseAtList;
62 wxButton *m_pButtonDump;
63 wxChoice *m_pDumpList;
64 wxButton *m_pButtonUpdateScreen;
65 wxButton *m_pButtonClearScreen;
66 wxButton *m_pButtonClearTextureCache;
67 wxButton *m_pButtonClearVertexShaderCache;
68 wxButton *m_pButtonClearPixelShaderCache;
69 wxTextCtrl *m_pCount;
72 // WARNING: Make sure these are not also elsewhere
73 enum
75 ID_MAINPANEL = 3900,
76 ID_SAVETOFILE,
77 ID_INFOLOG,
78 ID_PRIMLOG,
79 ID_SAVETEXTURES,
80 ID_SAVETARGETS,
81 ID_SAVESHADERS,
82 NUM_OPTIONS,
83 ID_GO,
84 ID_PAUSE,
85 ID_PAUSE_AT_NEXT,
86 ID_PAUSE_AT_NEXT_FRAME,
87 ID_PAUSE_AT_LIST,
88 ID_DUMP,
89 ID_DUMP_LIST,
90 ID_UPDATE_SCREEN,
91 ID_CLEAR_SCREEN,
92 ID_CLEAR_TEXTURE_CACHE,
93 ID_CLEAR_VERTEX_SHADER_CACHE,
94 ID_CLEAR_PIXEL_SHADER_CACHE,
95 ID_COUNT
98 void OnClose(wxCloseEvent& event);
99 void CreateGUIControls();
101 void GeneralSettings(wxCommandEvent& event);
102 void OnPauseButton(wxCommandEvent& event);
103 void OnPauseAtNextButton(wxCommandEvent& event);
104 void OnPauseAtNextFrameButton(wxCommandEvent& event);
105 void OnDumpButton(wxCommandEvent& event);
106 void OnGoButton(wxCommandEvent& event);
107 void OnUpdateScreenButton(wxCommandEvent& event);
108 void OnClearScreenButton(wxCommandEvent& event);
109 void OnClearTextureCacheButton(wxCommandEvent& event);
110 void OnClearVertexShaderCacheButton(wxCommandEvent& event);
111 void OnClearPixelShaderCacheButton(wxCommandEvent& event);
112 void OnCountEnter(wxCommandEvent& event);
116 enum PauseEvent {
117 NOT_PAUSE = 0,
118 NEXT_FRAME = 1<<0,
119 NEXT_FLUSH = 1<<1,
121 NEXT_PIXEL_SHADER_CHANGE = 1<<2,
122 NEXT_VERTEX_SHADER_CHANGE = 1<<3,
123 NEXT_TEXTURE_CHANGE = 1<<4,
124 NEXT_NEW_TEXTURE = 1<<5,
126 NEXT_XFB_CMD = 1<<6,
127 NEXT_EFB_CMD = 1<<7,
129 NEXT_MATRIX_CMD = 1<<8,
130 NEXT_VERTEX_CMD = 1<<9,
131 NEXT_TEXTURE_CMD = 1<<10,
132 NEXT_LIGHT_CMD = 1<<11,
133 NEXT_FOG_CMD = 1<<12,
135 NEXT_SET_TLUT = 1<<13,
137 NEXT_ERROR = 1<<14,
140 extern volatile bool DX9DebuggerPauseFlag;
141 extern volatile PauseEvent DX9DebuggerToPauseAtNext;
142 extern volatile int DX9DebuggerEventToPauseCount;
143 void ContinueDX9Debugger();
144 void DX9DebuggerCheckAndPause(bool update);
145 void DX9DebuggerToPause(bool update);
147 #undef ENABLE_DX_DEBUGGER
148 #if defined(_DEBUG) || defined(DEBUGFAST)
149 #define ENABLE_DX_DEBUGGER
150 #endif
152 #ifdef ENABLE_DX_DEBUGGER
154 #define DEBUGGER_PAUSE_AT(event,update) {if (((DX9DebuggerToPauseAtNext & event) && --DX9DebuggerEventToPauseCount<=0) || DX9DebuggerPauseFlag) DX9DebuggerToPause(update);}
155 #define DEBUGGER_PAUSE_LOG_AT(event,update,dumpfunc) {if (((DX9DebuggerToPauseAtNext & event) && --DX9DebuggerEventToPauseCount<=0) || DX9DebuggerPauseFlag) {{dumpfunc};DX9DebuggerToPause(update);}}
156 #define DEBUGGER_LOG_AT(event,dumpfunc) {if (( DX9DebuggerToPauseAtNext & event ) ) {{dumpfunc};}}
158 #else
159 // Not to use debugger in release build
160 #define DEBUGGER_PAUSE_AT(event,update)
161 #define DEBUGGER_PAUSE_LOG_AT(event,update,dumpfunc)
162 #define DEBUGGER_LOG_AT(event,dumpfunc)
164 #endif ENABLE_DX_DEBUGGER
167 #endif // _DX_DEBUGGER_H_