Example #1
0
func (s *Surface) SetColorKey(flag bool, key uint32) error {
	var cflag C.int
	if flag {
		cflag = 1
	}

	if C.SDL_SetColorKey(s.c(), cflag, C.Uint32(key)) != 0 {
		return getError()
	}

	return nil
}
Example #2
0
// Sets the color key (transparent pixel)  in  a  blittable  surface  and
// enables or disables RLE blit acceleration.
func (s *Surface) SetColorKey(flags uint32, ColorKey uint32) int {
	s.mutex.Lock()
	status := int(C.SDL_SetColorKey(s.cSurface, C.Uint32(flags), C.Uint32(ColorKey)))
	s.mutex.Unlock()
	return status
}
Example #3
0
func (surface *Surface) SetColorKey(flag int, key uint32) int {
	return int(C.SDL_SetColorKey(surface.cptr(), C.int(flag), C.Uint32(key)))
}
Example #4
0
// Sets the color key (transparent pixel)  in  a  blittable  surface  and
// enables or disables RLE blit acceleration.
func (s *Surface) SetColorKey(flags uint32, ColorKey uint32) int {
	return int(C.SDL_SetColorKey((*C.SDL_Surface)(cast(s)),
		C.Uint32(flags), C.Uint32(ColorKey)))
}
Example #5
0
func (surface *Surface) SetColorKey(flag int, key uint32) int {
	_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))
	_flag := (C.int)(flag)
	_key := (C.Uint32)(key)
	return (int)(C.SDL_SetColorKey(_surface, _flag, _key))
}
Example #6
0
func (s *Surface) SetColorKey(c color.Color) {
	C.SDL_SetColorKey(s.ptr, C.SDL_SRCCOLORKEY, C.Uint32(s.MapColor(c)))
}
Example #7
0
// Sets the color key (transparent pixel)  in  a  blittable  surface  and
// enables or disables RLE blit acceleration.
func (s *Surface) SetColorKey(flags uint32, ColorKey uint32) int {
	status := int(C.SDL_SetColorKey(s.cSurface, C.int(flags), C.Uint32(ColorKey)))
	return status
}
Example #8
0
// Surface (https://wiki.libsdl.org/SDL_SetColorKey)
func (surface *Surface) SetColorKey(flag int, key uint32) error {
	if C.SDL_SetColorKey(surface.cptr(), C.int(flag), C.Uint32(key)) != 0 {
		return GetError()
	}
	return nil
}
Example #9
0
// Sets the color key (transparent pixel) in a blittable surface.
// If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
// 'key' will be the transparent pixel in the source image of a blit.
// SDL_RLEACCEL requests RLE acceleration for the surface if present,
// and removes RLE acceleration if absent.
// If 'flag' is 0, this function clears any current color key.
// This function returns 0, or -1 if there was an error.
func setColorKey(surface *C.SDL_Surface, flag, key uint32) int {
	return int(C.SDL_SetColorKey(surface, C.Uint32(flag), C.Uint32(key)))
}