native_windows.go 904 B

123456789101112131415161718192021222324252627282930313233343536
  1. package glfw
  2. //#define GLFW_EXPOSE_NATIVE_WIN32
  3. //#define GLFW_EXPOSE_NATIVE_WGL
  4. //#define GLFW_INCLUDE_NONE
  5. //#include "glfw/include/GLFW/glfw3.h"
  6. //#include "glfw/include/GLFW/glfw3native.h"
  7. import "C"
  8. // GetWin32Adapter returns the adapter device name of the monitor.
  9. func (m *Monitor) GetWin32Adapter() string {
  10. ret := C.glfwGetWin32Adapter(m.data)
  11. panicError()
  12. return C.GoString(ret)
  13. }
  14. // GetWin32Monitor returns the display device name of the monitor.
  15. func (m *Monitor) GetWin32Monitor() string {
  16. ret := C.glfwGetWin32Monitor(m.data)
  17. panicError()
  18. return C.GoString(ret)
  19. }
  20. // GetWin32Window returns the HWND of the window.
  21. func (w *Window) GetWin32Window() C.HWND {
  22. ret := C.glfwGetWin32Window(w.data)
  23. panicError()
  24. return ret
  25. }
  26. // GetWGLContext returns the HGLRC of the window.
  27. func (w *Window) GetWGLContext() C.HGLRC {
  28. ret := C.glfwGetWGLContext(w.data)
  29. panicError()
  30. return ret
  31. }