mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Add title
This commit is contained in:
parent
9b324a7e11
commit
239f008045
@ -60,5 +60,5 @@ func main() {
|
||||
}
|
||||
|
||||
const screenScale = 2
|
||||
glut.Run(game, screenScale)
|
||||
glut.Run(game, screenScale, "Ebiten Demo")
|
||||
}
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user