~eliasnaur/gio-example

3efe9b7e1c636f6617452bff2475256dd0ac3939 — Elias Naur 4 months ago 107f05c
opengl: fix build error on Windows

The pointer-ness of EGLDisplay vary by platform.

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

M opengl/main.go
M opengl/main.go => opengl/main.go +2 -1
@@ 169,7 169,8 @@ func drawUI(th *material.Theme, gtx layout.Context) layout.Dimensions {
}

func createContext(view C.EGLNativeWindowType) (*eglContext, error) {
	platformExts := strings.Split(C.GoString(C.eglQueryString(C.EGL_NO_DISPLAY, C.EGL_EXTENSIONS)), " ")
	var EGL_NO_DISPLAY C.EGLDisplay
	platformExts := strings.Split(C.GoString(C.eglQueryString(EGL_NO_DISPLAY, C.EGL_EXTENSIONS)), " ")
	platformType := C.EGLint(C.EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE)
	if hasExtension(platformExts, "EGL_ANGLE_platform_angle_metal") {
		// The Metal backend works better than the OpenGL backend.