Prepare for Vulkan backend (#6595)
* externals: Add libraries required for vulkan * build: Add support for downloading bundled MoltenVK. * ci: Install tools needed for Vulkan. * citra_qt: Add API status indicator --------- Co-authored-by: GPUCode <geoster3d@gmail.com>
This commit is contained in:
parent
5b7cc76ba3
commit
54c499ed5b
15 changed files with 166 additions and 11 deletions
|
@ -358,6 +358,22 @@ void GMainWindow::InitializeWidgets() {
|
|||
statusBar()->addPermanentWidget(label);
|
||||
}
|
||||
|
||||
// Setup Graphics API button
|
||||
graphics_api_button = new QPushButton();
|
||||
graphics_api_button->setObjectName(QStringLiteral("GraphicsAPIStatusBarButton"));
|
||||
graphics_api_button->setFocusPolicy(Qt::NoFocus);
|
||||
UpdateAPIIndicator();
|
||||
|
||||
connect(graphics_api_button, &QPushButton::clicked, this, [this] {
|
||||
if (emulation_running) {
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateAPIIndicator(true);
|
||||
});
|
||||
|
||||
statusBar()->insertPermanentWidget(0, graphics_api_button);
|
||||
|
||||
statusBar()->addPermanentWidget(multiplayer_state->GetStatusText());
|
||||
statusBar()->addPermanentWidget(multiplayer_state->GetStatusIcon());
|
||||
|
||||
|
@ -1990,6 +2006,7 @@ void GMainWindow::OnConfigure() {
|
|||
}
|
||||
UpdateSecondaryWindowVisibility();
|
||||
UpdateBootHomeMenuState();
|
||||
UpdateAPIIndicator();
|
||||
} else {
|
||||
Settings::values.input_profiles = old_input_profiles;
|
||||
Settings::values.touch_from_button_maps = old_touch_from_button_maps;
|
||||
|
@ -2313,6 +2330,24 @@ void GMainWindow::ShowMouseCursor() {
|
|||
}
|
||||
}
|
||||
|
||||
void GMainWindow::UpdateAPIIndicator(bool update) {
|
||||
static std::array graphics_apis = {QStringLiteral("SOFTWARE"), QStringLiteral("OPENGL")};
|
||||
|
||||
static std::array graphics_api_colors = {QStringLiteral("#3ae400"), QStringLiteral("#00ccdd")};
|
||||
|
||||
u32 api_index = static_cast<u32>(Settings::values.graphics_api.GetValue());
|
||||
if (update) {
|
||||
api_index = (api_index + 1) % graphics_apis.size();
|
||||
Settings::values.graphics_api = static_cast<Settings::GraphicsAPI>(api_index);
|
||||
}
|
||||
|
||||
const QString style_sheet = QStringLiteral("QPushButton { font-weight: bold; color: %0; }")
|
||||
.arg(graphics_api_colors[api_index]);
|
||||
|
||||
graphics_api_button->setText(graphics_apis[api_index]);
|
||||
graphics_api_button->setStyleSheet(style_sheet);
|
||||
}
|
||||
|
||||
void GMainWindow::OnMouseActivity() {
|
||||
ShowMouseCursor();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue