BlitzMax

BlitzMax

  • Downloads
  • Docs
  • API
  • Resources
  • About

›SDLHaptic

BlitzMax API

  • Introduction

BRL

    Audio

    • Introduction
    • TChannel
    • TSound

    AudioSample

    • Introduction
    • TAudioSample
    • TAudioSampleLoader

    Bank

    • Introduction
    • TBank

    BankStream

    • Introduction
    • TBankStream

    Base64

    • Introduction
    • TBase64

    Blitz

    • Introduction
    • TArrayBoundsException
    • TBlitzException
    • TNullFunctionException
    • TNullMethodException
    • TNullObjectException
    • TOutOfDataException
    • TRuntimeException
  • BRL.BMPLoader
  • Clipboard

    • Introduction
    • TClipboard
    • TClipboardOpts
    • TWin32ClipboardOpts
    • TX11ClipboardOpts
  • BRL.D3D7Max2D
  • BRL.D3D9Max2D
  • BRL.DirectSoundAudio
  • BRL.EndianStream
  • Event

    • Introduction
    • TEvent
  • BRL.EventQueue
  • BRL.FileSystem
  • BRL.FreeAudioAudio
  • BRL.GLGraphics
  • BRL.GLMax2D
  • BRL.GNet
  • BRL.Graphics
  • BRL.Hook
  • IO

    • Introduction
    • MaxIO
  • BRL.JPGLoader
  • BRL.KeyCodes
  • LinkedList

    • Introduction
    • TList
    • TListEnum
    • TLink

    Map

    • Introduction
    • TMap
    • TIntMap
    • TIntKey
    • TPtrMap
    • TPtrKey
    • TStringMap
  • BRL.Math
  • Matrix

    • Introduction
    • SMat2D
    • SMat2F
    • SMat2I
    • SMat3D
    • SMat3F
    • SMat3I
    • SMat4D
    • SMat4F
    • SMat4I

    Max2D

    • Introduction
    • TImage

    MaxLua

    • Introduction
    • TLuaClass
    • TLuaObject
  • BRL.OGGLoader
  • BRL.OpenALAudio
  • ObjectList

    • Introduction
    • TObjectList
    • TObjectListEnumerator
    • TObjectListReverseEnumerator

    Pixmap

    • Introduction
    • TPixmap
    • TPixmapLoader
  • BRL.PNGLoader
  • BRL.PolledInput
  • Quaternion

    • Introduction
    • SQuatD
    • SQuatF
    • SQuatI
  • BRL.RamStream
  • Random

    • Introduction
    • TRandom

    Reflection

    • Introduction
    • TTypeId
    • TMember
    • TConstant
    • TField
    • TGlobal
    • TFunction
    • TMethod
  • BRL.Retro
  • BRL.Socket
  • BRL.SocketStream
  • BRL.StandardIO
  • Stream

    • Introduction
    • TCStream
    • TIO
    • TStream
    • TStreamException
    • TStreamFactory
    • TStreamReadException
    • TStreamWrapper
    • TStreamWriteException

    StringBuilder

    • Introduction
    • TStringBuilder
    • TSplitBuffer
  • BRL.System
  • BRL.SystemDefault
  • BRL.TextStream
  • BRL.TGALoader
  • ThreadPool

    • Introduction
    • TRunnable
    • TThreadPoolExecutor

    Threads

    • Introduction
    • TThread
    • TThreadData
    • TMutex
    • TSemaphore
    • TCondVar

    Timer

    • Introduction
    • TChrono
  • BRL.TimerDefault
  • Vector

    • Introduction
    • SVec2D
    • SVec2F
    • SVec2I
    • SVec3D
    • SVec3F
    • SVec3I
    • SVec4D
    • SVec4F
    • SVec4I

    Volumes

    • Introduction
    • TVolume
  • BRL.WAVLoader

Text

    CSV

    • Introduction
    • TCsvParser
    • TCsvHeader
    • TCsvRow
    • TCsvOptions
    • SCsvColumn

    Format

    • Introduction
    • TFormatter

    Ini

    • Introduction
    • TIni
    • TIniProperty
    • TIniSection

    JConv

    • Introduction
    • TJConv
    • TJConvBuilder
    • TJConvSerializer

    Json

    • Introduction
    • TJSON
    • TJSONObject
    • TJSONString
    • TJSONInteger
    • TJSONReal
    • TJSONBool
    • TJSONArray
    • TJSONNull
    • TJSONError
    • TJSONNumber

    Regex

    • Introduction
    • TRegEx
    • TRegExMatch
    • TRegExOptions
    • TRegExException

    TOML

    • Introduction
    • ETomlNodeType
    • TToml
    • ITomlNode
    • STomlDate
    • STomlDateTime
    • STomlTime
    • TTomlArray
    • TTomlInteger
    • TTomlString
    • TTomlTable
    • TTomlBoolean

    Xml

    • Introduction
    • TxmlDoc
    • TxmlNode
    • TxmlAttribute

MaxGUI

  • MaxGUI.MaxGUI
  • MaxGUI.Drivers
  • MaxGUI.Localization
  • MaxGUI.ProxyGadgets
  • MaxGUI.CocoaMaxGUI
  • MaxGUI.Win32MaxGUIEx

PUB

  • Pub.FreeJoy
  • Pub.FreeProcess
  • Pub.Glad
  • Pub.Glew
  • Joystick

    • Introduction
    • TJoystickDriver
  • Pub.Lua
  • Pub.OpenAL
  • Pub.OpenGLES
  • Pub.xmmintrin
  • Pub.ZLib

Crypto

    Digest

    • Introduction
    • TMessageDigest
    • TDigestRegister
    • TNoSuchAlgorithmException

    Cipher

    • Introduction
    • TCipher
    • TCipherMode
    • Crypto.AESCipher
    • Crypto.AnubisCipher
    • Crypto.BlowfishCipher
    • Crypto.CamelliaCipher
    • Crypto.Cast5Cipher
    • Crypto.DESCipher
    • Crypto.IdeaCipher
    • Crypto.KasumiCipher
    • Crypto.KhazadCipher
    • Crypto.KSeedCipher
    • Crypto.NoekeonCipher
    • Crypto.SerpentCipher
    • Crypto.SkipjackCipher
    • Crypto.TwofishCipher
    • Crypto.XTeaCipher

    CBCMode

    • Introduction
    • TCBCCipherMode

    CFBMode

    • Introduction
    • TCFBCipherMode

    CTRMode

    • Introduction
    • TCTRCipherMode

    ECBMode

    • Introduction
    • TECBCipherMode

    F8Mode

    • Introduction
    • TF8CipherMode

    LRWMode

    • Introduction
    • TLRWCipherMode

    OFBMode

    • Introduction
    • TOFBCipherMode

    XTSMode

    • Introduction
    • TXTSCipherMode

    Blake2BDigest

    • Introduction
    • TBlake2B_512
    • TBlake2B_384
    • TBlake2B_256
    • TBlake2B_160

    CRC32

    • Introduction
    • TCRC32

    MD5Digest

    • Introduction
    • TMD5

    Ripemd320Digest

    • Introduction
    • TRipemd320

    Ripemd356Digest

    • Introduction
    • TRipemd256

    Ripemd160Digest

    • Introduction
    • TRipemd160

    Ripemd128Digest

    • Introduction
    • TRipemd128

    SHA1Digest

    • Introduction
    • TSHA1

    SHA256Digest

    • Introduction
    • TSHA256

    SHA512Digest

    • Introduction
    • TSHA512

    SHA3Digest

    • Introduction
    • TSHA3_512
    • TSHA3_384
    • TSHA3_256
    • TSHA3_224

    TigerDigest

    • Introduction
    • TTiger

    WhirlpoolDigest

    • Introduction
    • TWhirlpool

    Crypto

    • Introduction
    • TCryptoRandom
    • TCryptoSecretBox
    • TCryptoHash
    • TCryptoSign
    • TCryptoKeyExchange
    • TCryptoKey
    • TCryptoHashKey
    • TCryptoSecretBoxKey
    • TCryptoSignature
    • TCryptoExchangeKeyPair
    • TCryptoSessionKeyPair
    • TCryptoNPacket
    • TCryptoKK1Packet
    • TCryptoKK2Packet
    • TCryptoXX1Packet
    • TCryptoXX2Packet
    • TCryptoXX3Packet
    • TCryptoExchangeState
    • TCryptoPWHashMasterKey
    • TCryptoPWHashStoredKey
    • TCryptoPasswordHash

SDL

    SDL

    • Introduction
    • TSDLStream

    SDLSystem

    • Introduction
    • TSDLMultiGesture

    SDLVideo

    • Introduction
    • TSDLDisplay
    • TSDLDisplayMode
    • TSDLGLContext
    • TSDLWindow

    SDLRender

    • Introduction
    • TSDLRenderer
    • TSDLTexture

    SDLTimer

    • Introduction
    • TSDLTimer

    SDLHaptic

    • Introduction
    • TSDLHaptic
    • TSDLHapticCondition
    • TSDLHapticConstant
    • TSDLHapticCustom
    • TSDLHapticDirection
    • TSDLHapticEffect
    • TSDLHapticLeftRight
    • TSDLHapticPeriodic
    • TSDLHapticRamp

    SDLSensor

    • Introduction
    • TSDLSensor
  • SDL.SDLFreeAudio
  • SDL.GLSDLMax2D
  • SDL.GL2SDLMax2D
  • SDL.D3D9SDLMax2D
  • SDLVirtualJoystick

    • Introduction
    • TVirtualJoystick

Steam

    SteamSDK

    • Introduction
    • TSteamClient
    • TSteamUtils
    • TSteamUserStats
    • TSteamFriends
    • TSteamUGC
    • ISteamFriendsListener
    • ISteamUGCListener
    • ISteamUserStatsListener
    • ISteamUtilsListener
    • EItemPreviewType
    • EPersonaChange
    • EPersonaState
    • ERemoteStoragePublishedFileVisibility
    • EUGCMatchingUGCType
    • EUGCQuery
    • EUserRestriction
    • EUserUGCList
    • EWorkshopFileType
Edit

TSDLHaptic

A haptic device.

Methods

Method Query:UInt()

Gets the haptic device's supported features in bitwise manner.

Returns

A list of supported haptic features in bitwise manner (OR'd), or 0 on failure.


Method Index:Int()

Gets the index of the haptic device.


Method Pause:Int()

Pauses the haptic device.

Returns

0 on success or a negative error code on failure.


Method Unpause:Int()

Unpauses the haptic device.

0 on success or a negative error code on failure.


Method StopAll:Int()

Stops all the currently playing effects on the haptic device.

Returns

0 on success or a negative error code on failure.


Method NumAxes:Int()

Gets the number of haptic axes the device has.

The number of haptic axes might be useful if working with the Direction effect.


Method EffectSupported:Int(effect:TSDLHapticEffect)

Checks to see if an effect is supported by a haptic device.

True if effect is supported, False if it isn't, or a negative error code on failure.


Method NumEffects:Int()

Gets the number of effects a haptic device can store.

On some platforms this isn't fully supported, and therefore is an approximation. Always check to see if your created effect was actually created and do not rely solely on NumEffects().


Method NumEffectsPlaying:Int()

Gets the number of effects a haptic device can play at the same time.

This is not supported on all platforms, but will always return a value. Added here for the sake of completeness.


Method NewEffect:Int(effect:TSDLHapticEffect)

Creates a new haptic effect on the device.

Returns

The ID of the effect on success or a negative error code on failure.


Method RunEffect:Int(effect:Int, iterations:UInt)

Runs the effect on the device.

If iterations are SDL_HAPTIC_INFINITY, it'll run the effect over and over repeating the envelope (attack and fade) every time. If you only want the effect to last forever, set SDL_HAPTIC_INFINITY in the effect's length parameter.

Returns

0 on success or a negative error code on failure.


Method StopEffect:Int(effect:Int)

Stops the haptic effect on the device.

Returns

0 on success or a negative error code on failure.


Method EffectStatus:Int(effect:Int)

Gets the status of the current effect on the haptic device.

Device must support the SDL_HAPTIC_STATUS feature.

Returns

0 if it isn't playing, 1 if it is playing, or a negative error code on failure.


Method DestroyEffect(effect:Int)

Destroys the haptic effect on the device.

This will stop the effect if it's running. Effects are automatically destroyed when the device is closed.


Method RumbleInit:Int()

Initializes the haptic device for simple rumble playback.

Returns

0 on success or a negative error code on failure.


Method RumblePlay:Int(strength:Float, length:UInt)

Runs a simple rumble effect on a haptic device.


Method RumbleStop:Int()

Stops the simple rumble on the haptic device.

Returns

0 on success or a negative error code on failure.


Method RumbleSupported:Int()

Checks whether rumble is supported on the haptic device.


Method SetAutocenter:Int(value:Int)

Sets the global autocenter of the haptic device.

Returns

0 on success or a negative error code on failure.


Method SetGain:Int(value:Int)

Sets the global gain of the haptic device.


Method Close()

Closes the haptic device.


Functions

Function Open:TSDLHaptic(device:Int)

Opens a haptic device for use.

The device passed as an argument refers to the N'th haptic device on this system. When opening a haptic device, its gain will be set to maximum and autocenter will be disabled. To modify these values use SetGain() and SetAutocenter().


Function OpenFromJoystick:TSDLHaptic(joystick:TSDLJoystick)

Opens a haptic device for use from a joystick device.

You must still close the haptic device separately. It will not be closed with the joystick. When opened from a joystick you should first close the haptic device before closing the joystick device. If not, on some implementations the haptic device will also get unallocated and you'll be unable to use force feedback on that device.

Returns

Aa valid haptic device on success or NULL on failure.


Function MouseIsHaptic:Int()

Gets whether or not the current mouse has haptic capabilities.


Function OpenFromMouse:TSDLHaptic()

Opens a haptic device from the current mouse.

Returns

The haptic device or NULL on failure.


Function NumHaptics:Int()

Counts the number of haptic devices attached to the system.


Function Name:String(device:Int)

Gets the implementation dependent name of the haptic device.


Function Opened:Int(device:Int)

Checks if the haptic device at the designated index has been opened.

Returns

Returns True if it has been opened, False if it hasn't or on failure.


← IntroductionTSDLHapticCondition →
  • Methods
    • Method Query:UInt()
    • Method Index:Int()
    • Method Pause:Int()
    • Method Unpause:Int()
    • Method StopAll:Int()
    • Method NumAxes:Int()
    • Method EffectSupported:Int(effect:TSDLHapticEffect)
    • Method NumEffects:Int()
    • Method NumEffectsPlaying:Int()
    • Method NewEffect:Int(effect:TSDLHapticEffect)
    • Method RunEffect:Int(effect:Int, iterations:UInt)
    • Method StopEffect:Int(effect:Int)
    • Method EffectStatus:Int(effect:Int)
    • Method DestroyEffect(effect:Int)
    • Method RumbleInit:Int()
    • Method RumblePlay:Int(strength:Float, length:UInt)
    • Method RumbleStop:Int()
    • Method RumbleSupported:Int()
    • Method SetAutocenter:Int(value:Int)
    • Method SetGain:Int(value:Int)
    • Method Close()
  • Functions
    • Function Open:TSDLHaptic(device:Int)
    • Function OpenFromJoystick:TSDLHaptic(joystick:TSDLJoystick)
    • Function MouseIsHaptic:Int()
    • Function OpenFromMouse:TSDLHaptic()
    • Function NumHaptics:Int()
    • Function Name:String(device:Int)
    • Function Opened:Int(device:Int)
BlitzMax
Docs
Getting StartedDownloadsAbout
Community
ResourcesSyntaxBomb Forums
More
GitHubStarChat on Discord
Copyright © 2023 Bruce A Henderson