summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2021-05-25 11:07:46 +0200
committerxengineering <mail2xengineering@protonmail.com>2021-05-25 11:07:46 +0200
commitd6828f4039352a44a1389313ba856369932732e4 (patch)
tree63e8db9146555479cfc8f233f72a49d6fec92ab4 /app.go
parentaad26e524922d144fd4ed023dc0d60fadb62f253 (diff)
downloadstlscope-d6828f4039352a44a1389313ba856369932732e4.tar
stlscope-d6828f4039352a44a1389313ba856369932732e4.tar.zst
stlscope-d6828f4039352a44a1389313ba856369932732e4.zip
Split Graphics and App Functionality
Diffstat (limited to 'app.go')
-rw-r--r--app.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/app.go b/app.go
index 603f47d..119e17d 100644
--- a/app.go
+++ b/app.go
@@ -6,6 +6,7 @@ import (
"log"
"github.com/go-gl/glfw/v3.3/glfw"
+ "github.com/go-gl/mathgl/mgl32"
)
const (
@@ -16,6 +17,7 @@ const (
type App struct {
window *glfw.Window
+ graphics *Graphics
}
func newApp() App {
@@ -45,9 +47,13 @@ func newApp() App {
return app
}
-func (application App) handle() {
+func (application *App) handle() {
glfw.PollEvents()
application.window.SwapBuffers()
+ trafo := mgl32.HomogRotate3D(float32(glfw.GetTime()) * 3, mgl32.Vec3{0, 1, 1})
+ var scale float32 = 0.01
+ trafo = trafo.Mul4(mgl32.Scale3D(scale, scale, scale))
+ application.graphics.setTrafo(trafo)
}
func (application App) terminate() {