コード例 #1
0
ファイル: video.go プロジェクト: rsaarelm/teratogen
func NewSurface(w, h int) (s *Surface) {
	mutex.Lock()
	defer mutex.Unlock()

	video := C.SDL_GetVideoSurface()
	ptr := C.SDL_CreateRGBSurface(
		0, C.int(w), C.int(h), C.int(video.format.BitsPerPixel),
		video.format.Rmask,
		video.format.Gmask,
		video.format.Bmask,
		video.format.Amask)
	s = &Surface{ptr}
	runtime.SetFinalizer(s, func(s *Surface) { C.SDL_FreeSurface(s.ptr) })
	return
}
コード例 #2
0
ファイル: video.go プロジェクト: badgerodon/go
func GetVideoSurface() Surface {
	ptr := C.SDL_GetVideoSurface()
	return Surface{unsafe.Pointer(ptr)}
}
コード例 #3
0
ファイル: sdl.go プロジェクト: gnanderson/Go-SDL
// Returns a pointer to the current display surface.
func GetVideoSurface() *Surface { return (*Surface)(cast(C.SDL_GetVideoSurface())) }
コード例 #4
0
ファイル: video.go プロジェクト: rsaarelm/teratogen
// Flip swaps screen buffers with a double-buffered display mode. Use it to
// make the changes you made to the screen become visible.
func Flip() {
	mutex.Lock()
	defer mutex.Unlock()

	C.SDL_Flip(C.SDL_GetVideoSurface())
}
コード例 #5
0
ファイル: video.go プロジェクト: rsaarelm/teratogen
// Video returns the surface for the base SDL window.
func Video() *Surface {
	return &Surface{C.SDL_GetVideoSurface()}
}
コード例 #6
0
ファイル: video.go プロジェクト: beoran/fungo
// This function returns a pointer to the current display surface.
// If SDL is doing format conversion on the display surface, this
// function returns the publicly visible surface, not the real video
// surface.
func getVideoSurface() *C.SDL_Surface {
	return C.SDL_GetVideoSurface()
}