本文整理汇总了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)
}