diff options
Diffstat (limited to 'app.go')
-rw-r--r-- | app.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -15,6 +15,8 @@ const ( WINDOW_TITLE = "stlscope" ) +// App contains data about the OpenGL application including for example the +// window, OpenGL graphics and the current STL model. type App struct { window *glfw.Window graphics *Graphics @@ -22,6 +24,7 @@ type App struct { homeTrafo mgl32.Mat4 } +// newApp creates a new App struct based on a given STL model. func newApp(stl *StlModel) App { var app App = App{} @@ -53,6 +56,7 @@ func newApp(stl *StlModel) App { return app } +// handle has to be called frequently to let the App work. func (application *App) handle() { glfw.PollEvents() application.window.SwapBuffers() @@ -65,6 +69,7 @@ func (application *App) handle() { application.graphics.setTrafo(trafo) } +// terminate closes the App. func (application App) terminate() { glfw.Terminate() } |