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