hint_glfw.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //go:build !wasm
  2. package glfw
  3. import "github.com/go-gl/glfw/v3.3/glfw"
  4. type Hint int
  5. const (
  6. AlphaBits = Hint(glfw.AlphaBits)
  7. DepthBits = Hint(glfw.DepthBits)
  8. StencilBits = Hint(glfw.StencilBits)
  9. Samples = Hint(glfw.Samples)
  10. Focused = Hint(glfw.Focused)
  11. Iconified = Hint(glfw.Iconified)
  12. Maximized = Hint(glfw.Maximized)
  13. Visible = Hint(glfw.Visible)
  14. Hovered = Hint(glfw.Hovered)
  15. Resizable = Hint(glfw.Resizable)
  16. Decorated = Hint(glfw.Decorated)
  17. Floating = Hint(glfw.Floating)
  18. AutoIconify = Hint(glfw.AutoIconify)
  19. CenterCursor = Hint(glfw.CenterCursor)
  20. TransparentFramebuffer = Hint(glfw.TransparentFramebuffer)
  21. FocusOnShow = Hint(glfw.FocusOnShow)
  22. ScaleToMonitor = Hint(glfw.ScaleToMonitor)
  23. ClientAPI = Hint(glfw.ClientAPI)
  24. ContextVersionMajor = Hint(glfw.ContextVersionMajor)
  25. ContextVersionMinor = Hint(glfw.ContextVersionMinor)
  26. ContextRobustness = Hint(glfw.ContextRobustness)
  27. ContextReleaseBehavior = Hint(glfw.ContextReleaseBehavior)
  28. OpenGLForwardCompatible = Hint(glfw.OpenGLForwardCompatible)
  29. OpenGLDebugContext = Hint(glfw.OpenGLDebugContext)
  30. OpenGLProfile = Hint(glfw.OpenGLProfile)
  31. // These hints used for WebGL contexts, ignored on desktop.
  32. PremultipliedAlpha = noopHint
  33. PreserveDrawingBuffer
  34. PreferLowPowerToHighPerformance
  35. FailIfMajorPerformanceCaveat
  36. )
  37. // noopHint is ignored.
  38. const noopHint Hint = -1
  39. func WindowHint(target Hint, hint int) {
  40. if target == noopHint {
  41. return
  42. }
  43. glfw.WindowHint(glfw.Hint(target), hint)
  44. }