~eliasnaur/gio-example

06a5fa700d9355c5826c80054ce42e80175e204f — Elias Naur 2 months ago a7bf96f
glfw: select OpenGL 3.3 core profile

Otherwise, macOS will give us an old 2.1 compatible profile.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 8 insertions(+), 0 deletions(-)

M glfw/main.go
M glfw/main.go => glfw/main.go +8 -0
@@ 53,6 53,10 @@ func main() {
	defer glfw.Terminate()
	// Gio assumes a sRGB backbuffer.
	glfw.WindowHint(glfw.SRGBCapable, glfw.True)
	glfw.WindowHint(glfw.ContextVersionMajor, 3)
	glfw.WindowHint(glfw.ContextVersionMinor, 3)
	glfw.WindowHint(glfw.OpenGLProfile, glfw.OpenGLCoreProfile)
	glfw.WindowHint(glfw.OpenGLForwardCompatible, glfw.True)

	window, err := glfw.CreateWindow(800, 600, "Gio + GLFW", nil, nil)
	if err != nil {


@@ 66,6 70,10 @@ func main() {
	}
	// Enable sRGB.
	gl.Enable(gl.FRAMEBUFFER_SRGB)
	// Set up default VBA, required for the forward-compatible core profile.
	var defVBA uint32
	gl.GenVertexArrays(1, &defVBA)
	gl.BindVertexArray(defVBA)

	var queue router.Router
	var ops op.Ops