本文整理匯總了Golang中C.SDL_WM_SetCaption函數的典型用法代碼示例。如果您正苦於以下問題:Golang SDL_WM_SetCaption函數的具體用法?Golang SDL_WM_SetCaption怎麽用?Golang SDL_WM_SetCaption使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了SDL_WM_SetCaption函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: WM_SetCaption
// Sets the window title and icon name.
func WM_SetCaption(title, icon string) {
ctitle := C.CString(title)
cicon := C.CString(icon)
C.SDL_WM_SetCaption(ctitle, cicon)
C.free(unsafe.Pointer(ctitle))
C.free(unsafe.Pointer(cicon))
}
示例2: WM_SetCaption
// Sets the window title and icon name.
func WM_SetCaption(title, icon string) {
ctitle := C.CString(title)
cicon := C.CString(icon)
GlobalMutex.Lock()
C.SDL_WM_SetCaption(ctitle, cicon)
GlobalMutex.Unlock()
C.free(unsafe.Pointer(ctitle))
C.free(unsafe.Pointer(cicon))
}
示例3: NewDisplay
func NewDisplay(title string, width, height int) (*Display, error) {
d := Display{frame: make(chan *C.AVFrame)}
d.width = C.int(width)
d.height = C.int(height)
d.screen = C.SDL_SetVideoMode(d.width, d.height, 0, 0)
d.overlay = C.SDL_CreateYUVOverlay(d.width, d.height, C.SDL_IYUV_OVERLAY, d.screen)
t := C.CString(title)
C.SDL_WM_SetCaption(t, (*C.char)(null))
C.free(unsafe.Pointer(t))
return &d, nil
}
示例4: OpenDisplay
//Opens a window.
//Returns an indicator of success.
func OpenDisplay(width, height int, fullscreen bool) bool {
if C.SDL_Init(C.SDL_INIT_VIDEO) != 0 {
return false
}
C.TTF_Init()
var flags C.Uint32 = C.SDL_DOUBLEBUF
flags |= C.SDL_SWSURFACE
flags |= C.SDL_HWACCEL
if fullscreen {
screen = C.openDisplayFullscreen(C.int(width), C.int(height))
} else {
screen = C.openDisplay(C.int(width), C.int(height))
}
if screen == nil {
return false
}
C.SDL_WM_SetCaption(C.CString(displayTitle), C.CString(""))
C.SDL_GL_SetAttribute(C.SDL_GL_SWAP_CONTROL, 1)
return true
}
示例5: SetDisplayTitle
//Sets the title of the window.
func SetDisplayTitle(title string) {
displayTitle = title
if screen != nil {
C.SDL_WM_SetCaption(C.CString(displayTitle), C.CString(""))
}
}
示例6: WM_SetCaption
//
// Sets/Gets the title and icon text of the display window (UTF-8 encoded)
func WM_SetCaption(title, icon string) {
ctitle := cstr(title)
cicon := cstr(icon)
C.SDL_WM_SetCaption(ctitle, cicon)
}