early-access version 1988
This commit is contained in:
17
externals/SDL/test/controllermap.c
vendored
17
externals/SDL/test/controllermap.c
vendored
@@ -165,6 +165,7 @@ static Uint32 s_unPendingAdvanceTime;
|
||||
static SDL_bool s_bBindingComplete;
|
||||
|
||||
static SDL_Window *window;
|
||||
static SDL_Renderer *screen;
|
||||
static SDL_bool done = SDL_FALSE;
|
||||
|
||||
SDL_Texture *
|
||||
@@ -375,7 +376,6 @@ BMergeAxisBindings(int iIndex)
|
||||
static void
|
||||
WatchJoystick(SDL_Joystick * joystick)
|
||||
{
|
||||
SDL_Renderer *screen = NULL;
|
||||
SDL_Texture *background_front, *background_back, *button, *axis, *marker;
|
||||
const char *name = NULL;
|
||||
SDL_Event event;
|
||||
@@ -384,12 +384,6 @@ WatchJoystick(SDL_Joystick * joystick)
|
||||
Uint32 alpha_ticks = 0;
|
||||
SDL_JoystickID nJoystickID;
|
||||
|
||||
screen = SDL_CreateRenderer(window, -1, 0);
|
||||
if (screen == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
background_front = LoadTexture(screen, "controllermap.bmp", SDL_FALSE);
|
||||
background_back = LoadTexture(screen, "controllermap_back.bmp", SDL_FALSE);
|
||||
button = LoadTexture(screen, "button.bmp", SDL_TRUE);
|
||||
@@ -746,7 +740,13 @@ main(int argc, char *argv[])
|
||||
return 2;
|
||||
}
|
||||
|
||||
while (SDL_NumJoysticks() == 0) {
|
||||
screen = SDL_CreateRenderer(window, -1, 0);
|
||||
if (screen == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError());
|
||||
return 2;
|
||||
}
|
||||
|
||||
while (!done && SDL_NumJoysticks() == 0) {
|
||||
SDL_Event event;
|
||||
|
||||
while (SDL_PollEvent(&event) > 0) {
|
||||
@@ -763,6 +763,7 @@ main(int argc, char *argv[])
|
||||
break;
|
||||
}
|
||||
}
|
||||
SDL_RenderPresent(screen);
|
||||
}
|
||||
|
||||
/* Print information about the joysticks */
|
||||
|
Reference in New Issue
Block a user