当前位置: 首页>>代码示例>>Golang>>正文


Golang C.SDL_DisplayFormatAlpha函数代码示例

本文整理汇总了Golang中C.SDL_DisplayFormatAlpha函数的典型用法代码示例。如果您正苦于以下问题:Golang SDL_DisplayFormatAlpha函数的具体用法?Golang SDL_DisplayFormatAlpha怎么用?Golang SDL_DisplayFormatAlpha使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SDL_DisplayFormatAlpha函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: DisplayFormatAlpha

// Converts a surface to the display format with alpha
func (s *Surface) DisplayFormatAlpha() *Surface {
	s.mutex.RLock()
	p := C.SDL_DisplayFormatAlpha(s.cSurface)
	s.mutex.RUnlock()
	return wrap(p)
}
开发者ID:extrame,项目名称:Go-SDL,代码行数:7,代码来源:sdl.go

示例2: DisplayFormatAlpha

// Converts a surface to the display format with alpha
func DisplayFormatAlpha(src *Surface) *Surface {
	p := C.SDL_DisplayFormatAlpha((*C.SDL_Surface)(cast(src)))
	return (*Surface)(cast(p))
}
开发者ID:gnanderson,项目名称:Go-SDL,代码行数:5,代码来源:sdl.go

示例3: String

type imageKey struct {
	path   string
	width  int
	height int
}

func (me *imageKey) String() string {
	return me.path + strconv.Itoa(me.width) + strconv.Itoa(me.height)
}

//Resizes images from imageFiles and caches them.
var images = newFlyweight(
	func(path key) interface{} {
		key := path.(*imageKey)
		tmp := C.IMG_Load(C.CString(key.path))
		i := C.SDL_DisplayFormatAlpha(tmp)
		C.SDL_FreeSurface(tmp)
		if key.width != -1 && key.height != -1 {
			if (i != nil) && (int(i.w) != key.width || int(i.h) != key.height) {
				i = resize(i, key.width, key.height)
			}
		}
		return i
	},
	func(path key, img interface{}) {
		i := img.(*C.SDL_Surface)
		C.SDL_FreeSurface(i)
	})

type Image struct {
	img *C.SDL_Surface
开发者ID:griffy,项目名称:starfish,代码行数:31,代码来源:image.go

示例4: DisplayFormatAlpha

func (s *Surface) DisplayFormatAlpha() *Surface {
	return (*Surface)(C.SDL_DisplayFormatAlpha(s.Get()))
}
开发者ID:gasperko,项目名称:pokemon-universe,代码行数:3,代码来源:image.go

示例5: displayFormatAlpha

// This function takes a surface and copies it to a new surface of the
// pixel format and colors of the video framebuffer (if possible),
// suitable for fast alpha blitting onto the display surface.
// The new surface will always have an alpha channel.
//
// If you want to take advantage of hardware colorkey or alpha blit
// acceleration, you should set the colorkey and alpha value before
// calling this function.
//
// If the conversion fails or runs out of memory, it returns NULL
func displayFormatAlpha(surface *C.SDL_Surface) *C.SDL_Surface {
	return C.SDL_DisplayFormatAlpha(surface)
}
开发者ID:beoran,项目名称:fungo,代码行数:13,代码来源:video.go


注:本文中的C.SDL_DisplayFormatAlpha函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。