From 77901bb05dbf75e92dd8974ccb23053bb3b2dabf Mon Sep 17 00:00:00 2001 From: xengineering Date: Wed, 16 Mar 2022 20:54:19 +0100 Subject: Add docstrings --- app.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app.go') 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() } -- cgit v1.2.3-70-g09d2