glfw.go 1.1 KB

123456789101112131415161718192021222324252627
  1. // Package glfw experimentally provides a glfw-like API
  2. // with desktop (via glfw) and browser (via HTML5 canvas) backends.
  3. //
  4. // It is used for creating a GL context and receiving events.
  5. //
  6. // Note: This package is currently in development. The API is incomplete and may change.
  7. package glfw
  8. // ContextWatcher is a general mechanism for being notified when context is made current or detached.
  9. type ContextWatcher interface {
  10. // OnMakeCurrent is called after a context is made current.
  11. // context is is a platform-specific representation of the context, or nil if unavailable.
  12. OnMakeCurrent(context interface{})
  13. // OnDetach is called after the current context is detached.
  14. OnDetach()
  15. }
  16. // VidMode describes a single video mode.
  17. type VidMode struct {
  18. Width int // The width, in pixels, of the video mode.
  19. Height int // The height, in pixels, of the video mode.
  20. RedBits int // The bit depth of the red channel of the video mode.
  21. GreenBits int // The bit depth of the green channel of the video mode.
  22. BlueBits int // The bit depth of the blue channel of the video mode.
  23. RefreshRate int // The refresh rate, in Hz, of the video mode.
  24. }