public class GLCapabilities extends Capabilities implements Cloneable, GLCapabilitiesImmutable
GLDrawable
using GLDrawableFactory
,
an instance of this class is passed,
describing the desired capabilities that a rendering context
must support, such as the OpenGL profile, color depth and whether stereo is enabled.GLDrawable
s are then reflected by their own
GLCapabilites instance, which can be queried with GLDrawable#getGLCapabilities()
.VisualIDHolder.VIDComparator, VisualIDHolder.VIDType
DEFAULT_SAMPLE_EXTENSION
VID_UNDEFINED
Constructor and Description |
---|
GLCapabilities(GLProfile glp)
Creates a GLCapabilities object.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
Object |
cloneMutable() |
int |
compareTo(CapabilitiesImmutable o)
comparing hw/sw, stereo, multisample, stencil, RGBA and depth only
|
boolean |
equals(Object obj)
Equality over the immutable attributes of both objects
|
int |
getAccumAlphaBits()
Returns the number of bits requested for the accumulation
buffer's alpha component.
|
int |
getAccumBlueBits()
Returns the number of bits requested for the accumulation
buffer's blue component.
|
int |
getAccumGreenBits()
Returns the number of bits requested for the accumulation
buffer's green component.
|
int |
getAccumRedBits()
Returns the number of bits requested for the accumulation
buffer's red component.
|
int |
getDepthBits()
Returns the number of bits requested for the depth buffer.
|
boolean |
getDoubleBuffered()
Indicates whether double-buffering is enabled.
|
GLProfile |
getGLProfile()
Returns the GL profile you desire or used by the drawable.
|
boolean |
getHardwareAccelerated()
Indicates whether hardware acceleration is enabled.
|
int |
getNumSamples()
Returns the number of sample buffers to be allocated if sample
buffers are enabled, otherwise returns 0.
|
boolean |
getPbufferFloatingPointBuffers()
For pbuffers only, returns whether floating-point buffers should
be used if available.
|
boolean |
getPbufferRenderToTexture()
For pbuffers only, returns whether the render-to-texture
extension should be used if available.
|
boolean |
getPbufferRenderToTextureRectangle()
For pbuffers only, returns whether the render-to-texture
extension should be used.
|
boolean |
getSampleBuffers()
Returns whether sample buffers for full-scene antialiasing
(FSAA) should be allocated for this drawable.
|
String |
getSampleExtension()
Returns the used extension for full-scene antialiasing
(FSAA), default is
GLCapabilitiesImmutable.DEFAULT_SAMPLE_EXTENSION . |
int |
getStencilBits()
Returns the number of bits requested for the stencil buffer.
|
boolean |
getStereo()
Indicates whether stereo is enabled.
|
int |
hashCode()
hash code over the immutable attributes of both objects
|
boolean |
isFBO()
Indicates whether FBO offscreen is used/requested.
|
boolean |
isPBuffer()
Indicates whether pbuffer offscreen is used/requested.
|
void |
setAccumAlphaBits(int accumAlphaBits)
Sets number of bits requested for accumulation buffer's alpha
component.
|
void |
setAccumBlueBits(int accumBlueBits)
Sets the number of bits requested for the accumulation buffer's
blue component.
|
void |
setAccumGreenBits(int accumGreenBits)
Sets the number of bits requested for the accumulation buffer's
green component.
|
void |
setAccumRedBits(int accumRedBits)
Sets the number of bits requested for the accumulation buffer's
red component.
|
void |
setDepthBits(int depthBits)
Sets the number of bits requested for the depth buffer.
|
void |
setDoubleBuffered(boolean enable)
Enables or disables double buffering.
|
void |
setFBO(boolean enable)
Enables or disables FBO usage.
|
void |
setGLProfile(GLProfile profile)
Sets the GL profile you desire
|
void |
setHardwareAccelerated(boolean enable)
Enables or disables hardware acceleration.
|
void |
setNumSamples(int numSamples)
If sample buffers are enabled, indicates the number of buffers
to be allocated.
|
void |
setOnscreen(boolean onscreen)
Sets whether the drawable surface supports onscreen.
If enabled this method also invokes setPBuffer(false)
and setFBO(false) Defaults to true. |
void |
setPBuffer(boolean enable)
Enables or disables pbuffer usage.
|
void |
setPbufferFloatingPointBuffers(boolean enable)
For pbuffers only, indicates whether floating-point buffers
should be used if available.
|
void |
setPbufferRenderToTexture(boolean enable)
For pbuffers only, indicates whether the render-to-texture
extension should be used if available.
|
void |
setPbufferRenderToTextureRectangle(boolean enable)
For pbuffers only, indicates whether the
render-to-texture-rectangle extension should be used if
available.
|
void |
setSampleBuffers(boolean enable)
Defaults to false.
Indicates whether sample buffers for full-scene antialiasing (FSAA) should be allocated for this drawable. Mind that this requires the alpha component. If enabled this method also invokes setAlphaBits(1)
if Capabilities.getAlphaBits() == 0. |
void |
setSampleExtension(String se)
Sets the desired extension for full-scene antialiasing
(FSAA), default is
GLCapabilitiesImmutable.DEFAULT_SAMPLE_EXTENSION . |
void |
setStencilBits(int stencilBits)
Sets the number of bits requested for the stencil buffer.
|
void |
setStereo(boolean enable)
Enables or disables stereo viewing.
|
String |
toString()
Returns a textual representation of this GLCapabilities
object.
|
StringBuilder |
toString(StringBuilder sink)
Return a textual representation of this object.
|
getAlphaBits, getBlueBits, getGreenBits, getRedBits, getTransparentAlphaValue, getTransparentBlueValue, getTransparentGreenValue, getTransparentRedValue, getVisualID, isBackgroundOpaque, isOnscreen, setAlphaBits, setBackgroundOpaque, setBlueBits, setGreenBits, setRedBits, setTransparentAlphaValue, setTransparentBlueValue, setTransparentGreenValue, setTransparentRedValue
getAlphaBits, getBlueBits, getGreenBits, getRedBits, getTransparentAlphaValue, getTransparentBlueValue, getTransparentGreenValue, getTransparentRedValue, isBackgroundOpaque, isOnscreen
getVisualID
public GLCapabilities(GLProfile glp) throws GLException
glp
- GLProfile, or null for the default GLProfileGLException
- if no profile is given and no default profile is available for the default device.public Object cloneMutable()
cloneMutable
in interface com.jogamp.common.type.WriteCloneable
cloneMutable
in class Capabilities
public Object clone()
clone
in class Capabilities
public int hashCode()
CapabilitiesImmutable
hashCode
in interface CapabilitiesImmutable
hashCode
in interface GLCapabilitiesImmutable
hashCode
in class Capabilities
public boolean equals(Object obj)
CapabilitiesImmutable
equals
in interface CapabilitiesImmutable
equals
in interface GLCapabilitiesImmutable
equals
in class Capabilities
public int compareTo(CapabilitiesImmutable o)
compareTo
in interface Comparable<CapabilitiesImmutable>
compareTo
in class Capabilities
public final GLProfile getGLProfile()
GLCapabilitiesImmutable
getGLProfile
in interface GLCapabilitiesImmutable
public void setGLProfile(GLProfile profile)
public final boolean isPBuffer()
GLCapabilitiesImmutable
isPBuffer
in interface GLCapabilitiesImmutable
public void setPBuffer(boolean enable)
If enabled this method also invokes setOnscreen(false)
.
public final boolean isFBO()
GLCapabilitiesImmutable
isFBO
in interface GLCapabilitiesImmutable
public void setFBO(boolean enable)
If enabled this method also invokes setOnscreen(false)
.
public void setOnscreen(boolean onscreen)
setPBuffer(false)
and setFBO(false)
setOnscreen
in class Capabilities
public final boolean getDoubleBuffered()
GLCapabilitiesImmutable
getDoubleBuffered
in interface GLCapabilitiesImmutable
public void setDoubleBuffered(boolean enable)
public final boolean getStereo()
GLCapabilitiesImmutable
getStereo
in interface GLCapabilitiesImmutable
public void setStereo(boolean enable)
public final boolean getHardwareAccelerated()
GLCapabilitiesImmutable
getHardwareAccelerated
in interface GLCapabilitiesImmutable
public void setHardwareAccelerated(boolean enable)
public final int getDepthBits()
GLCapabilitiesImmutable
getDepthBits
in interface GLCapabilitiesImmutable
public void setDepthBits(int depthBits)
public final int getStencilBits()
GLCapabilitiesImmutable
getStencilBits
in interface GLCapabilitiesImmutable
public void setStencilBits(int stencilBits)
public final int getAccumRedBits()
GLCapabilitiesImmutable
getAccumRedBits
in interface GLCapabilitiesImmutable
public void setAccumRedBits(int accumRedBits)
public final int getAccumGreenBits()
GLCapabilitiesImmutable
getAccumGreenBits
in interface GLCapabilitiesImmutable
public void setAccumGreenBits(int accumGreenBits)
public final int getAccumBlueBits()
GLCapabilitiesImmutable
getAccumBlueBits
in interface GLCapabilitiesImmutable
public void setAccumBlueBits(int accumBlueBits)
public final int getAccumAlphaBits()
GLCapabilitiesImmutable
getAccumAlphaBits
in interface GLCapabilitiesImmutable
public void setAccumAlphaBits(int accumAlphaBits)
public void setSampleExtension(String se)
GLCapabilitiesImmutable.DEFAULT_SAMPLE_EXTENSION
.public final String getSampleExtension()
GLCapabilitiesImmutable
GLCapabilitiesImmutable.DEFAULT_SAMPLE_EXTENSION
.getSampleExtension
in interface GLCapabilitiesImmutable
public void setSampleBuffers(boolean enable)
setAlphaBits(1)
if Capabilities.getAlphaBits()
== 0.public final boolean getSampleBuffers()
GLCapabilitiesImmutable
getSampleBuffers
in interface GLCapabilitiesImmutable
public void setNumSamples(int numSamples)
getNumSamples()
public final int getNumSamples()
GLCapabilitiesImmutable
getNumSamples
in interface GLCapabilitiesImmutable
public void setPbufferFloatingPointBuffers(boolean enable)
public final boolean getPbufferFloatingPointBuffers()
GLCapabilitiesImmutable
getPbufferFloatingPointBuffers
in interface GLCapabilitiesImmutable
public void setPbufferRenderToTexture(boolean enable)
public final boolean getPbufferRenderToTexture()
GLCapabilitiesImmutable
getPbufferRenderToTexture
in interface GLCapabilitiesImmutable
public void setPbufferRenderToTextureRectangle(boolean enable)
public final boolean getPbufferRenderToTextureRectangle()
GLCapabilitiesImmutable
getPbufferRenderToTextureRectangle
in interface GLCapabilitiesImmutable
public StringBuilder toString(StringBuilder sink)
CapabilitiesImmutable
toString
in interface CapabilitiesImmutable
toString
in class Capabilities
public String toString()
toString
in interface CapabilitiesImmutable
toString
in interface GLCapabilitiesImmutable
toString
in class Capabilities
Copyright 2010 JogAmp Community.