Skip to content

Commit

Permalink
support EGL+Open GLES2 (ANGLE) on macOS (#114)
Browse files Browse the repository at this point in the history
Default still uses desktop OpenGL

Co-authored-by: Zhao Wang <[email protected]>
  • Loading branch information
zwang and zwang authored Mar 9, 2021
1 parent b197509 commit 23581b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tmpl/package.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ package {{.Name}}
{{define "paramsGoDecl"}}{{range $i, $p := .}}{{if ne $i 0}}, {{end}}{{$p.GoName}} {{$p.Type.GoType}}{{end}}{{end}}
{{define "paramsGoCall"}}{{range $i, $p := .}}{{if ne $i 0}}, {{end}}{{$p.Type.ConvertGoToC $p.GoName}}{{end}}{{end}}

// #cgo darwin LDFLAGS: -framework OpenGL
// #cgo !gles2,darwin LDFLAGS: -framework OpenGL
// #cgo gles2,darwin LDFLAGS: -lGLESv2
// #cgo !gles2,windows LDFLAGS: -lopengl32
// #cgo gles2,windows LDFLAGS: -lGLESv2
//
Expand Down
4 changes: 3 additions & 1 deletion tmpl/procaddr.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ package {{.Name}}
#cgo gles2,windows LDFLAGS: -lGLESv2

#cgo darwin CFLAGS: -DTAG_DARWIN
#cgo darwin LDFLAGS: -framework OpenGL
#cgo !gles2,darwin LDFLAGS: -framework OpenGL
#cgo gles2,darwin LDFLAGS: -lGLESv2

#cgo linux freebsd openbsd CFLAGS: -DTAG_POSIX
#cgo !egl,linux !egl,freebsd !egl,openbsd pkg-config: gl

#cgo egl,linux egl,freebsd egl,openbsd egl,windows CFLAGS: -DTAG_EGL
#cgo egl,linux egl,freebsd egl,openbsd pkg-config: egl
#cgo egl,windows LDFLAGS: -lEGL
#cgo egl,darwin LDFLAGS: -lEGL


// Check the EGL tag first as it takes priority over the platform's default
Expand Down

0 comments on commit 23581b0

Please sign in to comment.