예제 #1
0
파일: video.go 프로젝트: krig/Go-SDL2
func (w *Window) ShowSimpleMessageBox(flags uint32, title, message string) {
	ctitle, cmessage := C.CString(title), C.CString(message)
	C.SDL_ShowSimpleMessageBox(C.Uint32(flags), ctitle, cmessage, w.cWindow)

	C.free(unsafe.Pointer(ctitle))
	C.free(unsafe.Pointer(cmessage))
}
예제 #2
0
파일: video.go 프로젝트: flazz/go-sdl2
// ShowSimpleMessageBox (https://wiki.libsdl.org/SDL_ShowSimpleMessageBox)
func ShowSimpleMessageBox(flags uint32, title, message string, window *Window) error {
	_title := C.CString(title)
	defer C.free(unsafe.Pointer(_title))
	_message := C.CString(message)
	defer C.free(unsafe.Pointer(_message))
	if (int)(C.SDL_ShowSimpleMessageBox(C.Uint32(flags), _title, _message, window.cptr())) < 0 {
		return GetError()
	}
	return nil
}
예제 #3
0
파일: sdl.go 프로젝트: kalaspuffar/Go-SDL2
func (w *Window) ShowSimpleMessageBox(flags uint32, title, message string) {
	GlobalMutex.Lock()
	defer GlobalMutex.Unlock()

	ctitle, cmessage := C.CString(title), C.CString(message)
	C.SDL_ShowSimpleMessageBox(C.Uint32(flags), ctitle, cmessage, w.cWindow)

	C.free(unsafe.Pointer(ctitle))
	C.free(unsafe.Pointer(cmessage))
}