コード例 #1
0
ファイル: video.go プロジェクト: flazz/go-sdl2
// Window (https://wiki.libsdl.org/SDL_GetWindowSurface)
func (window *Window) GetSurface() (*Surface, error) {
	surface := (*Surface)(unsafe.Pointer(C.SDL_GetWindowSurface(window.cptr())))
	if surface == nil {
		return nil, GetError()
	}
	return surface, nil
}
コード例 #2
0
ファイル: video.go プロジェクト: DeedleFake/sdl
func (win *Window) GetSurface() (*Surface, error) {
	s := C.SDL_GetWindowSurface(win.c)
	if s == nil {
		return nil, getError()
	}

	return (*Surface)(unsafe.Pointer(s)), nil
}
コード例 #3
0
ファイル: video.go プロジェクト: salihdb/sdl
// Surface returns the surface associated with the window.
func (win *Window) Surface() (surface *Surface, err error) {
	surface = new(Surface)
	surface.cSurface = C.SDL_GetWindowSurface(win.cWin)
	if surface.cSurface == nil {
		return nil, getError()
	}
	return surface, nil
}
コード例 #4
0
ファイル: video.go プロジェクト: krig/Go-SDL2
func (w *Window) GetSurface() *Surface {
	return wrapSurface(C.SDL_GetWindowSurface(w.cWindow))
}
コード例 #5
0
ファイル: sdl_video.go プロジェクト: TomMurray/go-sdl2
func (window *Window) GetSurface() *Surface {
	_window := (*C.SDL_Window)(unsafe.Pointer(window))
	return (*Surface)(unsafe.Pointer(C.SDL_GetWindowSurface(_window)))
}
コード例 #6
0
ファイル: video.go プロジェクト: JalfResi/go-sdl2
func (window *Window) GetSurface() *Surface {
	return (*Surface)(unsafe.Pointer(C.SDL_GetWindowSurface(window.cptr())))
}