當前位置: 首頁>>代碼示例>>Golang>>正文


Golang C.SDL_SetColorKey函數代碼示例

本文整理匯總了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
}
開發者ID:willemvds,項目名稱:sdl,代碼行數:12,代碼來源:surface.go

示例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
}
開發者ID:kearsley,項目名稱:Go-SDL,代碼行數:8,代碼來源:sdl.go

示例3: SetColorKey

func (surface *Surface) SetColorKey(flag int, key uint32) int {
	return int(C.SDL_SetColorKey(surface.cptr(), C.int(flag), C.Uint32(key)))
}
開發者ID:JalfResi,項目名稱:go-sdl2,代碼行數:3,代碼來源:surface.go

示例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)))
}
開發者ID:gnanderson,項目名稱:Go-SDL,代碼行數:6,代碼來源:sdl.go

示例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))
}
開發者ID:kyleconroy,項目名稱:golds,代碼行數:6,代碼來源:sdl_surface.go

示例6: SetColorKey

func (s *Surface) SetColorKey(c color.Color) {
	C.SDL_SetColorKey(s.ptr, C.SDL_SRCCOLORKEY, C.Uint32(s.MapColor(c)))
}
開發者ID:rsaarelm,項目名稱:teratogen,代碼行數:3,代碼來源:video.go

示例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
}
開發者ID:jbondeson,項目名稱:Go-SDL2,代碼行數:6,代碼來源:surface.go

示例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
}
開發者ID:emlai,項目名稱:go-sdl2,代碼行數:7,代碼來源:surface.go

示例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)))
}
開發者ID:beoran,項目名稱:fungo,代碼行數:10,代碼來源:video.go


注:本文中的C.SDL_SetColorKey函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。