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

	return nil
}
Esempio 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
}
Esempio n. 3
0
func (surface *Surface) Lock() {
	C.SDL_LockSurface(surface.cptr())
}
Esempio n. 4
0
// Locks a surface for direct access.
func (screen *Surface) Lock() int {
	return int(C.SDL_LockSurface((*C.SDL_Surface)(cast(screen))))
}
Esempio n. 5
0
func (surface *Surface) Lock() {
	_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))
	C.SDL_LockSurface(_surface)
}
Esempio n. 6
0
// Locks a surface for direct access.
func (screen *Surface) Lock() int {
	status := int(C.SDL_LockSurface(screen.cSurface))
	return status
}
Esempio 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
}
Esempio 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)))
}