Exemplo n.º 1
0
func (s *Surface) Lock() error {
	if C.SDL_LockSurface(s.c()) != 0 {
		return getError()
	}

	return nil
}
Exemplo n.º 2
0
// 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
}
Exemplo n.º 3
0
func (surface *Surface) Lock() {
	C.SDL_LockSurface(surface.cptr())
}
Exemplo n.º 4
0
// Locks a surface for direct access.
func (screen *Surface) Lock() int {
	return int(C.SDL_LockSurface((*C.SDL_Surface)(cast(screen))))
}
Exemplo n.º 5
0
func (surface *Surface) Lock() {
	_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))
	C.SDL_LockSurface(_surface)
}
Exemplo n.º 6
0
// Locks a surface for direct access.
func (screen *Surface) Lock() int {
	status := int(C.SDL_LockSurface(screen.cSurface))
	return status
}
Exemplo n.º 7
0
// Surface (https://wiki.libsdl.org/SDL_LockSurface)
func (surface *Surface) Lock() error {
	if C.SDL_LockSurface(surface.cptr()) != 0 {
		return GetError()
	}
	return nil
}
Exemplo n.º 8
0
//
// 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)))
}