mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 03:16:54 +02:00
SDL3 update (#787)
* Update to SDL3 * Add XTest development dependency for SDL3 * Preserve native entry points with SDL3 * Document SDL3 XTest dependency
This commit is contained in:
@@ -20,7 +20,7 @@ add_executable(launcher WIN32
|
||||
)
|
||||
|
||||
|
||||
target_link_libraries(launcher Qt6::Concurrent Qt6::Network Qt6::Widgets Vulkan::Headers SDL2-static kyty_git_version)
|
||||
target_link_libraries(launcher Qt6::Concurrent Qt6::Network Qt6::Widgets Vulkan::Headers SDL3::SDL3-static kyty_git_version)
|
||||
if(WIN32)
|
||||
target_link_libraries(launcher setupapi)
|
||||
endif()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "common/emulatorConfig.h"
|
||||
#include "configuration.h"
|
||||
#include "mandatoryLineEdit.h"
|
||||
#include "SDL.h"
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#include <QAbstractItemView>
|
||||
#include <QCheckBox>
|
||||
@@ -173,17 +173,18 @@ void ConfigurationEditDialog::Init(const Configuration& info) {
|
||||
microphone->clear();
|
||||
microphone->addItem(tr("None"), QString {});
|
||||
microphone->setToolTip(tr("Microphone used by games. None supplies silence."));
|
||||
SDL_SetMainReady();
|
||||
if (SDL_InitSubSystem(SDL_INIT_AUDIO) == 0) {
|
||||
const int device_count = SDL_GetNumAudioDevices(SDL_TRUE);
|
||||
if (SDL_InitSubSystem(SDL_INIT_AUDIO)) {
|
||||
int device_count = 0;
|
||||
SDL_AudioDeviceID* devices = SDL_GetAudioRecordingDevices(&device_count);
|
||||
for (int i = 0; i < device_count; i++) {
|
||||
if (const auto* device = SDL_GetAudioDeviceName(i, SDL_TRUE); device != nullptr) {
|
||||
if (const auto* device = SDL_GetAudioDeviceName(devices[i]); device != nullptr) {
|
||||
const auto name = QString::fromUtf8(device);
|
||||
if (microphone->findData(name) < 0) {
|
||||
microphone->addItem(name, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
SDL_free(devices);
|
||||
SDL_QuitSubSystem(SDL_INIT_AUDIO);
|
||||
} else {
|
||||
microphone->setToolTip(tr("Microphones could not be listed: %1")
|
||||
|
||||
Reference in New Issue
Block a user