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/UI/JoystickHistoryView.h
Views: 1401
1
#pragma once
2
3
#include <deque>
4
5
#include "Common/UI/View.h"
6
7
enum class StickHistoryViewType {
8
INPUT,
9
OUTPUT,
10
OTHER,
11
};
12
13
class JoystickHistoryView : public UI::InertView {
14
public:
15
JoystickHistoryView(StickHistoryViewType type, std::string_view title, UI::LayoutParams *layoutParams = nullptr)
16
: UI::InertView(layoutParams), title_(title), type_(type) {}
17
18
void Draw(UIContext &dc) override;
19
std::string DescribeText() const override { return "Analog Stick View"; }
20
void Update() override;
21
void SetXY(float x, float y) {
22
curX_ = x;
23
curY_ = y;
24
}
25
26
private:
27
struct Location {
28
float x;
29
float y;
30
};
31
32
float curX_ = 0.0f;
33
float curY_ = 0.0f;
34
35
std::deque<Location> locations_;
36
int maxCount_ = 500;
37
std::string title_;
38
StickHistoryViewType type_;
39
};
40
41