Exemple #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
}
Exemple #2
0
func InitSubSystem(flags uint32) error {
	if C.SDL_InitSubSystem(C.Uint32(flags)) != 0 {
		return getError()
	}

	return nil
}
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)
	}
}
Exemple #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")
	}
}
Exemple #5
0
// Initializes subsystems.
func InitSubSystem(flags uint32) int {
	GlobalMutex.Lock()
	status := int(C.SDL_InitSubSystem(C.Uint32(flags)))
	GlobalMutex.Unlock()
	return status
}
Exemple #6
0
func InitSubSystem(flags uint32) int {
	return int(C.SDL_InitSubSystem(C.Uint32(flags)))
}
Exemple #7
0
func InitSubSystem(flags uint32) int {
	_flags := (C.Uint32)(flags)
	return (int)(C.SDL_InitSubSystem(_flags))
}
Exemple #8
0
// This function initializes specific SDL subsystems
func InitSubSystem(flags uint32) uint32 {
	return uint32(C.SDL_InitSubSystem(C.Uint32(flags)))
}
Exemple #9
0
// 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
}