CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Windows/GEDebugger/TabVertices.h
Views: 1401
1
// Copyright (c) 2012- PPSSPP Project.
2
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 or later versions.
6
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.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17
18
#pragma once
19
20
#include <vector>
21
#include "GPU/Common/GPUDebugInterface.h"
22
#include "Windows/W32Util/DialogManager.h"
23
#include "Windows/W32Util/Misc.h"
24
25
class VertexDecoder;
26
27
class CtrlVertexList: public GenericListControl {
28
public:
29
CtrlVertexList(HWND hwnd);
30
~CtrlVertexList();
31
32
void SetRaw(bool raw) {
33
raw_ = raw;
34
Update();
35
}
36
37
protected:
38
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override { return false; }
39
void GetColumnText(wchar_t *dest, int row, int col) override;
40
int GetRowCount() override;
41
42
private:
43
void FormatVertCol(wchar_t *dest, const GPUDebugVertex &vert, int col);
44
void FormatVertColRaw(wchar_t *dest, int row, int col);
45
void FormatVertColRawType(wchar_t *dest, const void *data, int type, int offset);
46
void FormatVertColRawColor(wchar_t *dest, const void *data, int type);
47
48
std::vector<GPUDebugVertex> vertices;
49
std::vector<u16> indices;
50
int rowCount_;
51
bool raw_;
52
VertexDecoder *decoder;
53
};
54
55
class TabVertices : public Dialog {
56
public:
57
TabVertices(HINSTANCE _hInstance, HWND _hParent);
58
~TabVertices();
59
60
void Update() override {
61
values->Update();
62
}
63
64
protected:
65
BOOL DlgProc(UINT message, WPARAM wParam, LPARAM lParam) override;
66
67
private:
68
void UpdateSize(WORD width, WORD height);
69
70
CtrlVertexList *values;
71
};
72
73
class CtrlMatrixList: public GenericListControl {
74
public:
75
CtrlMatrixList(HWND hwnd);
76
77
protected:
78
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override {
79
return false;
80
}
81
void GetColumnText(wchar_t *dest, int row, int col) override;
82
int GetRowCount() override;
83
void OnDoubleClick(int row, int column) override;
84
void OnRightClick(int row, int column, const POINT &point) override;
85
86
bool ListenColPrePaint() override { return true; }
87
bool OnColPrePaint(int row, int col, LPNMLVCUSTOMDRAW msg) override;
88
89
private:
90
bool GetValue(const GPUgstate &state, int row, int col, float &val);
91
bool ColChanged(const GPUgstate &lastState, const GPUgstate &state, int row, int col);
92
void ToggleBreakpoint(int row);
93
void PromptBreakpointCond(int row);
94
};
95
96
class TabMatrices : public Dialog {
97
public:
98
TabMatrices(HINSTANCE _hInstance, HWND _hParent);
99
~TabMatrices();
100
101
void Update() override {
102
values->Update();
103
}
104
105
protected:
106
BOOL DlgProc(UINT message, WPARAM wParam, LPARAM lParam) override;
107
108
private:
109
void UpdateSize(WORD width, WORD height);
110
111
CtrlMatrixList *values;
112
};
113
114