本文整理匯總了Golang中C.SDL_SetColorKey函數的典型用法代碼示例。如果您正苦於以下問題:Golang SDL_SetColorKey函數的具體用法?Golang SDL_SetColorKey怎麽用?Golang SDL_SetColorKey使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了SDL_SetColorKey函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: SetColorKey
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
}
示例2: SetColorKey
// 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
}
示例3: SetColorKey
func (surface *Surface) SetColorKey(flag int, key uint32) int {
return int(C.SDL_SetColorKey(surface.cptr(), C.int(flag), C.Uint32(key)))
}
示例4: SetColorKey
// 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)))
}
示例5: SetColorKey
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))
}
示例6: SetColorKey
func (s *Surface) SetColorKey(c color.Color) {
C.SDL_SetColorKey(s.ptr, C.SDL_SRCCOLORKEY, C.Uint32(s.MapColor(c)))
}
示例7: SetColorKey
// 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
}
示例8: SetColorKey
// 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
}
示例9: setColorKey
// 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)))
}