diff options
author | xengineering <me@xengineering.eu> | 2022-03-16 20:54:19 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2022-03-17 09:38:08 +0100 |
commit | 77901bb05dbf75e92dd8974ccb23053bb3b2dabf (patch) | |
tree | 386cfb941cb338d82ea607f28334705ce4c9d83e /app.go | |
parent | 8742e1207eb12091eeb061485072dcc2d70c0a52 (diff) | |
download | stlscope-77901bb05dbf75e92dd8974ccb23053bb3b2dabf.tar stlscope-77901bb05dbf75e92dd8974ccb23053bb3b2dabf.tar.zst stlscope-77901bb05dbf75e92dd8974ccb23053bb3b2dabf.zip |
Add docstrings
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() } |