Loading...
Searching...
No Matches
score-plugin-gfx/Gfx/Settings/Model.hpp
1#pragma once
2#include <Gfx/Graph/RenderState.hpp>
3
4#include <score/plugins/ProjectSettings/ProjectSettingsModel.hpp>
5#include <score/plugins/settingsdelegate/SettingsDelegateModel.hpp>
6
7#include <score_plugin_gfx_export.h>
8
9#include <verdigris>
10namespace Gfx::Settings
11{
12
14{
15 const QString OpenGL{"OpenGL"};
16 const QString Vulkan{"Vulkan"};
17 const QString Metal{"Metal"};
18 const QString D3D11{"Direct3D 11"};
19 const QString D3D12{"Direct3D 12"};
20 operator QStringList() const noexcept;
21};
22
24{
25 const QString None{"None"};
26 const QString CUDA{"CUDA"};
27 const QString QSV{"Intel QuickSync"};
28 const QString VDPAU{"VDPAU"};
29 const QString VAAPI{"VA-API"};
30 const QString D3D{"Direct3D 11"};
31 const QString DXVA{"DXVA2"};
32 const QString VideoToolbox{"Video Toolbox"};
33 const QString V4L2{"V4L2-M2M"};
34 operator QStringList() const noexcept;
35};
36
38{
39 W_OBJECT(Model)
40
41 QString m_GraphicsApi{};
42 QString m_HardwareDecode{};
43 int m_DecodingThreads{1};
44 double m_Rate{};
45 int m_Samples{1};
46 bool m_VSync{};
47 int m_Buffers{3};
48
49public:
50 Model(QSettings& set, const score::ApplicationContext& ctx);
51
52 SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_GFX_EXPORT, QString, HardwareDecode)
53 SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_GFX_EXPORT, int, DecodingThreads)
54 SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_GFX_EXPORT, double, Rate)
55 SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_GFX_EXPORT, int, Samples)
56 SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_GFX_EXPORT, bool, VSync)
57 SCORE_SETTINGS_PARAMETER_HPP(SCORE_PLUGIN_GFX_EXPORT, int, Buffers)
58
59public:
60 score::gfx::GraphicsApi graphicsApiEnum() const noexcept;
61 QString getGraphicsApi() const;
62 void initGraphicsApi(QString);
63 void setGraphicsApi(QString);
64 void GraphicsApiChanged(QString arg)
65 E_SIGNAL(SCORE_PLUGIN_GFX_EXPORT, GraphicsApiChanged, arg)
66 SCORE_SETTINGS_PROPERTY(QString, GraphicsApi)
67
68 // Required as D3D12 requires a minimum of 2 samples
69 int resolveSamples(score::gfx::GraphicsApi) const noexcept;
70};
71
72SCORE_SETTINGS_PARAMETER(Model, GraphicsApi)
73SCORE_SETTINGS_PARAMETER(Model, HardwareDecode)
74SCORE_SETTINGS_PARAMETER(Model, DecodingThreads)
75SCORE_SETTINGS_PARAMETER(Model, Rate)
76SCORE_SETTINGS_PARAMETER(Model, Samples)
77SCORE_SETTINGS_PARAMETER(Model, VSync)
78SCORE_SETTINGS_PARAMETER(Model, Buffers)
79}
Definition score-plugin-gfx/Gfx/Settings/Model.hpp:38
Definition SettingsDelegateModel.hpp:16
GraphicsApi
Available graphics APIs to use.
Definition RenderState.hpp:17
Definition score-plugin-gfx/Gfx/Settings/Model.hpp:14
Definition score-plugin-gfx/Gfx/Settings/Model.hpp:24
Used to access all the application-wide state and structures.
Definition ApplicationContext.hpp:24