Add support for SDL_GameControllerDB

This adds support for importing and applying mappings from the
SDL_GameControllerDB database.

Related to #900.
This commit is contained in:
Camilla Löwy
2017-06-18 15:13:25 +02:00
parent 07bf2b166b
commit 953106e74d
19 changed files with 1186 additions and 80 deletions
+6 -1
View File
@@ -26,6 +26,7 @@
//========================================================================
#include "internal.h"
#include "mappings.h"
#include <string.h>
#include <stdlib.h>
@@ -111,6 +112,10 @@ static void terminate(void)
_glfw.monitors = NULL;
_glfw.monitorCount = 0;
free(_glfw.mappings);
_glfw.mappings = NULL;
_glfw.mappingCount = 0;
_glfwTerminateVulkan();
_glfwPlatformTerminate();
@@ -209,8 +214,8 @@ GLFWAPI int glfwInit(void)
_glfw.initialized = GLFW_TRUE;
_glfw.timer.offset = _glfwPlatformGetTimerValue();
// Not all window hints have zero as their default value
glfwDefaultWindowHints();
glfwUpdateGamepadMappings(_glfwDefaultMappings);
return GLFW_TRUE;
}