Add title

This commit is contained in:
Hajime Hoshi 2013-07-07 01:45:19 +09:00
parent 9b324a7e11
commit 239f008045
2 changed files with 7 additions and 7 deletions

View File

@ -60,5 +60,5 @@ func main() {
}
const screenScale = 2
glut.Run(game, screenScale)
glut.Run(game, screenScale, "Ebiten Demo")
}

View File

@ -96,7 +96,7 @@ func idle() {
C.glutPostRedisplay()
}
func new(screenWidth, screenHeight, screenScale int) *GlutUI {
func new(screenWidth, screenHeight, screenScale int, title string) *GlutUI {
ui := &GlutUI{
glutInputting: make(chan glutInputEvent, 10),
updating: make(chan chan func()),
@ -119,20 +119,20 @@ func new(screenWidth, screenHeight, screenScale int) *GlutUI {
C.int(screenWidth*screenScale),
C.int(screenHeight*screenScale))
title := C.CString("Ebiten Demo")
defer C.free(unsafe.Pointer(title))
C.glutCreateWindow(title)
cTitle := C.CString(title)
defer C.free(unsafe.Pointer(cTitle))
C.glutCreateWindow(cTitle)
C.setGlutFuncs()
return ui
}
func Run(game ebiten.Game, screenScale int) {
func Run(game ebiten.Game, screenScale int, title string) {
screenWidth := game.ScreenWidth()
screenHeight := game.ScreenHeight()
ui := new(screenWidth, screenHeight, screenScale)
ui := new(screenWidth, screenHeight, screenScale, title)
currentUI = ui
graphicsDevice := opengl.NewDevice(