Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/UI/DisplayLayoutScreen.h
5664 views
1
// Copyright (c) 2013- 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 <deque>
21
22
#include "Common/UI/View.h"
23
#include "Common/UI/ViewGroup.h"
24
#include "Common/UI/PopupScreens.h"
25
#include "GPU/Common/PostShader.h"
26
#include "UI/MiscScreens.h"
27
28
namespace UI {
29
class ChoiceStrip;
30
}
31
32
class DisplayLayoutScreen : public UIBaseDialogScreen {
33
public:
34
DisplayLayoutScreen(const Path &filename);
35
void CreateViews() override;
36
void dialogFinished(const Screen *dialog, DialogResult result) override;
37
void onFinish(DialogResult reason) override;
38
39
void resized() override {
40
RecreateViews();
41
}
42
43
bool wantBrightBackground() const override { return true; }
44
45
const char *tag() const override { return "DisplayLayout"; }
46
47
protected:
48
void OnPostProcShaderChange(UI::EventParams &e);
49
50
void sendMessage(UIMessage message, const char *value) override;
51
void DrawBackground(UIContext &dc) override;
52
53
private:
54
UI::ChoiceStrip *mode_ = nullptr;
55
UI::Choice *postProcChoice_ = nullptr;
56
std::string shaderNames_[256];
57
std::deque<bool> settingsVisible_; // vector<bool> is an insane bitpacked specialization! Not to be used with checkboxes!
58
};
59
60
class PostProcScreen : public UI::ListPopupScreen {
61
public:
62
PostProcScreen(std::string_view title, int id, bool showStereoShaders)
63
: ListPopupScreen(title), id_(id), showStereoShaders_(showStereoShaders) { }
64
65
void CreateViews() override;
66
67
const char *tag() const override { return "PostProc"; }
68
69
private:
70
void OnCompleted(DialogResult result) override;
71
bool ShowButtons() const override { return true; }
72
std::vector<ShaderInfo> shaders_;
73
int id_;
74
bool showStereoShaders_;
75
std::vector<int> indexTranslation_;
76
};
77
78