native_linbsd_wayland.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //go:build (linux && wayland) || (freebsd && wayland) || (netbsd && wayland) || (openbsd && wayland)
  2. // +build linux,wayland freebsd,wayland netbsd,wayland openbsd,wayland
  3. package glfw
  4. //#include <stdlib.h>
  5. //#define GLFW_EXPOSE_NATIVE_WAYLAND
  6. //#define GLFW_EXPOSE_NATIVE_EGL
  7. //#define GLFW_INCLUDE_NONE
  8. //#include "glfw/include/GLFW/glfw3.h"
  9. //#include "glfw/include/GLFW/glfw3native.h"
  10. import "C"
  11. func GetWaylandDisplay() *C.struct_wl_display {
  12. ret := C.glfwGetWaylandDisplay()
  13. panicError()
  14. return ret
  15. }
  16. func (m *Monitor) GetWaylandMonitor() *C.struct_wl_output {
  17. ret := C.glfwGetWaylandMonitor(m.data)
  18. panicError()
  19. return ret
  20. }
  21. func (w *Window) GetWaylandWindow() *C.struct_wl_surface {
  22. ret := C.glfwGetWaylandWindow(w.data)
  23. panicError()
  24. return ret
  25. }
  26. func GetEGLDisplay() C.EGLDisplay {
  27. ret := C.glfwGetEGLDisplay()
  28. panicError()
  29. return ret
  30. }
  31. func (w *Window) GetEGLContext() C.EGLContext {
  32. ret := C.glfwGetEGLContext(w.data)
  33. panicError()
  34. return ret
  35. }
  36. func (w *Window) GetEGLSurface() C.EGLSurface {
  37. ret := C.glfwGetEGLSurface(w.data)
  38. panicError()
  39. return ret
  40. }