gl: add OpenBSD support

This is the same as https://go-review.googlesource.com/c/exp/+/79917, but applied to the mobile project.

Change-Id: I77c7455317aaf09da8fbeaf943c14a2dab9da735
Reviewed-on: https://go-review.googlesource.com/79896
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/gl/gendebug.go b/gl/gendebug.go
index 6d0d6b0..b82d7b8 100644
--- a/gl/gendebug.go
+++ b/gl/gendebug.go
@@ -884,7 +884,7 @@
 // Generated from gl.go using go generate. DO NOT EDIT.
 // See doc.go for details.
 
-// +build linux darwin windows
+// +build linux darwin windows openbsd
 // +build gldebug
 
 package gl
diff --git a/gl/gl.go b/gl/gl.go
index 9d249cc..75c7fda 100644
--- a/gl/gl.go
+++ b/gl/gl.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build linux darwin windows
+// +build linux darwin windows openbsd
 // +build !gldebug
 
 package gl
diff --git a/gl/types_debug.go b/gl/types_debug.go
index 35dea87..7e34377 100644
--- a/gl/types_debug.go
+++ b/gl/types_debug.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build linux darwin windows
+// +build linux darwin windows openbsd
 // +build gldebug
 
 package gl
diff --git a/gl/types_prod.go b/gl/types_prod.go
index 7fff27f..716116e 100644
--- a/gl/types_prod.go
+++ b/gl/types_prod.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build linux darwin windows
+// +build linux darwin windows openbsd
 // +build !gldebug
 
 package gl
diff --git a/gl/work.c b/gl/work.c
index 235647f..7203acf 100644
--- a/gl/work.c
+++ b/gl/work.c
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build darwin linux
+// +build darwin linux openbsd
 
 #include <stdlib.h>
 #include "_cgo_export.h"
diff --git a/gl/work.go b/gl/work.go
index 574b03b..470f57e 100644
--- a/gl/work.go
+++ b/gl/work.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build darwin linux
+// +build darwin linux openbsd openbsd
 
 package gl
 
@@ -12,6 +12,7 @@
 #cgo darwin,arm         LDFLAGS: -framework OpenGLES
 #cgo darwin,arm64       LDFLAGS: -framework OpenGLES
 #cgo linux              LDFLAGS: -lGLESv2
+#cgo openbsd            LDFLAGS: -L/usr/X11R6/lib/ -lGLESv2
 
 #cgo android            CFLAGS: -Dos_android
 #cgo ios                CFLAGS: -Dos_ios
@@ -19,6 +20,9 @@
 #cgo darwin,arm         CFLAGS: -Dos_ios
 #cgo darwin,arm64       CFLAGS: -Dos_ios
 #cgo linux              CFLAGS: -Dos_linux
+#cgo openbsd            CFLAGS: -Dos_openbsd
+
+#cgo openbsd            CFLAGS: -I/usr/X11R6/include/
 
 #include <stdint.h>
 #include "work.h"
diff --git a/gl/work.h b/gl/work.h
index 6403574..cc2e48c 100644
--- a/gl/work.h
+++ b/gl/work.h
@@ -10,6 +10,8 @@
 #include <GLES2/gl2.h>
 #elif os_linux
 #include <GLES3/gl3.h> // install on Ubuntu with: sudo apt-get install libegl1-mesa-dev libgles2-mesa-dev libx11-dev
+#elif os_openbsd
+#include <GLES3/gl3.h>
 #endif
 
 #ifdef os_ios