mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +01:00
Add comments
This commit is contained in:
parent
81faffa76a
commit
0ff5524911
@ -74,7 +74,7 @@ func display() {
|
|||||||
|
|
||||||
//export mouse
|
//export mouse
|
||||||
func mouse(button, state, x, y C.int) {
|
func mouse(button, state, x, y C.int) {
|
||||||
event := glutInputEvent{false, -1, -1}
|
event := glutInputEvent{false, 0, 0}
|
||||||
if state == C.GLUT_DOWN {
|
if state == C.GLUT_DOWN {
|
||||||
event.IsActive = true
|
event.IsActive = true
|
||||||
event.X = int(x)
|
event.X = int(x)
|
||||||
@ -118,6 +118,7 @@ func new(screenWidth, screenHeight, screenScale int, title string) *GlutUI {
|
|||||||
}()
|
}()
|
||||||
cargc := C.int(len(cargs))
|
cargc := C.int(len(cargs))
|
||||||
|
|
||||||
|
// Initialize OpenGL
|
||||||
C.glutInit(&cargc, &cargs[0])
|
C.glutInit(&cargc, &cargs[0])
|
||||||
C.glutInitDisplayMode(C.GLUT_RGBA)
|
C.glutInitDisplayMode(C.GLUT_RGBA)
|
||||||
C.glutInitWindowSize(
|
C.glutInitWindowSize(
|
||||||
@ -128,6 +129,7 @@ func new(screenWidth, screenHeight, screenScale int, title string) *GlutUI {
|
|||||||
defer C.free(unsafe.Pointer(cTitle))
|
defer C.free(unsafe.Pointer(cTitle))
|
||||||
C.glutCreateWindow(cTitle)
|
C.glutCreateWindow(cTitle)
|
||||||
|
|
||||||
|
// Set the callbacks
|
||||||
C.setGlutFuncs()
|
C.setGlutFuncs()
|
||||||
|
|
||||||
graphicsDevice.Init()
|
graphicsDevice.Init()
|
||||||
|
Loading…
Reference in New Issue
Block a user