Skip to content

Commit

Permalink
haptic: Rename iHapticEffect interface to HapticEffect
Browse files Browse the repository at this point in the history
Signed-off-by: Lilis Iskandar <[email protected]>
  • Loading branch information
veeableful committed May 3, 2018
1 parent 7b69347 commit 9b73d5a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions sdl/haptic.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ func (he *HapticCustom) cHapticEffect() *C.SDL_HapticEffect {

// HapticEffect union that contains the generic template for any haptic effect.
// (https://wiki.libsdl.org/SDL_HapticEffect)
type HapticEffect C.SDL_HapticEffect

type iHapticEffect interface {
type HapticEffect interface {
cHapticEffect() *C.SDL_HapticEffect
}

Expand Down Expand Up @@ -297,7 +295,7 @@ func (h *Haptic) Query() (uint32, error) {
// EffectSupported reports whether an effect is supported by a haptic device.
// Pass pointer to a Haptic struct (Constant|Periodic|Condition|Ramp|LeftRight|Custom) instead of HapticEffect union.
// (https://wiki.libsdl.org/SDL_HapticEffectSupported)
func (h *Haptic) EffectSupported(he iHapticEffect) (bool, error) {
func (h *Haptic) EffectSupported(he HapticEffect) (bool, error) {
ret := int(C.SDL_HapticEffectSupported(
h.cptr(),
he.cHapticEffect()))
Expand All @@ -307,7 +305,7 @@ func (h *Haptic) EffectSupported(he iHapticEffect) (bool, error) {
// NewEffect creates a new haptic effect on a specified device.
// Pass pointer to a Haptic struct (Constant|Periodic|Condition|Ramp|LeftRight|Custom) instead of HapticEffect union.
// (https://wiki.libsdl.org/SDL_HapticNewEffect)
func (h *Haptic) NewEffect(he iHapticEffect) (int, error) {
func (h *Haptic) NewEffect(he HapticEffect) (int, error) {
ret := int(C.SDL_HapticNewEffect(
h.cptr(),
he.cHapticEffect()))
Expand All @@ -317,7 +315,7 @@ func (h *Haptic) NewEffect(he iHapticEffect) (int, error) {
// UpdateEffect updates the properties of an effect.
// Pass pointer to a Haptic struct (Constant|Periodic|Condition|Ramp|LeftRight|Custom) instead of HapticEffect union.
// (https://wiki.libsdl.org/SDL_HapticUpdateEffect)
func (h *Haptic) UpdateEffect(effect int, data iHapticEffect) error {
func (h *Haptic) UpdateEffect(effect int, data HapticEffect) error {
return errorFromInt(int(
C.SDL_HapticUpdateEffect(
h.cptr(),
Expand Down

0 comments on commit 9b73d5a

Please sign in to comment.