当前位置: 首页>>代码示例>>Golang>>正文


Golang C.SDL_JoystickOpen函数代码示例

本文整理汇总了Golang中C.SDL_JoystickOpen函数的典型用法代码示例。如果您正苦于以下问题:Golang SDL_JoystickOpen函数的具体用法?Golang SDL_JoystickOpen怎么用?Golang SDL_JoystickOpen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SDL_JoystickOpen函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: makestickopened

func makestickopened() {
	if joy == nil {
		C.SDL_InitSubSystem(C.SDL_INIT_JOYSTICK)
		fmt.Println(int(C.SDL_NumJoysticks()))
		joy = C.SDL_JoystickOpen(0)
		fmt.Println(joy)
	}
}
开发者ID:21isgonnabeagoodyear,项目名称:ggl,代码行数:8,代码来源:windowing.go

示例2: JoystickOpen

// Open a joystick for use The index passed as an argument refers to
// the N'th joystick on the system. This index is the value which will
// identify this joystick in future joystick events.  This function
// returns a joystick identifier, or NULL if an error occurred.
func JoystickOpen(deviceIndex int) *Joystick {
	GlobalMutex.Lock()
	joystick := C.SDL_JoystickOpen(C.int(deviceIndex))
	GlobalMutex.Unlock()
	return wrapJoystick(joystick)
}
开发者ID:kearsley,项目名称:Go-SDL,代码行数:10,代码来源:sdl.go

示例3: JoystickOpen

func JoystickOpen(device_index int) *Joystick {
	_device_index := (C.int)(device_index)
	return (*Joystick)(C.SDL_JoystickOpen(_device_index))
}
开发者ID:TomMurray,项目名称:go-sdl2,代码行数:4,代码来源:sdl_joystick.go

示例4: JoystickOpen

// JoystickOpen (https://wiki.libsdl.org/SDL_JoystickOpen)
func JoystickOpen(index JoystickID) *Joystick {
	return (*Joystick)(C.SDL_JoystickOpen(C.int(index)))
}
开发者ID:tanema,项目名称:amore,代码行数:4,代码来源:joystick.go

示例5: JoystickOpen

func JoystickOpen(n int) *Joystick {
	return (*Joystick)(unsafe.Pointer(C.SDL_JoystickOpen(C.int(n))))
}
开发者ID:gnanderson,项目名称:Go-SDL,代码行数:3,代码来源:sdl.go

示例6: JoystickOpen

// Open a joystick for use The index passed as an argument refers to
// the N'th joystick on the system. This index is the value which will
// identify this joystick in future joystick events.  This function
// returns a joystick identifier, or NULL if an error occurred.
func JoystickOpen(deviceIndex int) *Joystick {
	joystick := C.SDL_JoystickOpen(C.int(deviceIndex))
	return wrapJoystick(joystick)
}
开发者ID:krig,项目名称:Go-SDL2,代码行数:8,代码来源:input.go

示例7: JoystickOpen

// Open a joystick for use - the index passed as an argument refers to
// the N'th joystick on the system.  This index is the value which will
// identify this joystick in future joystick events.
// This function returns a joystick identifier, or NULL if an error occurred.
func JoystickOpen(index int) *C.SDL_Joystick {
	return C.SDL_JoystickOpen(C.int(index))
}
开发者ID:beoran,项目名称:fungo,代码行数:7,代码来源:joystick.go


注:本文中的C.SDL_JoystickOpen函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。