Exemple #1
0
func GetError() error {
	_err := C.SDL_GetError()
	if *_err == 0 {
		return nil
	}
	return errors.New(C.GoString(_err))
}
Exemple #2
0
func GetError() error {
	ret := C.SDL_GetError()
	if ret == nil {
		return nil
	}
	return errors.New(C.GoString(ret))
}
Exemple #3
0
func GetError() error {
	_c_err := C.SDL_GetError()
	if _c_err == nil {
		return nil
	}
	return errors.New(C.GoString(_c_err))
}
Exemple #4
0
func Init() (error string) {
	flags := int64(C.SDL_INIT_VIDEO)
	if C.SDL_Init(C.Uint32(flags)) != 0 {
		error = C.GoString(C.SDL_GetError())
		return
	}
	return ""
}
Exemple #5
0
func getError() error {
	err := C.GoString(C.SDL_GetError())
	if len(err) == 0 {
		panic("Blank error.")
	}

	return errors.New(err)
}
func printerr(text string) error {
	_, file, line, _ := runtime.Caller(1)
	_, upperfile, upperline, _ := runtime.Caller(2)
	err := C.GoString(C.SDL_GetError())
	errtxt := err
	if len(err) > 0 {
		fmt.Println("SDL error: in ", file, " line ", line, " after ", upperfile, " line ", upperline, err, text)
	}
	glerr := C.glGetError()
	errtxt += map[int]string{0x0500: "GL_INVALID_ENUM", 0x0501: "GL_INVALID_VALUE", 0x0502: "GL_INVALID_OPERATION", 0x0505: "GL_OUT_OF_MEMORY"}[int(glerr)]
	if glerr != C.GL_NO_ERROR {
		fmt.Println("GL error: in ", file, " line ", line, " after ", upperfile, " line ", upperline, glerr, "("+map[int]string{0x0500: "GL_INVALID_ENUM", 0x0501: "GL_INVALID_VALUE", 0x0502: "GL_INVALID_OPERATION", 0x0505: "GL_OUT_OF_MEMORY"}[int(glerr)]+")", text)
	}
	if len(errtxt) > 0 {
		return errors.New(errtxt)
	}
	return nil
}
Exemple #7
0
func GetError() (ret string) {
	ret = C.GoString(C.SDL_GetError())
	C.SDL_ClearError()
	return
}
Exemple #8
0
// GetError (https://wiki.libsdl.org/SDL_GetError)
func GetError() error {
	if err := C.SDL_GetError(); err != nil {
		return errors.New(C.GoString(err))
	}
	return nil
}
Exemple #9
0
// Gets SDL error string
func GetError() string { return C.GoString(C.SDL_GetError()) }
Exemple #10
0
func GL_SetAttribute(attribute GLattr, value int) (err error) {
	if C.SDL_GL_SetAttribute(C.SDL_GLattr(attribute), C.int(value)) != 0 {
		return errors.New(C.GoString(C.SDL_GetError()))
	}
	return nil
}
Exemple #11
0
func fatalSDLError() {
	log.Fatal(C.GoString(C.SDL_GetError()))
}
Exemple #12
0
Fichier : ui.go Projet : velour/ui
func sdlError() error {
	return errors.New(C.GoString(C.SDL_GetError()))
}
Exemple #13
0
// getError returns a message about the last error that occurred.
func getError() (err error) {
	return errors.New(C.GoString(C.SDL_GetError()))
}
Exemple #14
0
func Init(flags uint32) (err error) {
	if C.SDL_Init(C.Uint32(flags)) != 0 {
		return errors.New(C.GoString(C.SDL_GetError()))
	}
	return nil
}
Exemple #15
0
// Gets the current error message of SDL
func GetError() string {
	res := C.SDL_GetError()
	return C.GoString(res)
}
Exemple #16
0
// Gets SDL error string
func GetError() string {
	GlobalMutex.Lock()
	s := C.GoString(C.SDL_GetError())
	GlobalMutex.Unlock()
	return s
}
Exemple #17
0
// Gets SDL error string
func GetError() string {
	s := C.GoString(C.SDL_GetError())
	return s
}