From b141bcbd50ba3c4024e2c272815def50eea8978b Mon Sep 17 00:00:00 2001
From: faiface <faiface@ksp.sk>
Date: Thu, 26 Jan 2017 03:33:48 +0100
Subject: [PATCH] this should've been with prev commit

---
 run.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/run.go b/run.go
index 6b4a3f5..bf46261 100644
--- a/run.go
+++ b/run.go
@@ -3,6 +3,7 @@ package pixel
 import (
 	"github.com/faiface/mainthread"
 	"github.com/go-gl/glfw/v3.2/glfw"
+	"github.com/pkg/errors"
 )
 
 // Run is essentialy the "main" function of Pixel. It exists mainly due to the technical
@@ -27,6 +28,10 @@ import (
 // concurrently.  The only condition is that the Run function is be called from your main
 // function.
 func Run(run func()) {
+	err := glfw.Init()
+	if err != nil {
+		panic(errors.Wrap(err, "failed to initialize GLFW"))
+	}
 	defer glfw.Terminate()
 	mainthread.Run(run)
 }
-- 
GitLab