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   320
 
#define MARKER_BUTTON   1
 
#define MARKER_AXIS   2
 

Functions

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

Macro Definition Documentation

◆ MARKER_AXIS

#define MARKER_AXIS   2

Definition at line 33 of file controllermap.c.

Referenced by WatchJoystick().

◆ MARKER_BUTTON

#define MARKER_BUTTON   1

Definition at line 32 of file controllermap.c.

Referenced by WatchJoystick().

◆ SCREEN_HEIGHT

#define SCREEN_HEIGHT   320

Definition at line 29 of file controllermap.c.

Referenced by WatchJoystick().

◆ SCREEN_WIDTH

#define SCREEN_WIDTH   512

Definition at line 28 of file controllermap.c.

Referenced by WatchJoystick().

Function Documentation

◆ LoadTexture()

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

Definition at line 47 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().

48 {
49  SDL_Surface *temp;
51 
52  /* Load the sprite image */
53  temp = SDL_LoadBMP(file);
54  if (temp == NULL) {
55  SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError());
56  return NULL;
57  }
58 
59  /* Set transparent pixel as the pixel at (0,0) */
60  if (transparent) {
61  if (temp->format->palette) {
62  SDL_SetColorKey(temp, SDL_TRUE, *(Uint8 *) temp->pixels);
63  } else {
64  switch (temp->format->BitsPerPixel) {
65  case 15:
67  (*(Uint16 *) temp->pixels) & 0x00007FFF);
68  break;
69  case 16:
70  SDL_SetColorKey(temp, SDL_TRUE, *(Uint16 *) temp->pixels);
71  break;
72  case 24:
74  (*(Uint32 *) temp->pixels) & 0x00FFFFFF);
75  break;
76  case 32:
77  SDL_SetColorKey(temp, SDL_TRUE, *(Uint32 *) temp->pixels);
78  break;
79  }
80  }
81  }
82 
83  /* Create textures from the image */
84  texture = SDL_CreateTextureFromSurface(renderer, temp);
85  if (!texture) {
86  SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create texture: %s\n", SDL_GetError());
87  SDL_FreeSurface(temp);
88  return NULL;
89  }
90  SDL_FreeSurface(temp);
91 
92  /* We're ready to roll. :) */
93  return texture;
94 }
#define SDL_GetError
#define SDL_LoadBMP(file)
Definition: SDL_surface.h:186
GLenum GLenum GLuint texture
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:161
#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:143
Uint8 BitsPerPixel
Definition: SDL_pixels.h:317
#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:151
SDL_Palette * palette
Definition: SDL_pixels.h:316

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 337 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().

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

◆ WatchJoystick()

static SDL_bool WatchJoystick ( SDL_Joystick *  joystick)
static

Definition at line 97 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_FLIP_NONE, 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().

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