mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[ion] Haptics events don't depend on SCREEN_ONLY
This commit is contained in:
committed by
EmilieNumworks
parent
979c227d54
commit
9786db308a
@@ -5,12 +5,9 @@ namespace Ion {
|
||||
namespace Simulator {
|
||||
namespace Haptics {
|
||||
|
||||
#if !EPSILON_SDL_SCREEN_ONLY
|
||||
static SDL_Haptic * sSDLHaptic = nullptr;
|
||||
#endif
|
||||
|
||||
void init() {
|
||||
#if !EPSILON_SDL_SCREEN_ONLY
|
||||
if (SDL_Init(SDL_INIT_HAPTIC) == 0) {
|
||||
sSDLHaptic = SDL_HapticOpen(0);
|
||||
if (sSDLHaptic) {
|
||||
@@ -19,23 +16,18 @@ void init() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void shutdown() {
|
||||
#if !EPSILON_SDL_SCREEN_ONLY
|
||||
if (sSDLHaptic) {
|
||||
SDL_HapticClose(sSDLHaptic);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void perform() {
|
||||
#if !EPSILON_SDL_SCREEN_ONLY
|
||||
if (sSDLHaptic) {
|
||||
SDL_HapticRumblePlay(sSDLHaptic, 1.0, 40);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user