Golang C.SDL_LockSurface类(方法)实例源码

下面列出了Golang C.SDL_LockSurface 类(方法)源码代码实例,从而了解它的用法。

作者:willemvd    项目:sd   
func (s *Surface) Lock() error {
	if C.SDL_LockSurface(s.c()) != 0 {
		return getError()
	}

	return nil
}

作者:kearsle    项目:Go-SD   
// Locks a surface for direct access.
func (screen *Surface) Lock() int {
	screen.mutex.Lock()
	status := int(C.SDL_LockSurface(screen.cSurface))
	screen.mutex.Unlock()
	return status
}

作者:JalfRes    项目:go-sdl   
func (surface *Surface) Lock() {
	C.SDL_LockSurface(surface.cptr())
}

作者:gnanderso    项目:Go-SD   
// Locks a surface for direct access.
func (screen *Surface) Lock() int {
	return int(C.SDL_LockSurface((*C.SDL_Surface)(cast(screen))))
}

作者:kyleconro    项目:gold   
func (surface *Surface) Lock() {
	_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))
	C.SDL_LockSurface(_surface)
}

作者:jbondeso    项目:Go-SDL   
// Locks a surface for direct access.
func (screen *Surface) Lock() int {
	status := int(C.SDL_LockSurface(screen.cSurface))
	return status
}

作者:emla    项目:go-sdl   
// Surface (https://wiki.libsdl.org/SDL_LockSurface)
func (surface *Surface) Lock() error {
	if C.SDL_LockSurface(surface.cptr()) != 0 {
		return GetError()
	}
	return nil
}

作者:beora    项目:fung   
//
// SDL_LockSurface() sets up a surface for directly accessing the pixels.
// Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
// to and read from 'surface->pixels', using the pixel format stored in
// 'surface->format'.  Once you are done accessing the surface, you should
// use SDL_UnlockSurface() to release it.
//
// Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
// to 0, then you can read and write to the surface at any time, and the
// pixel format of the surface will not change.  In particular, if the
// SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
// will not need to lock the display surface before accessing it.
//
// No operating system or library calls should be made between lock/unlock
// pairs, as critical system locks may be held during this time.
//
// SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
func lockSurface(surface *C.SDL_Surface) int {
	return (int(C.SDL_LockSurface(surface)))
}


问题


面经


文章

微信
公众号

扫码关注公众号