JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
haptics.hpp
Go to the documentation of this file.
1// Copyright 2026 Jan Niklas Hasse <jhasse@bixense.com>
2// For conditions of distribution and use, see copyright notice in LICENSE.txt
5#pragma once
6
7#include <cstdint>
8
9namespace jngl {
10
12enum class HapticFeedback : uint8_t {
14 Light,
16 Medium,
18 Heavy,
20 Long,
21};
22
33
34} // namespace jngl
JNGL's main namespace.
void hapticFeedback(HapticFeedback type=HapticFeedback::Medium)
Triggers haptic feedback (a short vibration)
HapticFeedback
Type of haptic feedback to trigger via jngl::hapticFeedback.
Definition haptics.hpp:12
@ Long
A long (~300 ms) vibration that starts strong and fades out, e.g. for an error or game over.
@ Medium
Medium feedback, e.g. for button presses.
@ Light
Short, light feedback suitable for ingame interactions.
@ Heavy
Strong feedback, e.g. for a long press or an important event.