mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 00:46:25 +00:00
hints: Make SDL_VIDEODRIVER and SDL_AUDIODRIVER formal hints.
They were just environment variables before. Fixes #5528.
This commit is contained in:

committed by
Sam Lantinga

parent
634b9edc7f
commit
c1336b21ed
@@ -936,7 +936,7 @@ SDL_AudioInit(const char *driver_name)
|
||||
|
||||
/* Select the proper audio driver */
|
||||
if (driver_name == NULL) {
|
||||
driver_name = SDL_getenv("SDL_AUDIODRIVER");
|
||||
driver_name = SDL_GetHint(SDL_HINT_AUDIODRIVER);
|
||||
}
|
||||
|
||||
if (driver_name != NULL && *driver_name != 0) {
|
||||
|
@@ -425,7 +425,7 @@ SDL_VideoInit(const char *driver_name)
|
||||
i = index = 0;
|
||||
video = NULL;
|
||||
if (driver_name == NULL) {
|
||||
driver_name = SDL_getenv("SDL_VIDEODRIVER");
|
||||
driver_name = SDL_GetHint(SDL_HINT_VIDEODRIVER);
|
||||
}
|
||||
if (driver_name != NULL && *driver_name != 0) {
|
||||
const char *driver_attempt = driver_name;
|
||||
|
@@ -46,6 +46,7 @@
|
||||
#include "SDL_nullvideo.h"
|
||||
#include "SDL_nullevents_c.h"
|
||||
#include "SDL_nullframebuffer_c.h"
|
||||
#include "SDL_hints.h"
|
||||
|
||||
#define DUMMYVID_DRIVER_NAME "dummy"
|
||||
|
||||
@@ -59,7 +60,7 @@ static void DUMMY_VideoQuit(_THIS);
|
||||
static int
|
||||
DUMMY_Available(void)
|
||||
{
|
||||
const char *envr = SDL_getenv("SDL_VIDEODRIVER");
|
||||
const char *envr = SDL_GetHint(SDL_HINT_VIDEODRIVER);
|
||||
if ((envr) && (SDL_strcmp(envr, DUMMYVID_DRIVER_NAME) == 0)) {
|
||||
return (1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user