summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'app.go')
-rw-r--r--app.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/app.go b/app.go
index b124f4c..458e9af 100644
--- a/app.go
+++ b/app.go
@@ -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()
}