2023-07-07 19:15:47 +02:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
// SPDX-FileCopyrightText: 2012 The glfw3-go Authors
|
|
|
|
// SPDX-FileCopyrightText: 2023 The Ebitengine Authors
|
|
|
|
|
2023-07-08 06:59:51 +02:00
|
|
|
//go:build (freebsd || linux || netbsd || openbsd) && wayland
|
2023-07-05 03:51:55 +02:00
|
|
|
|
2023-07-21 18:02:55 +02:00
|
|
|
package cglfw
|
2023-07-05 03:51:55 +02:00
|
|
|
|
|
|
|
//#include <stdlib.h>
|
|
|
|
//#define GLFW_EXPOSE_NATIVE_WAYLAND
|
|
|
|
//#define GLFW_EXPOSE_NATIVE_EGL
|
|
|
|
//#define GLFW_INCLUDE_NONE
|
2023-07-10 16:29:25 +02:00
|
|
|
//#include "glfw3.h"
|
|
|
|
//#include "glfw3native.h"
|
2023-07-05 03:51:55 +02:00
|
|
|
import "C"
|
|
|
|
|
|
|
|
func GetWaylandDisplay() *C.struct_wl_display {
|
|
|
|
ret := C.glfwGetWaylandDisplay()
|
|
|
|
panicError()
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Monitor) GetWaylandMonitor() *C.struct_wl_output {
|
|
|
|
ret := C.glfwGetWaylandMonitor(m.data)
|
|
|
|
panicError()
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *Window) GetWaylandWindow() *C.struct_wl_surface {
|
|
|
|
ret := C.glfwGetWaylandWindow(w.data)
|
|
|
|
panicError()
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetEGLDisplay() C.EGLDisplay {
|
|
|
|
ret := C.glfwGetEGLDisplay()
|
|
|
|
panicError()
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *Window) GetEGLContext() C.EGLContext {
|
|
|
|
ret := C.glfwGetEGLContext(w.data)
|
|
|
|
panicError()
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *Window) GetEGLSurface() C.EGLSurface {
|
|
|
|
ret := C.glfwGetEGLSurface(w.data)
|
|
|
|
panicError()
|
|
|
|
return ret
|
|
|
|
}
|