Class GLFWWindowHints

java.lang.Object
com.blackrook.gloop.glfw.GLFWWindowHints

public class GLFWWindowHints extends Object
Windows hints for the next window created.

Don't modify these hints while a windows is being built with them, or undefined behavior may occur!

  • Field Details

  • Constructor Details

    • GLFWWindowHints

      public GLFWWindowHints()
      Creates a new default set of hints.
  • Method Details

    • reset

      public void reset()
      Resets all hints to default.
      • setResizable(true)
      • setVisible(true)
      • setDecorated(true)
      • setFocused(true)
      • setAutoIconified(true)
      • setFloating(false)
      • setMaximized(false)
      • setCenteredCursor(true)
      • setTransparentFramebuffer(false)
      • setFocusOnShow(true)
      • setScaleToMonitor(false)
      • setRedBits(8)
      • setGreenBits(8)
      • setBlueBits(8)
      • setAlphaBits(8)
      • setDepthBits(24)
      • setStencilBits(8)
      • setAccumRedBits(0)
      • setAccumGreenBits(0)
      • setAccumBlueBits(0)
      • setAccumAlphaBits(0)
      • setAuxBuffers(0)
      • setSamples(0)
      • setRefreshRate(DONT_CARE)
      • setStereo(false)
      • setSRGBCapable(false)
      • setDoubleBuffered(true)
      • setClientAPI(ClientAPI.OPENGL_API)
      • setContextCreationAPI(ContextCreationAPI.NATIVE_CONTEXT_API)
      • setContextVersion(1, 0)
      • setContextRobustness(ContextRobustness.NO_ROBUSTNESS)
      • setContextReleaseBehavior(ContextReleaseBehavior.ANY_RELEASE_BEHAVIOR)
      • setContextNoError(false)
      • setOpenGLForwardCompatibility(false)
      • setOpenGLDebugContext(false)
      • setOpenGLProfile(OpenGLProfile.ANY_PROFILE)
      • setCocoaRetinaFrameBuffer(true)
      • setCocoaGraphicsSwitching(false)
    • setResizable

      public GLFWWindowHints setResizable(boolean value)
      Sets if the next created window is resizable (manually, not via methods).
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setVisible

      public GLFWWindowHints setVisible(boolean value)
      Sets if the next created window is visible on creation.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setDecorated

      public GLFWWindowHints setDecorated(boolean value)
      Sets if the next created window is decorated on creation.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setFocused

      public GLFWWindowHints setFocused(boolean value)
      Sets if the next created window gains immediate focus on creation.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setAutoIconified

      public GLFWWindowHints setAutoIconified(boolean value)
      Sets if the next created window starts iconified on creation.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setFloating

      public GLFWWindowHints setFloating(boolean value)
      Sets if the next created window starts floating, or rather, "always on top".
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setMaximized

      public GLFWWindowHints setMaximized(boolean value)
      Sets if the next created window starts maximized on creation.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setCenteredCursor

      public GLFWWindowHints setCenteredCursor(boolean value)
      Sets if the next created window starts with the mouse cursor centered over it (fullscreen only).
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setTransparentFramebuffer

      public GLFWWindowHints setTransparentFramebuffer(boolean value)
      Sets if the next created window can have a transparent framebuffer (not supported everywhere).
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setFocusOnShow

      public GLFWWindowHints setFocusOnShow(boolean value)
      Sets if the next created window requests focus when shown.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setScaleToMonitor

      public GLFWWindowHints setScaleToMonitor(boolean value)
      Sets if the next created window resizes proportionally to each monitor it touches.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setRedBits

      public GLFWWindowHints setRedBits(int value)
      Sets the next created window's framebuffer's red color bits.
      Parameters:
      value - 0 to Integer.MAX_VALUE, or DONT_CARE.
      Returns:
      itself, for chaining calls.
    • setGreenBits

      public GLFWWindowHints setGreenBits(int value)
      Sets the next created window's framebuffer's green color bits.
      Parameters:
      value - 0 to Integer.MAX_VALUE, or DONT_CARE.
      Returns:
      itself, for chaining calls.
    • setBlueBits

      public GLFWWindowHints setBlueBits(int value)
      Sets the next created window's framebuffer's blue color bits.
      Parameters:
      value - 0 to Integer.MAX_VALUE, or DONT_CARE.
      Returns:
      itself, for chaining calls.
    • setAlphaBits

      public GLFWWindowHints setAlphaBits(int value)
      Sets the next created window's framebuffer's alpha bits.
      Parameters:
      value - 0 to Integer.MAX_VALUE, or DONT_CARE.
      Returns:
      itself, for chaining calls.
    • setDepthBits

      public GLFWWindowHints setDepthBits(int value)
      Sets the next created window's depth buffer bits.
      Parameters:
      value - 0 to Integer.MAX_VALUE, or DONT_CARE.
      Returns:
      itself, for chaining calls.
    • setStencilBits

      public GLFWWindowHints setStencilBits(int value)
      Sets the next created window's stencil buffer bits.
      Parameters:
      value - 0 to Integer.MAX_VALUE, or DONT_CARE.
      Returns:
      itself, for chaining calls.
    • setAccumRedBits

      public GLFWWindowHints setAccumRedBits(int value)
      Sets the next created window's accumulation framebuffer's red color bits.
      Parameters:
      value - 0 to Integer.MAX_VALUE, or DONT_CARE.
      Returns:
      itself, for chaining calls.
    • setAccumGreenBits

      public GLFWWindowHints setAccumGreenBits(int value)
      Sets the next created window's accumulation framebuffer's green color bits.
      Parameters:
      value - 0 to Integer.MAX_VALUE, or DONT_CARE.
      Returns:
      itself, for chaining calls.
    • setAccumBlueBits

      public GLFWWindowHints setAccumBlueBits(int value)
      Sets the next created window's accumulation framebuffer's blue color bits.
      Parameters:
      value - 0 to Integer.MAX_VALUE, or DONT_CARE.
      Returns:
      itself, for chaining calls.
    • setAccumAlphaBits

      public GLFWWindowHints setAccumAlphaBits(int value)
      Sets the next created window's accumulation framebuffer's alpha bits.
      Parameters:
      value - 0 to Integer.MAX_VALUE, or DONT_CARE.
      Returns:
      itself, for chaining calls.
    • setAuxBuffers

      public GLFWWindowHints setAuxBuffers(int value)
      Sets the next created window's auxiliary buffers.
      Parameters:
      value - 0 to Integer.MAX_VALUE.
      Returns:
      itself, for chaining calls.
    • setSamples

      public GLFWWindowHints setSamples(int value)
      Sets the next created window's multisample samples.
      Parameters:
      value - 0 to Integer.MAX_VALUE.
      Returns:
      itself, for chaining calls.
    • setRefreshRate

      public GLFWWindowHints setRefreshRate(int value)
      Sets the next created window's refresh rate.
      Parameters:
      value - 0 to Integer.MAX_VALUE, or DONT_CARE.
      Returns:
      itself, for chaining calls.
    • setStereo

      public GLFWWindowHints setStereo(boolean value)
      Sets if the next created window is in stereo mode.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setSRGBCapable

      public GLFWWindowHints setSRGBCapable(boolean value)
      Sets if the next created window is SRGB Capable.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setDoubleBuffered

      public GLFWWindowHints setDoubleBuffered(boolean value)
      Sets if the next created window is double-buffered.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setClientAPI

      public GLFWWindowHints setClientAPI(GLFWWindowHints.ClientAPI clientAPI)
      Sets which client API to create the context for. Hard constraint.
      Parameters:
      clientAPI - the API type.
      Returns:
      itself, for chaining calls.
    • setContextCreationAPI

      public GLFWWindowHints setContextCreationAPI(GLFWWindowHints.ContextCreationAPI contextCreationAPI)
      Sets which context creation API to use to create the context. Hard constraint. Only used if the client API is set.
      Parameters:
      contextCreationAPI - the context creation type.
      Returns:
      itself, for chaining calls.
    • setContextVersion

      public GLFWWindowHints setContextVersion(int major, int minor)
      Sets the OpenGL version.
      Parameters:
      major - the major version number.
      minor - the minor version number.
      Returns:
      itself, for chaining calls.
    • setContextRobustness

      public GLFWWindowHints setContextRobustness(GLFWWindowHints.ContextRobustness contextRobustness)
      Sets the robustness strategy to be used by the context.
      Parameters:
      contextRobustness - the robustness strategy.
      Returns:
      itself, for chaining calls.
    • setContextReleaseBehavior

      public GLFWWindowHints setContextReleaseBehavior(GLFWWindowHints.ContextReleaseBehavior contextReleaseBehavior)
      Sets the release behavior to be used by the context.
      Parameters:
      contextReleaseBehavior - the release behavior.
      Returns:
      itself, for chaining calls.
    • setContextNoError

      public GLFWWindowHints setContextNoError(boolean value)
      Sets whether errors should be generated by the context.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setOpenGLForwardCompatibility

      public GLFWWindowHints setOpenGLForwardCompatibility(boolean value)
      Sets whether the OpenGL context should be forward-compatible, i.e. one where all functionality deprecated in the requested version of OpenGL is removed. This must only be used if the requested OpenGL version is 3.0 or above. If OpenGL ES is requested, this hint is ignored.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setOpenGLDebugContext

      public GLFWWindowHints setOpenGLDebugContext(boolean value)
      Sets whether to create a debug OpenGL context, which may have additional error and performance issue reporting functionality. If OpenGL ES is requested, this hint is ignored.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setOpenGLProfile

      public GLFWWindowHints setOpenGLProfile(GLFWWindowHints.OpenGLProfile openGLProfile)
      Sets which OpenGL profile to create the context for. If requesting an OpenGL version below 3.2, GLFWWindowHints.OpenGLProfile.ANY_PROFILE must be used. If OpenGL ES is requested, this hint is ignored.
      Parameters:
      openGLProfile - the profile to create.
      Returns:
      itself, for chaining calls.
    • setCocoaRetinaFrameBuffer

      public GLFWWindowHints setCocoaRetinaFrameBuffer(boolean value)
      Sets whether to use full resolution framebuffers on Retina displays. This is ignored on non-macOS platforms.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • setCocoaGraphicsSwitching

      public GLFWWindowHints setCocoaGraphicsSwitching(boolean value)
      Specifies whether to enable Automatic Graphics Switching, i.e. to allow the system to choose the integrated GPU for the OpenGL context and move it between GPUs if necessary or whether to force it to always run on the discrete GPU. This only affects systems with both integrated and discrete GPUs. This is ignored on non-macOS platforms.
      Parameters:
      value - true if so, false if not.
      Returns:
      itself, for chaining calls.
    • callHints

      public void callHints()
      Sets the hints for this context via GLFW.glfwWindowHint(int, int). DO NOT call this outside of situations that require GLFW Window Hints to be set.