SDL  2.0
controllermap.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
+ Include dependency graph for controllermap.c:

Go to the source code of this file.

Data Structures

struct  MappingStep
 

Macros

#define SCREEN_WIDTH   512
 
#define SCREEN_HEIGHT   317
 
#define MAP_WIDTH   512
 
#define MAP_HEIGHT   317
 
#define MARKER_BUTTON   1
 
#define MARKER_AXIS   2
 

Functions

SDL_TextureLoadTexture (SDL_Renderer *renderer, char *file, SDL_bool transparent)
 
static SDL_bool WatchJoystick (SDL_Joystick *joystick)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

#define MAP_HEIGHT   317

Definition at line 33 of file controllermap.c.

#define MAP_WIDTH   512

Definition at line 32 of file controllermap.c.

#define MARKER_AXIS   2

Definition at line 36 of file controllermap.c.

Referenced by WatchJoystick().

#define MARKER_BUTTON   1

Definition at line 35 of file controllermap.c.

Referenced by WatchJoystick().

#define SCREEN_HEIGHT   317

Definition at line 29 of file controllermap.c.

Referenced by WatchJoystick().

#define SCREEN_WIDTH   512

Definition at line 28 of file controllermap.c.

Referenced by WatchJoystick().

Function Documentation

SDL_Texture* LoadTexture ( SDL_Renderer renderer,
char *  file,
SDL_bool  transparent 
)

Definition at line 50 of file controllermap.c.

References SDL_PixelFormat::BitsPerPixel, SDL_Surface::format, NULL, SDL_PixelFormat::palette, SDL_Surface::pixels, SDL_CreateTextureFromSurface, SDL_FreeSurface, SDL_GetError, SDL_LoadBMP, SDL_LOG_CATEGORY_APPLICATION, SDL_LogError, SDL_SetColorKey, and SDL_TRUE.

Referenced by WatchJoystick().

51 {
52  SDL_Surface *temp;
54 
55  /* Load the sprite image */
56  temp = SDL_LoadBMP(file);
57  if (temp == NULL) {
58  SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError());
59  return NULL;
60  }
61 
62  /* Set transparent pixel as the pixel at (0,0) */
63  if (transparent) {
64  if (temp->format->palette) {
65  SDL_SetColorKey(temp, SDL_TRUE, *(Uint8 *) temp->pixels);
66  } else {
67  switch (temp->format->BitsPerPixel) {
68  case 15:
70  (*(Uint16 *) temp->pixels) & 0x00007FFF);
71  break;
72  case 16:
73  SDL_SetColorKey(temp, SDL_TRUE, *(Uint16 *) temp->pixels);
74  break;
75  case 24:
77  (*(Uint32 *) temp->pixels) & 0x00FFFFFF);
78  break;
79  case 32:
80  SDL_SetColorKey(temp, SDL_TRUE, *(Uint32 *) temp->pixels);
81  break;
82  }
83  }
84  }
85 
86  /* Create textures from the image */
87  texture = SDL_CreateTextureFromSurface(renderer, temp);
88  if (!texture) {
89  SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError());
90  SDL_FreeSurface(temp);
91  return NULL;
92  }
93  SDL_FreeSurface(temp);
94 
95  /* We're ready to roll. :) */
96  return texture;
97 }
#define SDL_GetError
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
#define SDL_LoadBMP(file)
Definition: SDL_surface.h:182
GLenum GLenum GLuint texture
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
#define SDL_LogError
#define SDL_CreateTextureFromSurface
void * pixels
Definition: SDL_surface.h:75
#define SDL_FreeSurface
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
Uint8 BitsPerPixel
Definition: SDL_pixels.h:303
#define SDL_SetColorKey
#define NULL
Definition: begin_code.h:143
SDL_PixelFormat * format
Definition: SDL_surface.h:72
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_Palette * palette
Definition: SDL_pixels.h:302
int main ( int  argc,
char *  argv[] 
)

Definition at line 340 of file controllermap.c.

References i, NULL, SDL_FALSE, SDL_FINGERDOWN, SDL_GetError, SDL_Init, SDL_INIT_JOYSTICK, SDL_INIT_VIDEO, SDL_JOYDEVICEADDED, SDL_JoystickClose, SDL_JoystickGetGUID, SDL_JoystickGetGUIDString, SDL_JoystickInstanceID, SDL_JoystickNameForIndex, SDL_JoystickNumAxes, SDL_JoystickNumBalls, SDL_JoystickNumButtons, SDL_JoystickNumHats, SDL_JoystickOpen, SDL_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, SDL_LogError, SDL_LogSetPriority, SDL_MOUSEBUTTONDOWN, SDL_NumJoysticks, SDL_QUIT, SDL_QuitSubSystem, SDL_TRUE, SDL_WaitEvent, SDL_Event::type, and WatchJoystick().

341 {
342  const char *name;
343  int i;
344  SDL_Joystick *joystick;
345 
346  /* Enable standard application logging */
348 
349  /* Initialize SDL (Note: video is required to start event loop) */
351  SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError());
352  exit(1);
353  }
354 
355  /* Print information about the joysticks */
356  SDL_Log("There are %d joysticks attached\n", SDL_NumJoysticks());
357  for (i = 0; i < SDL_NumJoysticks(); ++i) {
358  name = SDL_JoystickNameForIndex(i);
359  SDL_Log("Joystick %d: %s\n", i, name ? name : "Unknown Joystick");
360  joystick = SDL_JoystickOpen(i);
361  if (joystick == NULL) {
362  SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_JoystickOpen(%d) failed: %s\n", i,
363  SDL_GetError());
364  } else {
365  char guid[64];
367  guid, sizeof (guid));
368  SDL_Log(" axes: %d\n", SDL_JoystickNumAxes(joystick));
369  SDL_Log(" balls: %d\n", SDL_JoystickNumBalls(joystick));
370  SDL_Log(" hats: %d\n", SDL_JoystickNumHats(joystick));
371  SDL_Log(" buttons: %d\n", SDL_JoystickNumButtons(joystick));
372  SDL_Log("instance id: %d\n", SDL_JoystickInstanceID(joystick));
373  SDL_Log(" guid: %s\n", guid);
374  SDL_JoystickClose(joystick);
375  }
376  }
377 
378 #ifdef __ANDROID__
379  if (SDL_NumJoysticks() > 0) {
380 #else
381  if (argv[1]) {
382 #endif
383  SDL_bool reportederror = SDL_FALSE;
384  SDL_bool keepGoing = SDL_TRUE;
386  int device;
387 #ifdef __ANDROID__
388  device = 0;
389 #else
390  device = atoi(argv[1]);
391 #endif
392  joystick = SDL_JoystickOpen(device);
393 
394  while ( keepGoing ) {
395  if (joystick == NULL) {
396  if ( !reportederror ) {
397  SDL_Log("Couldn't open joystick %d: %s\n", device, SDL_GetError());
398  keepGoing = SDL_FALSE;
399  reportederror = SDL_TRUE;
400  }
401  } else {
402  reportederror = SDL_FALSE;
403  keepGoing = WatchJoystick(joystick);
404  SDL_JoystickClose(joystick);
405  }
406 
407  joystick = NULL;
408  if (keepGoing) {
409  SDL_Log("Waiting for attach\n");
410  }
411  while (keepGoing) {
412  SDL_WaitEvent(&event);
413  if ((event.type == SDL_QUIT) || (event.type == SDL_FINGERDOWN)
414  || (event.type == SDL_MOUSEBUTTONDOWN)) {
415  keepGoing = SDL_FALSE;
416  } else if (event.type == SDL_JOYDEVICEADDED) {
417  joystick = SDL_JoystickOpen(device);
418  break;
419  }
420  }
421  }
422  }
423  else {
424  SDL_Log("\n\nUsage: ./controllermap number\nFor example: ./controllermap 0\nOr: ./controllermap 0 >> gamecontrollerdb.txt");
425  }
427 
428  return 0;
429 }
#define SDL_GetError
#define SDL_JoystickClose
#define SDL_JoystickGetGUID
#define SDL_INIT_JOYSTICK
Definition: SDL.h:78
#define SDL_QuitSubSystem
#define SDL_JoystickNameForIndex
#define SDL_JoystickOpen
#define SDL_NumJoysticks
#define SDL_JoystickNumButtons
GLuint const GLchar * name
#define SDL_JoystickGetGUIDString
#define SDL_JoystickInstanceID
#define SDL_LogError
#define SDL_JoystickNumAxes
SDL_bool
Definition: SDL_stdinc.h:126
#define SDL_Log
struct _cl_event * event
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:42
#define SDL_LogSetPriority
#define NULL
Definition: begin_code.h:143
#define SDL_JoystickNumHats
#define SDL_WaitEvent
#define SDL_JoystickNumBalls
#define SDL_Init
General event structure.
Definition: SDL_events.h:521
#define SDL_INIT_VIDEO
Definition: SDL.h:77
Uint32 type
Definition: SDL_events.h:523
static SDL_bool WatchJoystick(SDL_Joystick *joystick)
static SDL_bool WatchJoystick ( SDL_Joystick *  joystick)
static

Definition at line 100 of file controllermap.c.

References MappingStep::angle, MappingStep::axis, SDL_JoyAxisEvent::axis, background, MappingStep::button, SDL_JoyButtonEvent::button, done, MappingStep::field, SDL_Rect::h, MappingStep::hat, SDL_JoyHatEvent::hat, MappingStep::hat_value, SDL_Event::jaxis, SDL_Event::jbutton, SDL_Event::jhat, SDL_Event::key, SDL_KeyboardEvent::keysym, LoadTexture(), MappingStep::mapping, MappingStep::marker, MARKER_AXIS, MARKER_BUTTON, NULL, retval, screen, SCREEN_HEIGHT, SCREEN_WIDTH, SDL_ALPHA_OPAQUE, SDL_arraysize, SDL_CreateRenderer, SDL_CreateWindow, SDL_DestroyRenderer, SDL_DestroyWindow, SDL_FALSE, SDL_FINGERDOWN, SDL_GetError, SDL_GetPlatform, SDL_GetTicks(), SDL_HAT_CENTERED, SDL_JOYAXISMOTION, SDL_JOYBALLMOTION, SDL_JOYBUTTONUP, SDL_JOYHATMOTION, SDL_JoystickGetGUID, SDL_JoystickGetGUIDString, SDL_JoystickInstanceID, SDL_JoystickName, SDL_JoystickNumAxes, SDL_JoystickNumBalls, SDL_JoystickNumButtons, SDL_JoystickNumHats, SDL_KEYDOWN, SDL_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LogError, SDL_MOUSEBUTTONDOWN, SDL_PollEvent, SDL_QueryTexture, SDL_QUIT, SDL_RaiseWindow, SDL_RenderClear, SDL_RenderCopy, SDL_RenderCopyEx, SDL_RenderPresent, SDL_RenderSetLogicalSize, SDL_SetRenderDrawColor, SDL_SetTextureAlphaMod, SDL_SetTextureColorMod, SDL_snprintf, SDL_strlcat, SDL_strlcpy, SDL_TRUE, SDL_WINDOWPOS_CENTERED, SDLK_AC_BACK, SDLK_BACKSPACE, SDLK_ESCAPE, SDLK_SPACE, SDL_Keysym::sym, SDL_Event::type, SDL_JoyAxisEvent::value, SDL_JoyHatEvent::value, SDL_Rect::w, window, MappingStep::x, SDL_Rect::x, MappingStep::y, and SDL_Rect::y.

Referenced by main().

101 {
105  const char *name = NULL;
109  SDL_Rect dst;
110  int s, _s;
111  Uint8 alpha=200, alpha_step = -1;
112  Uint32 alpha_ticks = 0;
113  char mapping[4096], temp[4096];
114  MappingStep *step, *prev_step;
115  MappingStep steps[] = {
116  {342, 132, 0.0, MARKER_BUTTON, "x", -1, -1, -1, -1, ""},
117  {387, 167, 0.0, MARKER_BUTTON, "a", -1, -1, -1, -1, ""},
118  {431, 132, 0.0, MARKER_BUTTON, "b", -1, -1, -1, -1, ""},
119  {389, 101, 0.0, MARKER_BUTTON, "y", -1, -1, -1, -1, ""},
120  {174, 132, 0.0, MARKER_BUTTON, "back", -1, -1, -1, -1, ""},
121  {233, 132, 0.0, MARKER_BUTTON, "guide", -1, -1, -1, -1, ""},
122  {289, 132, 0.0, MARKER_BUTTON, "start", -1, -1, -1, -1, ""},
123  {116, 217, 0.0, MARKER_BUTTON, "dpleft", -1, -1, -1, -1, ""},
124  {154, 249, 0.0, MARKER_BUTTON, "dpdown", -1, -1, -1, -1, ""},
125  {186, 217, 0.0, MARKER_BUTTON, "dpright", -1, -1, -1, -1, ""},
126  {154, 188, 0.0, MARKER_BUTTON, "dpup", -1, -1, -1, -1, ""},
127  {77, 40, 0.0, MARKER_BUTTON, "leftshoulder", -1, -1, -1, -1, ""},
128  {91, 0, 0.0, MARKER_BUTTON, "lefttrigger", -1, -1, -1, -1, ""},
129  {396, 36, 0.0, MARKER_BUTTON, "rightshoulder", -1, -1, -1, -1, ""},
130  {375, 0, 0.0, MARKER_BUTTON, "righttrigger", -1, -1, -1, -1, ""},
131  {75, 154, 0.0, MARKER_BUTTON, "leftstick", -1, -1, -1, -1, ""},
132  {305, 230, 0.0, MARKER_BUTTON, "rightstick", -1, -1, -1, -1, ""},
133  {75, 154, 0.0, MARKER_AXIS, "leftx", -1, -1, -1, -1, ""},
134  {75, 154, 90.0, MARKER_AXIS, "lefty", -1, -1, -1, -1, ""},
135  {305, 230, 0.0, MARKER_AXIS, "rightx", -1, -1, -1, -1, ""},
136  {305, 230, 90.0, MARKER_AXIS, "righty", -1, -1, -1, -1, ""},
137  };
138 
139  /* Create a window to display joystick axis position */
140  window = SDL_CreateWindow("Game Controller Map", SDL_WINDOWPOS_CENTERED,
142  SCREEN_HEIGHT, 0);
143  if (window == NULL) {
144  SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError());
145  return SDL_FALSE;
146  }
147 
148  screen = SDL_CreateRenderer(window, -1, 0);
149  if (screen == NULL) {
150  SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError());
151  SDL_DestroyWindow(window);
152  return SDL_FALSE;
153  }
154 
155  background = LoadTexture(screen, "controllermap.bmp", SDL_FALSE);
156  button = LoadTexture(screen, "button.bmp", SDL_TRUE);
157  axis = LoadTexture(screen, "axis.bmp", SDL_TRUE);
158  SDL_RaiseWindow(window);
159 
160  /* scale for platforms that don't give you the window size you asked for. */
162 
163  /* Print info about the joystick we are watching */
164  name = SDL_JoystickName(joystick);
165  SDL_Log("Watching joystick %d: (%s)\n", SDL_JoystickInstanceID(joystick),
166  name ? name : "Unknown Joystick");
167  SDL_Log("Joystick has %d axes, %d hats, %d balls, and %d buttons\n",
168  SDL_JoystickNumAxes(joystick), SDL_JoystickNumHats(joystick),
169  SDL_JoystickNumBalls(joystick), SDL_JoystickNumButtons(joystick));
170 
171  SDL_Log("\n\n\
172  ====================================================================================\n\
173  Press the buttons on your controller when indicated\n\
174  (Your controller may look different than the picture)\n\
175  If you want to correct a mistake, press backspace or the back button on your device\n\
176  To skip a button, press SPACE or click/touch the screen\n\
177  To exit, press ESC\n\
178  ====================================================================================\n");
179 
180  /* Initialize mapping with GUID and name */
182  SDL_snprintf(mapping, SDL_arraysize(mapping), "%s,%s,platform:%s,",
183  temp, name ? name : "Unknown Joystick", SDL_GetPlatform());
184 
185  /* Loop, getting joystick events! */
186  for(s=0; s<SDL_arraysize(steps) && !done;) {
187  /* blank screen, set up for drawing this frame. */
188  step = &steps[s];
189  SDL_strlcpy(step->mapping, mapping, SDL_arraysize(step->mapping));
190  step->axis = -1;
191  step->button = -1;
192  step->hat = -1;
193  step->hat_value = -1;
194 
195  switch(step->marker) {
196  case MARKER_AXIS:
197  marker = axis;
198  break;
199  case MARKER_BUTTON:
200  marker = button;
201  break;
202  default:
203  break;
204  }
205 
206  dst.x = step->x;
207  dst.y = step->y;
208  SDL_QueryTexture(marker, NULL, NULL, &dst.w, &dst.h);
209  next=SDL_FALSE;
210 
211  SDL_SetRenderDrawColor(screen, 0xFF, 0xFF, 0xFF, SDL_ALPHA_OPAQUE);
212 
213  while (!done && !next) {
214  if (SDL_GetTicks() - alpha_ticks > 5) {
215  alpha_ticks = SDL_GetTicks();
216  alpha += alpha_step;
217  if (alpha == 255) {
218  alpha_step = -1;
219  }
220  if (alpha < 128) {
221  alpha_step = 1;
222  }
223  }
224 
225  SDL_RenderClear(screen);
226  SDL_RenderCopy(screen, background, NULL, NULL);
227  SDL_SetTextureAlphaMod(marker, sw_64);
228  SDL_SetTextureColorMod(marker, 10, 255, 21);
229  SDL_RenderCopyEx(screen, marker, NULL, &dst, step->angle, NULL, 0);
230  SDL_RenderPresent(screen);
231 
232  if (SDL_PollEvent(&event)) {
233  switch (event.type) {
234  case SDL_JOYAXISMOTION:
235  if ((event.jaxis.value > 20000 || event.jaxis.value < -20000) && event.jaxis.value != -32768) {
236  for (_s = 0; _s < s; _s++) {
237  if (steps[_s].axis == event.jaxis.axis) {
238  break;
239  }
240  }
241  if (_s == s) {
242  step->axis = event.jaxis.axis;
243  SDL_strlcat(mapping, step->field, SDL_arraysize(mapping));
244  SDL_snprintf(temp, SDL_arraysize(temp), ":a%u,", event.jaxis.axis);
245  SDL_strlcat(mapping, temp, SDL_arraysize(mapping));
246  s++;
247  next=SDL_TRUE;
248  }
249  }
250 
251  break;
252  case SDL_JOYHATMOTION:
253  if (event.jhat.value == SDL_HAT_CENTERED) {
254  break; /* ignore centering, we're probably just coming back to the center from the previous item we set. */
255  }
256  for (_s = 0; _s < s; _s++) {
257  if (steps[_s].hat == event.jhat.hat && steps[_s].hat_value == event.jhat.value) {
258  break;
259  }
260  }
261  if (_s == s) {
262  step->hat = event.jhat.hat;
263  step->hat_value = event.jhat.value;
264  SDL_strlcat(mapping, step->field, SDL_arraysize(mapping));
265  SDL_snprintf(temp, SDL_arraysize(temp), ":h%u.%u,", event.jhat.hat, event.jhat.value );
266  SDL_strlcat(mapping, temp, SDL_arraysize(mapping));
267  s++;
268  next=SDL_TRUE;
269  }
270  break;
271  case SDL_JOYBALLMOTION:
272  break;
273  case SDL_JOYBUTTONUP:
274  for (_s = 0; _s < s; _s++) {
275  if (steps[_s].button == event.jbutton.button) {
276  break;
277  }
278  }
279  if (_s == s) {
280  step->button = event.jbutton.button;
281  SDL_strlcat(mapping, step->field, SDL_arraysize(mapping));
282  SDL_snprintf(temp, SDL_arraysize(temp), ":b%u,", event.jbutton.button);
283  SDL_strlcat(mapping, temp, SDL_arraysize(mapping));
284  s++;
285  next=SDL_TRUE;
286  }
287  break;
288  case SDL_FINGERDOWN:
289  case SDL_MOUSEBUTTONDOWN:
290  /* Skip this step */
291  s++;
292  next=SDL_TRUE;
293  break;
294  case SDL_KEYDOWN:
295  if (event.key.keysym.sym == SDLK_BACKSPACE || event.key.keysym.sym == SDLK_AC_BACK) {
296  /* Undo! */
297  if (s > 0) {
298  prev_step = &steps[--s];
299  SDL_strlcpy(mapping, prev_step->mapping, SDL_arraysize(prev_step->mapping));
300  next = SDL_TRUE;
301  }
302  break;
303  }
304  if (event.key.keysym.sym == SDLK_SPACE) {
305  /* Skip this step */
306  s++;
307  next=SDL_TRUE;
308  break;
309  }
310 
311  if ((event.key.keysym.sym != SDLK_ESCAPE)) {
312  break;
313  }
314  /* Fall through to signal quit */
315  case SDL_QUIT:
316  done = SDL_TRUE;
317  break;
318  default:
319  break;
320  }
321  }
322  }
323 
324  }
325 
326  if (s == SDL_arraysize(steps) ) {
327  SDL_Log("Mapping:\n\n%s\n\n", mapping);
328  /* Print to stdout as well so the user can cat the output somewhere */
329  printf("%s\n", mapping);
330  }
331 
332  while(SDL_PollEvent(&event)) {};
333 
334  SDL_DestroyRenderer(screen);
335  SDL_DestroyWindow(window);
336  return retval;
337 }
#define SDL_strlcpy
GLenum GLenum dst
#define SCREEN_HEIGHT
Definition: controllermap.c:29
#define SDL_WINDOWPOS_CENTERED
Definition: SDL_video.h:129
#define SDL_PollEvent
#define SDL_GetError
SDL_Texture * button
#define SDL_strlcat
#define SCREEN_WIDTH
Definition: controllermap.c:28
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
#define SDL_JoystickGetGUID
SDL_JoyButtonEvent jbutton
Definition: SDL_events.h:535
SDL_Window * window
#define MARKER_AXIS
Definition: controllermap.c:36
#define SDL_JoystickNumButtons
#define SDL_CreateWindow
GLuint const GLchar * name
SDL_Texture * axis
SDL_Texture * background
#define SDL_JoystickGetGUIDString
#define SDL_JoystickInstanceID
#define SDL_JoystickName
#define SDL_LogError
#define SDL_JoystickNumAxes
double angle
Definition: controllermap.c:41
SDL_bool
Definition: SDL_stdinc.h:126
#define SDL_RenderCopy
SDL_bool retval
#define SDL_Log
GLdouble s
Definition: SDL_opengl.h:2056
SDL_Texture * LoadTexture(SDL_Renderer *renderer, char *file, SDL_bool transparent)
Definition: controllermap.c:50
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
SDL_JoyAxisEvent jaxis
Definition: SDL_events.h:532
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
struct _cl_event * event
#define SDL_RenderSetLogicalSize
#define SDL_RaiseWindow
int done
Definition: checkkeys.c:28
#define SDL_QueryTexture
#define SDL_GetPlatform
#define SDL_SetTextureColorMod
int x
Definition: SDL_rect.h:66
SDL_Keysym keysym
Definition: SDL_events.h:196
int w
Definition: SDL_rect.h:67
#define NULL
Definition: begin_code.h:143
#define SDL_JoystickNumHats
#define SDL_RenderClear
SDL_KeyboardEvent key
Definition: SDL_events.h:526
int h
Definition: SDL_rect.h:67
The type used to identify a window.
Definition: SDL_sysvideo.h:71
#define SDL_JoystickNumBalls
#define SDL_RenderCopyEx
SDL_Keycode sym
Definition: SDL_keyboard.h:50
#define SDL_snprintf
#define SDL_arraysize(array)
Definition: SDL_stdinc.h:93
GLenum GLenum GLenum GLenum mapping
General event structure.
Definition: SDL_events.h:521
GLfloat GLfloat GLfloat sw_64
#define SDL_SetRenderDrawColor
#define SDL_DestroyRenderer
SDL_JoyHatEvent jhat
Definition: SDL_events.h:534
#define SDL_HAT_CENTERED
Definition: SDL_joystick.h:207
#define SDL_ALPHA_OPAQUE
Definition: SDL_pixels.h:45
const GLchar * marker
SDL_Renderer * screen
char mapping[4096]
Definition: controllermap.c:45
#define SDL_DestroyWindow
#define MARKER_BUTTON
Definition: controllermap.c:35
int y
Definition: SDL_rect.h:66
#define SDL_CreateRenderer
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64
#define SDL_RenderPresent
#define SDL_SetTextureAlphaMod
Uint32 type
Definition: SDL_events.h:523
char * field
Definition: controllermap.c:43