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/DisplayLayoutScreen.h
Views: 1401
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 "GPU/Common/PostShader.h"
25
26
#include "MiscScreens.h"
27
28
class DisplayLayoutScreen : public UIDialogScreenWithGameBackground {
29
public:
30
DisplayLayoutScreen(const Path &filename);
31
void CreateViews() override;
32
void dialogFinished(const Screen *dialog, DialogResult result) override;
33
void onFinish(DialogResult reason) override;
34
35
void resized() override {
36
RecreateViews();
37
}
38
39
bool wantBrightBackground() const override { return true; }
40
41
const char *tag() const override { return "DisplayLayout"; }
42
43
protected:
44
UI::EventReturn OnPostProcShaderChange(UI::EventParams &e);
45
46
void sendMessage(UIMessage message, const char *value) override;
47
void DrawBackground(UIContext &dc) override;
48
49
private:
50
UI::ChoiceStrip *mode_ = nullptr;
51
UI::Choice *postProcChoice_ = nullptr;
52
std::string shaderNames_[256];
53
std::deque<bool> settingsVisible_; // vector<bool> is an insane bitpacked specialization!
54
};
55
56
class PostProcScreen : public UI::ListPopupScreen {
57
public:
58
PostProcScreen(std::string_view title, int id, bool showStereoShaders)
59
: ListPopupScreen(title), id_(id), showStereoShaders_(showStereoShaders) { }
60
61
void CreateViews() override;
62
63
const char *tag() const override { return "PostProc"; }
64
65
private:
66
void OnCompleted(DialogResult result) override;
67
bool ShowButtons() const override { return true; }
68
std::vector<ShaderInfo> shaders_;
69
int id_;
70
bool showStereoShaders_;
71
std::vector<int> indexTranslation_;
72
};
73
74