Class GLFWWindowHints
java.lang.Object
com.blackrook.gloop.glfw.GLFWWindowHints
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!
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumstatic enumstatic enum -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSets the hints for this context viaGLFW.glfwWindowHint(int, int).voidreset()Resets all hints to default.setAccumAlphaBits(int value) Sets the next created window's accumulation framebuffer's alpha bits.setAccumBlueBits(int value) Sets the next created window's accumulation framebuffer's blue color bits.setAccumGreenBits(int value) Sets the next created window's accumulation framebuffer's green color bits.setAccumRedBits(int value) Sets the next created window's accumulation framebuffer's red color bits.setAlphaBits(int value) Sets the next created window's framebuffer's alpha bits.setAutoIconified(boolean value) Sets if the next created window starts iconified on creation.setAuxBuffers(int value) Sets the next created window's auxiliary buffers.setBlueBits(int value) Sets the next created window's framebuffer's blue color bits.setCenteredCursor(boolean value) Sets if the next created window starts with the mouse cursor centered over it (fullscreen only).setClientAPI(GLFWWindowHints.ClientAPI clientAPI) Sets which client API to create the context for.setCocoaGraphicsSwitching(boolean value) Specifies whether to enable Automatic Graphics Switching, i.e.setCocoaRetinaFrameBuffer(boolean value) Sets whether to use full resolution framebuffers on Retina displays.setContextCreationAPI(GLFWWindowHints.ContextCreationAPI contextCreationAPI) Sets which context creation API to use to create the context.setContextNoError(boolean value) Sets whether errors should be generated by the context.setContextReleaseBehavior(GLFWWindowHints.ContextReleaseBehavior contextReleaseBehavior) Sets the release behavior to be used by the context.setContextRobustness(GLFWWindowHints.ContextRobustness contextRobustness) Sets the robustness strategy to be used by the context.setContextVersion(int major, int minor) Sets the OpenGL version.setDecorated(boolean value) Sets if the next created window is decorated on creation.setDepthBits(int value) Sets the next created window's depth buffer bits.setDoubleBuffered(boolean value) Sets if the next created window is double-buffered.setFloating(boolean value) Sets if the next created window starts floating, or rather, "always on top".setFocused(boolean value) Sets if the next created window gains immediate focus on creation.setFocusOnShow(boolean value) Sets if the next created window requests focus when shown.setGreenBits(int value) Sets the next created window's framebuffer's green color bits.setMaximized(boolean value) Sets if the next created window starts maximized on creation.setOpenGLDebugContext(boolean value) Sets whether to create a debug OpenGL context, which may have additional error and performance issue reporting functionality.setOpenGLForwardCompatibility(boolean value) Sets whether the OpenGL context should be forward-compatible, i.e.setOpenGLProfile(GLFWWindowHints.OpenGLProfile openGLProfile) Sets which OpenGL profile to create the context for.setRedBits(int value) Sets the next created window's framebuffer's red color bits.setRefreshRate(int value) Sets the next created window's refresh rate.setResizable(boolean value) Sets if the next created window is resizable (manually, not via methods).setSamples(int value) Sets the next created window's multisample samples.setScaleToMonitor(boolean value) Sets if the next created window resizes proportionally to each monitor it touches.setSRGBCapable(boolean value) Sets if the next created window is SRGB Capable.setStencilBits(int value) Sets the next created window's stencil buffer bits.setStereo(boolean value) Sets if the next created window is in stereo mode.setTransparentFramebuffer(boolean value) Sets if the next created window can have a transparent framebuffer (not supported everywhere).setVisible(boolean value) Sets if the next created window is visible on creation.
-
Field Details
-
DONT_CARE
public static final int DONT_CAREThe Don't Care constant.- See Also:
-
-
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
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
Sets if the next created window is visible on creation.- Parameters:
value- true if so, false if not.- Returns:
- itself, for chaining calls.
-
setDecorated
Sets if the next created window is decorated on creation.- Parameters:
value- true if so, false if not.- Returns:
- itself, for chaining calls.
-
setFocused
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
Sets if the next created window starts iconified on creation.- Parameters:
value- true if so, false if not.- Returns:
- itself, for chaining calls.
-
setFloating
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
Sets if the next created window starts maximized on creation.- Parameters:
value- true if so, false if not.- Returns:
- itself, for chaining calls.
-
setCenteredCursor
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
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
Sets if the next created window requests focus when shown.- Parameters:
value- true if so, false if not.- Returns:
- itself, for chaining calls.
-
setScaleToMonitor
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
Sets the next created window's framebuffer's red color bits.- Parameters:
value- 0 toInteger.MAX_VALUE, orDONT_CARE.- Returns:
- itself, for chaining calls.
-
setGreenBits
Sets the next created window's framebuffer's green color bits.- Parameters:
value- 0 toInteger.MAX_VALUE, orDONT_CARE.- Returns:
- itself, for chaining calls.
-
setBlueBits
Sets the next created window's framebuffer's blue color bits.- Parameters:
value- 0 toInteger.MAX_VALUE, orDONT_CARE.- Returns:
- itself, for chaining calls.
-
setAlphaBits
Sets the next created window's framebuffer's alpha bits.- Parameters:
value- 0 toInteger.MAX_VALUE, orDONT_CARE.- Returns:
- itself, for chaining calls.
-
setDepthBits
Sets the next created window's depth buffer bits.- Parameters:
value- 0 toInteger.MAX_VALUE, orDONT_CARE.- Returns:
- itself, for chaining calls.
-
setStencilBits
Sets the next created window's stencil buffer bits.- Parameters:
value- 0 toInteger.MAX_VALUE, orDONT_CARE.- Returns:
- itself, for chaining calls.
-
setAccumRedBits
Sets the next created window's accumulation framebuffer's red color bits.- Parameters:
value- 0 toInteger.MAX_VALUE, orDONT_CARE.- Returns:
- itself, for chaining calls.
-
setAccumGreenBits
Sets the next created window's accumulation framebuffer's green color bits.- Parameters:
value- 0 toInteger.MAX_VALUE, orDONT_CARE.- Returns:
- itself, for chaining calls.
-
setAccumBlueBits
Sets the next created window's accumulation framebuffer's blue color bits.- Parameters:
value- 0 toInteger.MAX_VALUE, orDONT_CARE.- Returns:
- itself, for chaining calls.
-
setAccumAlphaBits
Sets the next created window's accumulation framebuffer's alpha bits.- Parameters:
value- 0 toInteger.MAX_VALUE, orDONT_CARE.- Returns:
- itself, for chaining calls.
-
setAuxBuffers
Sets the next created window's auxiliary buffers.- Parameters:
value- 0 toInteger.MAX_VALUE.- Returns:
- itself, for chaining calls.
-
setSamples
Sets the next created window's multisample samples.- Parameters:
value- 0 toInteger.MAX_VALUE.- Returns:
- itself, for chaining calls.
-
setRefreshRate
Sets the next created window's refresh rate.- Parameters:
value- 0 toInteger.MAX_VALUE, orDONT_CARE.- Returns:
- itself, for chaining calls.
-
setStereo
Sets if the next created window is in stereo mode.- Parameters:
value- true if so, false if not.- Returns:
- itself, for chaining calls.
-
setSRGBCapable
Sets if the next created window is SRGB Capable.- Parameters:
value- true if so, false if not.- Returns:
- itself, for chaining calls.
-
setDoubleBuffered
Sets if the next created window is double-buffered.- Parameters:
value- true if so, false if not.- Returns:
- itself, for chaining calls.
-
setClientAPI
Sets which client API to create the context for. Hard constraint.- Parameters:
clientAPI- the API type.- Returns:
- itself, for chaining calls.
-
setContextCreationAPI
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
Sets the OpenGL version.- Parameters:
major- the major version number.minor- the minor version number.- Returns:
- itself, for chaining calls.
-
setContextRobustness
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
Sets whether errors should be generated by the context.- Parameters:
value- true if so, false if not.- Returns:
- itself, for chaining calls.
-
setOpenGLForwardCompatibility
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
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
Sets which OpenGL profile to create the context for. If requesting an OpenGL version below 3.2,GLFWWindowHints.OpenGLProfile.ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.- Parameters:
openGLProfile- the profile to create.- Returns:
- itself, for chaining calls.
-
setCocoaRetinaFrameBuffer
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
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 viaGLFW.glfwWindowHint(int, int). DO NOT call this outside of situations that require GLFW Window Hints to be set.
-