Example #1
0
func VideoDriverName() string {
	ptr := C.malloc(512)
	defer C.free(ptr)
	nptr := C.SDL_VideoDriverName((*C.char)(ptr), 512)
	if nptr == nil {
		return ""
	}
	return C.GoString(nptr)
}
Example #2
0
// This function fills the given character buffer with the name of the
// video driver, and returns a pointer to it if the video driver has
// been initialized.  It returns NULL if no driver has been initialized.
func VideoDriverName() string {
	maxlen := 255
	namebuf := cstrNew(maxlen)
	defer namebuf.free()
	res := C.SDL_VideoDriverName(namebuf, C.int(maxlen))
	if res == nil {
		return "Video Not Initialized"
	}
	return C.GoString(res)
}