54 if (!name || !value) {
63 for (hint = SDL_hints; hint; hint = hint->next) {
65 if (priority < hint->priority) {
68 if (!hint->value || !value ||
SDL_strcmp(hint->value, value) != 0) {
69 for (entry = hint->callbacks; entry; ) {
72 entry->callback(entry->userdata, name, hint->value, value);
78 hint->priority = priority;
90 hint->priority = priority;
91 hint->callbacks =
NULL;
110 for (hint = SDL_hints; hint; hint = hint->next) {
128 if (!name || !*name) {
140 entry->callback = callback;
141 entry->userdata = userdata;
143 for (hint = SDL_hints; hint; hint = hint->next) {
157 hint->callbacks =
NULL;
163 entry->next = hint->callbacks;
164 hint->callbacks = entry;
168 callback(userdata, name, value, value);
177 for (hint = SDL_hints; hint; hint = hint->next) {
180 for (entry = hint->callbacks; entry; entry = entry->next) {
181 if (callback == entry->callback && userdata == entry->userdata) {
183 prev->next = entry->next;
185 hint->callbacks = entry->next;
204 SDL_hints = hint->next;
208 for (entry = hint->callbacks; entry; ) {
DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, const char *value)
Set a hint with normal priority.
DECLSPEC void SDLCALL SDL_free(void *mem)
SDL_HintPriority
An enumeration of hint priorities.
EGLImageKHR EGLint * name
DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
#define SDL_InvalidParamError(param)
struct SDL_HintWatch SDL_HintWatch
DECLSPEC char *SDLCALL SDL_strdup(const char *str)
DECLSPEC void *SDLCALL SDL_malloc(size_t size)
DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2)
DECLSPEC const char *SDLCALL SDL_GetHint(const char *name)
Get a hint.
EGLSurface EGLint void ** value
DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority)
Set a hint with a specific priority.
void(* SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue)
Add a function to watch a particular hint.
DECLSPEC char *SDLCALL SDL_getenv(const char *name)
DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
Remove a function watching a particular hint.
DECLSPEC void SDLCALL SDL_ClearHints(void)
Clear all hints.
static SDL_Hint * SDL_hints