File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 88 "strings"
99 "time"
1010
11+ composition "github.com/rfwlab/rfw/v1/composition"
1112 core "github.com/rfwlab/rfw/v1/core"
1213 dom "github.com/rfwlab/rfw/v1/dom"
1314 events "github.com/rfwlab/rfw/v1/events"
@@ -47,11 +48,11 @@ var (
4748)
4849
4950// NewWebGLComponent returns a component demonstrating WebGL via a snake game.
50- func NewWebGLComponent () * core. HTMLComponent {
51- c := core .NewComponent ("WebGLComponent" , webglComponentTpl , nil )
52- dom . RegisterHandlerFunc ("webglStart" , func () { startGame () } )
53- dom . RegisterHandlerFunc ("webglFullscreen" , fullscreen )
54- return c
51+ func NewWebGLComponent () * composition. Component {
52+ cmp := composition . Wrap ( core .NewComponent ("WebGLComponent" , webglComponentTpl , nil ) )
53+ cmp . On ("webglStart" , startGame )
54+ cmp . On ("webglFullscreen" , fullscreen )
55+ return cmp
5556}
5657
5758func init () {
You can’t perform that action at this time.
0 commit comments