summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2022-03-16 20:54:19 +0100
committerxengineering <me@xengineering.eu>2022-03-17 09:38:08 +0100
commit77901bb05dbf75e92dd8974ccb23053bb3b2dabf (patch)
tree386cfb941cb338d82ea607f28334705ce4c9d83e /app.go
parent8742e1207eb12091eeb061485072dcc2d70c0a52 (diff)
downloadstlscope-77901bb05dbf75e92dd8974ccb23053bb3b2dabf.tar
stlscope-77901bb05dbf75e92dd8974ccb23053bb3b2dabf.tar.zst
stlscope-77901bb05dbf75e92dd8974ccb23053bb3b2dabf.zip
Add docstrings
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()
}