Example #1
0
// Surface (https://wiki.libsdl.org/SDL_GetColorKey)
func (surface *Surface) GetColorKey() (key uint32, err error) {
	_key := (*C.Uint32)(unsafe.Pointer(&key))
	if C.SDL_GetColorKey(surface.cptr(), _key) != 0 {
		return key, GetError()
	}
	return key, nil
}
Example #2
0
func (s *Surface) GetColorKey() (uint32, error) {
	var key C.Uint32
	if C.SDL_GetColorKey(s.c(), &key) != 0 {
		return 0, getError()
	}

	return uint32(key), nil
}
Example #3
0
func (surface *Surface) GetColorKey() (key uint32, status int) {
	_key := (*C.Uint32)(unsafe.Pointer(&key))
	status = int(C.SDL_GetColorKey(surface.cptr(), _key))
	return key, status
}
Example #4
0
func (surface *Surface) GetColorKey(key *uint32) int {
	_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))
	_key := (*C.Uint32)(unsafe.Pointer(key))
	return (int)(C.SDL_GetColorKey(_surface, _key))
}
Example #5
0
func (surface *Surface) GetColorKey() (key uint32, status int) {
	_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))
	_key := (*C.Uint32)(unsafe.Pointer(&key))
	status = (int)(C.SDL_GetColorKey(_surface, _key))
	return key, status
}