Ejemplo n.º 1
0
// Initializes subsystems.
func InitSubSystem(flags uint32) int {
	status := int(C.SDL_InitSubSystem(C.Uint32(flags)))
	if (status != 0) && (runtime.GOOS == "darwin") && (flags&INIT_VIDEO != 0) {
		if os.Getenv("SDL_VIDEODRIVER") == "" {
			os.Setenv("SDL_VIDEODRIVER", "x11")
			status = int(C.SDL_InitSubSystem(C.Uint32(flags)))
			if status != 0 {
				os.Setenv("SDL_VIDEODRIVER", "")
			}
		}
	}
	return status
}
Ejemplo n.º 2
0
Archivo: sdl.go Proyecto: willemvds/sdl
func InitSubSystem(flags uint32) error {
	if C.SDL_InitSubSystem(C.Uint32(flags)) != 0 {
		return getError()
	}

	return nil
}
Ejemplo n.º 3
0
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)
	}
}
Ejemplo n.º 4
0
func Init() {
	if ok := C.SDL_InitSubSystem(C.SDL_INIT_AUDIO); ok < 0 {
		panic(ok)
	}
	var want C.SDL_AudioSpec
	want.freq = 48000
	want.format = C.AUDIO_S16
	want.channels = 2
	want.callback = (C.SDL_AudioCallback)(unsafe.Pointer(C.audio_callback_go_cgo))
	var have C.SDL_AudioSpec
	if dev = C.SDL_OpenAudioDevice(nil, 0, &want, &have, 0); dev == 0 {
		panic("dev=0")
	}
}
Ejemplo n.º 5
0
// Initializes subsystems.
func InitSubSystem(flags uint32) int {
	GlobalMutex.Lock()
	status := int(C.SDL_InitSubSystem(C.Uint32(flags)))
	GlobalMutex.Unlock()
	return status
}
Ejemplo n.º 6
0
func InitSubSystem(flags uint32) int {
	return int(C.SDL_InitSubSystem(C.Uint32(flags)))
}
Ejemplo n.º 7
0
func InitSubSystem(flags uint32) int {
	_flags := (C.Uint32)(flags)
	return (int)(C.SDL_InitSubSystem(_flags))
}
Ejemplo n.º 8
0
Archivo: sdl.go Proyecto: beoran/fungo
// This function initializes specific SDL subsystems
func InitSubSystem(flags uint32) uint32 {
	return uint32(C.SDL_InitSubSystem(C.Uint32(flags)))
}
Ejemplo n.º 9
0
Archivo: init.go Proyecto: salihdb/sdl
// InitSubSystem initializes specific SDL subsystems.
//
// Note: QuitSubSystem should be called when finished using the subsystem.
//
// Note: Init initializes assertions and crash protection. If you want to bypass
// those protections you can call InitSubSystem directly.
func InitSubSystem(flags InitFlag) (err error) {
	if C.SDL_InitSubSystem(C.Uint32(flags)) != 0 {
		return getError()
	}
	return nil
}