public final class ContextAttribs
extends java.lang.Object
CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
flag is used, LWJGL will not load the deprecated functionality (as defined in the OpenGL 3.0
specification), even if the driver exposes the corresponding entry points.
This extension is not supported on MacOS X. However, in order to enable the GL 3.2 context on MacOS X 10.7 or newer, an instance of this class must be passed
to LWJGL. The only valid configuration is ContextAttribs(3, 2, CONTEXT_CORE_PROFILE_BIT_ARB)
, anything else will be ignored.Modifier and Type | Field and Description |
---|---|
static int |
CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB |
static int |
CONTEXT_CORE_PROFILE_BIT_ARB |
static int |
CONTEXT_DEBUG_BIT_ARB |
static int |
CONTEXT_ES2_PROFILE_BIT_EXT |
static int |
CONTEXT_FLAGS_ARB |
static int |
CONTEXT_FORWARD_COMPATIBLE_BIT_ARB |
static int |
CONTEXT_LAYER_PLANE_ARB |
static int |
CONTEXT_MAJOR_VERSION_ARB |
static int |
CONTEXT_MINOR_VERSION_ARB |
static int |
CONTEXT_PROFILE_MASK_ARB |
static int |
CONTEXT_RELEASE_BEHABIOR_ARB |
static int |
CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB |
static int |
CONTEXT_RELEASE_BEHAVIOR_NONE_ARB |
static int |
CONTEXT_RESET_ISOLATION_BIT_ARB |
static int |
CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB |
static int |
CONTEXT_ROBUST_ACCESS_BIT_ARB |
static int |
LOSE_CONTEXT_ON_RESET_ARB |
static int |
NO_RESET_NOTIFICATION_ARB |
Constructor and Description |
---|
ContextAttribs()
Creates the default ContextAttribs instance.
|
ContextAttribs(int majorVersion,
int minorVersion)
Creates a ContextAttribs instance for the given OpenGL version.
|
ContextAttribs(int majorVersion,
int minorVersion,
int profileMask)
Creates a new ContextAttribs instance with the given attributes.
|
ContextAttribs(int majorVersion,
int minorVersion,
int profileMask,
int contextFlags)
Creates a new ContextAttribs instance with the given attributes.
|
Modifier and Type | Method and Description |
---|---|
int |
getContextFlags()
Returns the
CONTEXT_FLAGS_ARB value. |
int |
getContextReleaseBehavior()
Returns the
CONTEXT_RELEASE_BEHABIOR_ARB value. |
int |
getContextResetNotificationStrategy()
Returns the
CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB value. |
int |
getLayerPlane()
Returns the
CONTEXT_LAYER_PLANE_ARB value. |
int |
getMajorVersion()
Returns the
CONTEXT_MAJOR_VERSION_ARB value. |
int |
getMinorVersion()
Returns the
CONTEXT_MINOR_VERSION_ARB value. |
int |
getProfileMask()
Returns the
CONTEXT_PROFILE_MASK_ARB value. |
boolean |
isContextResetIsolation()
Returns true if the
CONTEXT_RESET_ISOLATION_BIT_ARB has been set. |
boolean |
isDebug()
Returns true if the
CONTEXT_DEBUG_BIT_ARB has been set. |
boolean |
isForwardCompatible()
Returns true if the
CONTEXT_FORWARD_COMPATIBLE_BIT_ARB has been set. |
boolean |
isLoseContextOnReset()
Deprecated.
use
getContextResetNotificationStrategy() instead |
boolean |
isProfileCompatibility()
Returns true if the
CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB has been set. |
boolean |
isProfileCore()
Returns true if the
CONTEXT_CORE_PROFILE_BIT_ARB has been set. |
boolean |
isProfileES()
Returns true if the
CONTEXT_ES2_PROFILE_BIT_EXT has been set. |
boolean |
isRobustAccess()
Returns true if the
CONTEXT_ROBUST_ACCESS_BIT_ARB has been set. |
java.lang.String |
toString() |
ContextAttribs |
withContextReleaseBehavior(int behavior)
Returns a ContextAttribs instance with
CONTEXT_RELEASE_BEHABIOR_ARB set to the given behavior. |
ContextAttribs |
withContextResetIsolation(boolean contextResetIsolation)
Returns a new
ContextAttribs instance with the CONTEXT_RESET_ISOLATION_BIT_ARB bit in CONTEXT_FLAGS_ARB set to the given value. |
ContextAttribs |
withDebug(boolean debug)
Returns a new
ContextAttribs instance with the CONTEXT_DEBUG_BIT_ARB bit in CONTEXT_FLAGS_ARB set to the given value. |
ContextAttribs |
withForwardCompatible(boolean forwardCompatible)
Returns a new
ContextAttribs instance with the CONTEXT_FORWARD_COMPATIBLE_BIT_ARB bit in CONTEXT_FLAGS_ARB set to the given value. |
ContextAttribs |
withLayer(int layerPlane)
Returns a new
ContextAttribs instance with CONTEXT_LAYER_PLANE_ARB set to the given value. |
ContextAttribs |
withLoseContextOnReset(boolean loseContextOnReset)
Deprecated.
use
withResetNotificationStrategy(int) instead |
ContextAttribs |
withProfileCompatibility(boolean profileCompatibility)
Returns a new
ContextAttribs instance with the CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB bit in CONTEXT_PROFILE_MASK_ARB set to the given value. |
ContextAttribs |
withProfileCore(boolean profileCore)
Returns a new
ContextAttribs instance with the CONTEXT_CORE_PROFILE_BIT_ARB bit in CONTEXT_PROFILE_MASK_ARB set to the given value. |
ContextAttribs |
withProfileES(boolean profileES)
Returns a new
ContextAttribs instance with the CONTEXT_ES2_PROFILE_BIT_EXT bit in CONTEXT_PROFILE_MASK_ARB set to the given value. |
ContextAttribs |
withResetNotificationStrategy(int strategy)
Returns a ContextAttribs instance with
CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB set to the given strategy. |
ContextAttribs |
withRobustAccess(boolean robustAccess)
Returns a new
ContextAttribs instance with the CONTEXT_ROBUST_ACCESS_BIT_ARB bit in CONTEXT_FLAGS_ARB set to the given value. |
public static final int CONTEXT_MAJOR_VERSION_ARB
public static final int CONTEXT_MINOR_VERSION_ARB
public static final int CONTEXT_PROFILE_MASK_ARB
public static final int CONTEXT_CORE_PROFILE_BIT_ARB
public static final int CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
public static final int CONTEXT_ES2_PROFILE_BIT_EXT
public static final int CONTEXT_FLAGS_ARB
public static final int CONTEXT_DEBUG_BIT_ARB
public static final int CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
public static final int CONTEXT_ROBUST_ACCESS_BIT_ARB
public static final int CONTEXT_RESET_ISOLATION_BIT_ARB
public static final int CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
public static final int NO_RESET_NOTIFICATION_ARB
public static final int LOSE_CONTEXT_ON_RESET_ARB
public static final int CONTEXT_RELEASE_BEHABIOR_ARB
public static final int CONTEXT_RELEASE_BEHAVIOR_NONE_ARB
public static final int CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB
public static final int CONTEXT_LAYER_PLANE_ARB
public ContextAttribs()
public ContextAttribs(int majorVersion, int minorVersion)
public ContextAttribs(int majorVersion, int minorVersion, int profileMask)
majorVersion
- the major OpenGL versionminorVersion
- the minor OpenGL versionprofileMask
- the context profile mask. One of:CONTEXT_CORE_PROFILE_BIT_ARB
, CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
, CONTEXT_ES2_PROFILE_BIT_EXT
public ContextAttribs(int majorVersion, int minorVersion, int profileMask, int contextFlags)
majorVersion
- the major OpenGL versionminorVersion
- the minor OpenGL versionprofileMask
- the context profile mask. One of:CONTEXT_CORE_PROFILE_BIT_ARB
, CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
, CONTEXT_ES2_PROFILE_BIT_EXT
contextFlags
- the context flags, a bitfield value. One or more of:CONTEXT_DEBUG_BIT_ARB
, CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
, CONTEXT_ROBUST_ACCESS_BIT_ARB
, CONTEXT_RESET_ISOLATION_BIT_ARB
public int getMajorVersion()
CONTEXT_MAJOR_VERSION_ARB
value.public int getMinorVersion()
CONTEXT_MINOR_VERSION_ARB
value.public int getProfileMask()
CONTEXT_PROFILE_MASK_ARB
value.public boolean isProfileCore()
CONTEXT_CORE_PROFILE_BIT_ARB
has been set.public boolean isProfileCompatibility()
CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
has been set.public boolean isProfileES()
CONTEXT_ES2_PROFILE_BIT_EXT
has been set.public int getContextFlags()
CONTEXT_FLAGS_ARB
value.public boolean isDebug()
CONTEXT_DEBUG_BIT_ARB
has been set.public boolean isForwardCompatible()
CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
has been set.public boolean isRobustAccess()
CONTEXT_ROBUST_ACCESS_BIT_ARB
has been set.public boolean isContextResetIsolation()
CONTEXT_RESET_ISOLATION_BIT_ARB
has been set.public int getContextResetNotificationStrategy()
CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
value.public boolean isLoseContextOnReset()
getContextResetNotificationStrategy()
insteadCONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
has been set to LOSE_CONTEXT_ON_RESET_ARB
.public int getContextReleaseBehavior()
CONTEXT_RELEASE_BEHABIOR_ARB
value.public int getLayerPlane()
CONTEXT_LAYER_PLANE_ARB
value.public ContextAttribs withProfileCore(boolean profileCore)
ContextAttribs
instance with the CONTEXT_CORE_PROFILE_BIT_ARB
bit in CONTEXT_PROFILE_MASK_ARB
set to the given value.
If profileCore
is true, all other bits in the mask are cleared.public ContextAttribs withProfileCompatibility(boolean profileCompatibility)
ContextAttribs
instance with the CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
bit in CONTEXT_PROFILE_MASK_ARB
set to the given value.
If profileCompatibility
is true, all other bits in the mask are cleared.public ContextAttribs withProfileES(boolean profileES)
ContextAttribs
instance with the CONTEXT_ES2_PROFILE_BIT_EXT
bit in CONTEXT_PROFILE_MASK_ARB
set to the given value.
If profileES
is true, all other bits in the mask are cleared.public ContextAttribs withDebug(boolean debug)
ContextAttribs
instance with the CONTEXT_DEBUG_BIT_ARB
bit in CONTEXT_FLAGS_ARB
set to the given value.public ContextAttribs withForwardCompatible(boolean forwardCompatible)
ContextAttribs
instance with the CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
bit in CONTEXT_FLAGS_ARB
set to the given value.public ContextAttribs withRobustAccess(boolean robustAccess)
ContextAttribs
instance with the CONTEXT_ROBUST_ACCESS_BIT_ARB
bit in CONTEXT_FLAGS_ARB
set to the given value.public ContextAttribs withContextResetIsolation(boolean contextResetIsolation)
ContextAttribs
instance with the CONTEXT_RESET_ISOLATION_BIT_ARB
bit in CONTEXT_FLAGS_ARB
set to the given value.public ContextAttribs withResetNotificationStrategy(int strategy)
CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
set to the given strategy. The default context reset notification
strategy is NO_RESET_NOTIFICATION_ARB
.strategy
- the context reset notification strategy. One of:NO_RESET_NOTIFICATION_ARB
, LOSE_CONTEXT_ON_RESET_ARB
public ContextAttribs withLoseContextOnReset(boolean loseContextOnReset)
withResetNotificationStrategy(int)
insteadCONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
set to LOSE_CONTEXT_ON_RESET_ARB
if the parameter is
true or to NO_RESET_NOTIFICATION_ARB
if the parameter is false.loseContextOnReset
- the context reset notification strategypublic ContextAttribs withContextReleaseBehavior(int behavior)
CONTEXT_RELEASE_BEHABIOR_ARB
set to the given behavior. The default context release behavior is
CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB
.behavior
- the context release behavior. One of:CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB
, CONTEXT_RELEASE_BEHAVIOR_NONE_ARB
public ContextAttribs withLayer(int layerPlane)
ContextAttribs
instance with CONTEXT_LAYER_PLANE_ARB
set to the given value.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2002-2009 lwjgl.org. All Rights Reserved.