test/testhotplug.c
author Edward Rudd <urkle@outoforder.cc>
Mon, 03 Feb 2014 22:52:18 -0500
changeset 8164 478fbe1f032f
child 8165 2b8ba3d53a67
permissions -rw-r--r--
add simple test showing off hotplugging of joysticks w/ haptic.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8164
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
     1
/*
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
     2
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
     3
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
     4
  This software is provided 'as-is', without any express or implied
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
     5
  warranty.  In no event will the authors be held liable for any damages
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
     6
  arising from the use of this software.
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
     7
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
     8
  Permission is granted to anyone to use this software for any purpose,
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
     9
  including commercial applications, and to alter it and redistribute it
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    10
  freely.
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    11
*/
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    12
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    13
/* Simple program to test the SDL joystick hotplugging */
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    14
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    15
#include <stdio.h>
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    16
#include <stdlib.h>
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    17
#include <string.h>
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    18
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    19
#include "SDL.h"
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    20
#include "SDL_haptic.h"
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    21
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    22
#ifndef SDL_JOYSTICK_DISABLED
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    23
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    24
int
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    25
main(int argc, char *argv[])
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    26
{
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    27
    SDL_Joystick *joystick = NULL;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    28
    SDL_Haptic *haptic = NULL;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    29
    SDL_JoystickID instance = -1;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    30
    SDL_bool keepGoing = SDL_TRUE;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    31
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    32
    /* Enable standard application logging */
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    33
    SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);	
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    34
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    35
    SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    36
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    37
    /* Initialize SDL (Note: video is required to start event loop) */
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    38
    if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC) < 0) {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    39
        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError());
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    40
        exit(1);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    41
    }
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    42
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    43
    //SDL_CreateWindow("Dummy", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 128, 128, 0);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    44
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    45
    SDL_Log("There are %d joysticks at startup\n", SDL_NumJoysticks());
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    46
    SDL_Log("There are %d haptic devices at startup\n", SDL_NumHaptics());
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    47
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    48
    while(keepGoing)
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    49
    {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    50
        SDL_Event event;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    51
        while(SDL_PollEvent(&event))
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    52
        {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    53
            switch(event.type)
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    54
            {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    55
                case SDL_QUIT:
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    56
                    keepGoing = SDL_FALSE;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    57
                    break;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    58
                case SDL_JOYDEVICEADDED:
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    59
                    if (joystick != NULL)
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    60
                    {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    61
                        SDL_Log("Only one joystick supported by this test\n");
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    62
                    }
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    63
                    else
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    64
                    {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    65
                        joystick = SDL_JoystickOpen(event.jdevice.which);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    66
                        instance = SDL_JoystickInstanceID(joystick);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    67
                        SDL_Log("Joy Added  : %d : %s\n", event.jdevice.which, SDL_JoystickName(joystick));
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    68
                        if (SDL_JoystickIsHaptic(joystick))
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    69
                        {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    70
                            haptic = SDL_HapticOpenFromJoystick(joystick);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    71
                            if (haptic)
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    72
                            {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    73
                                SDL_Log("Joy Haptic Opened\n");
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    74
                                if (SDL_HapticRumbleInit( haptic ) != 0)
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    75
                                {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    76
                                    SDL_Log("Could not init Rumble!");
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    77
                                    SDL_HapticClose(haptic);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    78
                                    haptic = NULL;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    79
                                }
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    80
                            } else {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    81
                                SDL_Log("Joy haptic FAILED!\n");
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    82
                            }
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    83
                        }
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    84
                    }
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    85
                    break;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    86
                case SDL_JOYDEVICEREMOVED:
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    87
                    if (instance == event.jdevice.which)
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    88
                    {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    89
                        SDL_Log("Joy Removed: %d\n", event.jdevice.which);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    90
                        instance = -1;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    91
                        if(haptic)
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    92
                        {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    93
                            SDL_HapticClose(haptic);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    94
                        }
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    95
                        SDL_JoystickClose(joystick);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    96
                        joystick = NULL;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    97
                    } else {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    98
                        SDL_Log("Unknown joystick diconnected\n");
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
    99
                    }
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   100
                    break;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   101
                case SDL_JOYAXISMOTION:
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   102
//                    SDL_Log("Axis Move: %d\n", event.jaxis.axis);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   103
                    SDL_HapticRumblePlay(haptic, 0.2, 250);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   104
                    break;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   105
                case SDL_JOYBUTTONDOWN:
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   106
                    SDL_Log("Button Press: %d\n", event.jbutton.button);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   107
                    if(haptic)
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   108
                    {
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   109
                        SDL_HapticRumblePlay(haptic, 0.2, 250);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   110
                    }
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   111
                    break;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   112
                case SDL_JOYBUTTONUP:
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   113
                    SDL_Log("Button Release: %d\n", event.jbutton.button);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   114
                    break;
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   115
            }
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   116
        }
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   117
    }
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   118
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   119
    SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   120
}
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   121
#else
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   122
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   123
int
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   124
main(int argc, char *argv[])
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   125
{
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   126
    SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL compiled without Joystick support.\n");
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   127
    exit(1);
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   128
}
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   129
478fbe1f032f add simple test showing off hotplugging of joysticks w/ haptic.
Edward Rudd <urkle@outoforder.cc>
parents:
diff changeset
   130
#endif