Example #1
0
func GetError() error {
	_err := C.SDL_GetError()
	if *_err == 0 {
		return nil
	}
	return errors.New(C.GoString(_err))
}
Example #2
0
func GetError() error {
	ret := C.SDL_GetError()
	if ret == nil {
		return nil
	}
	return errors.New(C.GoString(ret))
}
Example #3
0
func GetError() error {
	_c_err := C.SDL_GetError()
	if _c_err == nil {
		return nil
	}
	return errors.New(C.GoString(_c_err))
}
Example #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 ""
}
Example #5
0
func getError() error {
	err := C.GoString(C.SDL_GetError())
	if len(err) == 0 {
		panic("Blank error.")
	}

	return errors.New(err)
}
Example #6
0
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
}
Example #7
0
func GetError() (ret string) {
	ret = C.GoString(C.SDL_GetError())
	C.SDL_ClearError()
	return
}
Example #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
}
Example #9
0
// Gets SDL error string
func GetError() string { return C.GoString(C.SDL_GetError()) }
Example #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
}
Example #11
0
func fatalSDLError() {
	log.Fatal(C.GoString(C.SDL_GetError()))
}
Example #12
0
File: ui.go Project: velour/ui
func sdlError() error {
	return errors.New(C.GoString(C.SDL_GetError()))
}
Example #13
0
File: error.go Project: salihdb/sdl
// getError returns a message about the last error that occurred.
func getError() (err error) {
	return errors.New(C.GoString(C.SDL_GetError()))
}
Example #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
}
Example #15
0
File: sdl.go Project: beoran/fungo
// Gets the current error message of SDL
func GetError() string {
	res := C.SDL_GetError()
	return C.GoString(res)
}
Example #16
0
// Gets SDL error string
func GetError() string {
	GlobalMutex.Lock()
	s := C.GoString(C.SDL_GetError())
	GlobalMutex.Unlock()
	return s
}
Example #17
0
// Gets SDL error string
func GetError() string {
	s := C.GoString(C.SDL_GetError())
	return s
}