当前位置: 首页>>代码示例>>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;未经允许,请勿转载。