mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +01:00
Add title
This commit is contained in:
parent
9b324a7e11
commit
239f008045
@ -60,5 +60,5 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const screenScale = 2
|
const screenScale = 2
|
||||||
glut.Run(game, screenScale)
|
glut.Run(game, screenScale, "Ebiten Demo")
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ func idle() {
|
|||||||
C.glutPostRedisplay()
|
C.glutPostRedisplay()
|
||||||
}
|
}
|
||||||
|
|
||||||
func new(screenWidth, screenHeight, screenScale int) *GlutUI {
|
func new(screenWidth, screenHeight, screenScale int, title string) *GlutUI {
|
||||||
ui := &GlutUI{
|
ui := &GlutUI{
|
||||||
glutInputting: make(chan glutInputEvent, 10),
|
glutInputting: make(chan glutInputEvent, 10),
|
||||||
updating: make(chan chan func()),
|
updating: make(chan chan func()),
|
||||||
@ -119,20 +119,20 @@ func new(screenWidth, screenHeight, screenScale int) *GlutUI {
|
|||||||
C.int(screenWidth*screenScale),
|
C.int(screenWidth*screenScale),
|
||||||
C.int(screenHeight*screenScale))
|
C.int(screenHeight*screenScale))
|
||||||
|
|
||||||
title := C.CString("Ebiten Demo")
|
cTitle := C.CString(title)
|
||||||
defer C.free(unsafe.Pointer(title))
|
defer C.free(unsafe.Pointer(cTitle))
|
||||||
C.glutCreateWindow(title)
|
C.glutCreateWindow(cTitle)
|
||||||
|
|
||||||
C.setGlutFuncs()
|
C.setGlutFuncs()
|
||||||
|
|
||||||
return ui
|
return ui
|
||||||
}
|
}
|
||||||
|
|
||||||
func Run(game ebiten.Game, screenScale int) {
|
func Run(game ebiten.Game, screenScale int, title string) {
|
||||||
screenWidth := game.ScreenWidth()
|
screenWidth := game.ScreenWidth()
|
||||||
screenHeight := game.ScreenHeight()
|
screenHeight := game.ScreenHeight()
|
||||||
|
|
||||||
ui := new(screenWidth, screenHeight, screenScale)
|
ui := new(screenWidth, screenHeight, screenScale, title)
|
||||||
currentUI = ui
|
currentUI = ui
|
||||||
|
|
||||||
graphicsDevice := opengl.NewDevice(
|
graphicsDevice := opengl.NewDevice(
|
||||||
|
Loading…
Reference in New Issue
Block a user