InitWindow title is string
This commit is contained in:
parent
438d1cfad7
commit
680e87e395
3 changed files with 15 additions and 23 deletions
|
@ -23,18 +23,15 @@ import (
|
||||||
var callbackHolder func()
|
var callbackHolder func()
|
||||||
|
|
||||||
// InitWindow - Initialize Window and OpenGL Graphics
|
// InitWindow - Initialize Window and OpenGL Graphics
|
||||||
func InitWindow(width int32, height int32, t interface{}) {
|
func InitWindow(width int32, height int32, title string) {
|
||||||
cwidth := (C.int)(width)
|
cwidth := (C.int)(width)
|
||||||
cheight := (C.int)(height)
|
cheight := (C.int)(height)
|
||||||
|
|
||||||
title, ok := t.(string)
|
|
||||||
if ok {
|
|
||||||
ctitle := C.CString(title)
|
ctitle := C.CString(title)
|
||||||
defer C.free(unsafe.Pointer(ctitle))
|
defer C.free(unsafe.Pointer(ctitle))
|
||||||
|
|
||||||
C.InitWindow(cwidth, cheight, ctitle)
|
C.InitWindow(cwidth, cheight, ctitle)
|
||||||
C.android_init()
|
C.android_init()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCallbackFunc - Sets callback function
|
// SetCallbackFunc - Sets callback function
|
||||||
|
|
|
@ -14,17 +14,14 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// InitWindow - Initialize Window and OpenGL Graphics
|
// InitWindow - Initialize Window and OpenGL Graphics
|
||||||
func InitWindow(width int32, height int32, t interface{}) {
|
func InitWindow(width int32, height int32, title string) {
|
||||||
cwidth := (C.int)(width)
|
cwidth := (C.int)(width)
|
||||||
cheight := (C.int)(height)
|
cheight := (C.int)(height)
|
||||||
|
|
||||||
title, ok := t.(string)
|
|
||||||
if ok {
|
|
||||||
ctitle := C.CString(title)
|
ctitle := C.CString(title)
|
||||||
cptitle := unsafe.Pointer(ctitle)
|
defer C.free(unsafe.Pointer(ctitle))
|
||||||
defer C.free(cptitle)
|
|
||||||
C.InitWindow(cwidth, cheight, cptitle)
|
C.InitWindow(cwidth, cheight, ctitle)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCallbackFunc - Sets callback function
|
// SetCallbackFunc - Sets callback function
|
||||||
|
|
|
@ -14,16 +14,14 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// InitWindow - Initialize Window and OpenGL Graphics
|
// InitWindow - Initialize Window and OpenGL Graphics
|
||||||
func InitWindow(width int32, height int32, t interface{}) {
|
func InitWindow(width int32, height int32, title string) {
|
||||||
cwidth := (C.int)(width)
|
cwidth := (C.int)(width)
|
||||||
cheight := (C.int)(height)
|
cheight := (C.int)(height)
|
||||||
|
|
||||||
title, ok := t.(string)
|
|
||||||
if ok {
|
|
||||||
ctitle := C.CString(title)
|
ctitle := C.CString(title)
|
||||||
defer C.free(unsafe.Pointer(ctitle))
|
defer C.free(unsafe.Pointer(ctitle))
|
||||||
|
|
||||||
C.InitWindow(cwidth, cheight, ctitle)
|
C.InitWindow(cwidth, cheight, ctitle)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCallbackFunc - Sets callback function
|
// SetCallbackFunc - Sets callback function
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue