InitWindow title is string

This commit is contained in:
Milan Nikolic 2018-05-06 12:59:22 +02:00
parent 438d1cfad7
commit 680e87e395
3 changed files with 15 additions and 23 deletions

View file

@ -14,16 +14,14 @@ import (
)
// 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)
cheight := (C.int)(height)
title, ok := t.(string)
if ok {
ctitle := C.CString(title)
defer C.free(unsafe.Pointer(ctitle))
C.InitWindow(cwidth, cheight, ctitle)
}
ctitle := C.CString(title)
defer C.free(unsafe.Pointer(ctitle))
C.InitWindow(cwidth, cheight, ctitle)
}
// SetCallbackFunc - Sets callback function