hint_glfw.go 1.7 KB

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