Class SoGLFormat
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.devices.SoGLFormat
-
- All Implemented Interfaces:
java.lang.Cloneable
public class SoGLFormat extends Inventor implements java.lang.Cloneable
OpenGL pixel format management class. This class provides functions to manage OpenGL pixel formats.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoGLFormat()
Default constructor -> we set the default format.SoGLFormat(SoGLFormat refFormat)
Constructor that initializes the format from the specified one.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
activate()
Tries to activate the format for the current display.java.lang.Object
clone()
int
getAccumBufferBits()
Returns the accumulation buffer bits of this format.int
getAlphaBits()
int
getBlueBits()
static SoGLFormat
getDefaultFormat()
Returns the default format used.int
getDepthBits()
Returns the depth buffer bits of this format.int
getGreenBits()
SoGLFormat
getNearest()
Returns the supported format which is the nearest available on this system.int
getRedBits()
int
getSamplesCount()
Returns the samples count of this format.int
getStencilBufferBits()
Returns the stencil buffer bits of this format.int
getVisualInfoId()
Returns the PFD associated with this visualInfo.boolean
hasAccumBuffer()
Returns true if this format has an accumulation buffer.boolean
hasAlpha()
Returns true if this format has an alpha channel.boolean
hasDepth()
Returns true if this format has a depth buffer.boolean
hasDoubleBuffers()
Returns true if this format is double buffered.boolean
hasFloatColorBuffer()
Returns true if this format has a float color buffer.boolean
hasRgb()
Returns true if this format is RGB.boolean
hasSampleBuffers()
Returns true if this format has sample buffers.boolean
hasStencilBuffer()
Returns true if this format has a stencil buffer.boolean
hasStereo()
Returns true if this format has stereo.boolean
isAccelerationRequired()
Returns true if hardware acceleration support is required for this pixel format.boolean
isAvailable()
Returns true if this format is available on the system.boolean
isCompositionRequired()
Returns true if composition is required for this pixel format.boolean
isGDISupportRequired()
Returns true if GDI support is required for this pixel format.boolean
isSoftwareRendererRequired()
Returns true if the software renderer is required for this format.void
setAccelerationRequired(boolean enable)
Sets the hardware acceleration support requirement of this pixel format.void
setAccumBufferBits(int size)
Sets the accumulation buffer bits of this format.void
setAccumBufferEnabled(boolean enabled)
Sets the accumulation buffer state of this format.void
setAlphaBits(int bits)
void
setAlphaEnabled(boolean enable)
Sets the alpha channel state of this format.void
setBlueBits(int bits)
void
setCompositionRequired(boolean required)
Sets the composition requirement of the pixel format.void
setDepthBits(int bits)
Sets the depth buffer bits of this format.void
setDepthEnabled(boolean enable)
Sets the depth buffer state of this format.void
setDoubleBuffersEnabled(boolean enabled)
Sets the double buffering state of this format.void
setFloatColorBufferEnabled(boolean enable)
Sets the Float color buffer state of this format.void
setGDISupportRequired(boolean required)
Sets the GDI support requirement of the pixel format.void
setGreenBits(int bits)
void
setRedBits(int bits)
void
setRgbEnabled(boolean enabled)
Sets the RGB state of this format.void
setSampleBuffersEnabled(boolean enable)
Sets the sample buffers state of this format.void
setSamplesCount(int countSamples)
Sets the samples count of this format.void
setSoftwareRendererRequired(boolean enable)
Specified that a software renderer is required for this format.void
setStencilBufferBits(int size)
Sets the stencil buffer bits of this format.void
setStencilBufferEnabled(boolean enabled)
Sets the stencil buffer state of this format.void
setStereoEnabled(boolean enable)
Sets the stereo state of this format.void
setVisualInfoId(int viId)
Sets the PFD id associated with this visualInfo.-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Constructor Detail
-
SoGLFormat
public SoGLFormat(SoGLFormat refFormat)
Constructor that initializes the format from the specified one.
-
SoGLFormat
public SoGLFormat()
Default constructor -> we set the default format.
-
-
Method Detail
-
clone
public java.lang.Object clone()
-
setDepthEnabled
public void setDepthEnabled(boolean enable)
Sets the depth buffer state of this format.
-
isAccelerationRequired
public boolean isAccelerationRequired()
Returns true if hardware acceleration support is required for this pixel format.
-
hasAlpha
public boolean hasAlpha()
Returns true if this format has an alpha channel.
-
setAccelerationRequired
public void setAccelerationRequired(boolean enable)
Sets the hardware acceleration support requirement of this pixel format.
-
getDepthBits
public int getDepthBits()
Returns the depth buffer bits of this format.
-
setGDISupportRequired
public void setGDISupportRequired(boolean required)
Sets the GDI support requirement of the pixel format.
This requirement is ignored on non-Microsoft platforms.Note: If both
setCompositionRequired()
andsetGDISupportRequired()
are set OpenInventor will try to choose a pixel format with composition support.The default value is true but setting composition required to true automatically disables GDI support.
-
setDepthBits
public void setDepthBits(int bits)
Sets the depth buffer bits of this format.
-
isGDISupportRequired
public boolean isGDISupportRequired()
Returns true if GDI support is required for this pixel format.
-
hasDepth
public boolean hasDepth()
Returns true if this format has a depth buffer.
-
isSoftwareRendererRequired
public boolean isSoftwareRendererRequired()
Returns true if the software renderer is required for this format.
-
getDefaultFormat
public static SoGLFormat getDefaultFormat()
Returns the default format used.
-
hasFloatColorBuffer
public boolean hasFloatColorBuffer()
Returns true if this format has a float color buffer.
-
hasDoubleBuffers
public boolean hasDoubleBuffers()
Returns true if this format is double buffered.
-
setVisualInfoId
public void setVisualInfoId(int viId)
Sets the PFD id associated with this visualInfo.
-
getVisualInfoId
public int getVisualInfoId()
Returns the PFD associated with this visualInfo.
-
setSoftwareRendererRequired
public void setSoftwareRendererRequired(boolean enable)
Specified that a software renderer is required for this format. This option is set to false by default. If this option is set to true it overridessetAccelerationRequired()
.
Note: This method is only implemented on Microsoft platforms in order to use the generic renderer provided by Microsoft.
Note: This option is currently checked only by the QtViewer classes (to switch on or off direct rendering).
-
setDoubleBuffersEnabled
public void setDoubleBuffersEnabled(boolean enabled)
Sets the double buffering state of this format.
-
isCompositionRequired
public boolean isCompositionRequired()
Returns true if composition is required for this pixel format.
-
setStencilBufferBits
public void setStencilBufferBits(int size)
Sets the stencil buffer bits of this format.
-
getRedBits
public int getRedBits()
-
hasStencilBuffer
public boolean hasStencilBuffer()
Returns true if this format has a stencil buffer.
-
setRedBits
public void setRedBits(int bits)
-
setAccumBufferEnabled
public void setAccumBufferEnabled(boolean enabled)
Sets the accumulation buffer state of this format.
-
hasRgb
public boolean hasRgb()
Returns true if this format is RGB.
-
getStencilBufferBits
public int getStencilBufferBits()
Returns the stencil buffer bits of this format.
-
setGreenBits
public void setGreenBits(int bits)
-
setFloatColorBufferEnabled
public void setFloatColorBufferEnabled(boolean enable)
Sets the Float color buffer state of this format.
-
setAlphaBits
public void setAlphaBits(int bits)
-
getAlphaBits
public int getAlphaBits()
-
getBlueBits
public int getBlueBits()
-
setStencilBufferEnabled
public void setStencilBufferEnabled(boolean enabled)
Sets the stencil buffer state of this format.
-
getGreenBits
public int getGreenBits()
-
setBlueBits
public void setBlueBits(int bits)
-
hasSampleBuffers
public boolean hasSampleBuffers()
Returns true if this format has sample buffers.
-
getNearest
public SoGLFormat getNearest()
Returns the supported format which is the nearest available on this system.
The display must be valid (see the setDisplay() function).
-
setSamplesCount
public void setSamplesCount(int countSamples)
Sets the samples count of this format.
-
activate
public boolean activate()
Tries to activate the format for the current display.
The display must be valid (see the setDisplay() function).
-
setAlphaEnabled
public void setAlphaEnabled(boolean enable)
Sets the alpha channel state of this format.
-
setCompositionRequired
public void setCompositionRequired(boolean required)
Sets the composition requirement of the pixel format.
This requirement is ignored on non-Microsoft platforms and on Windows platforms before Windows Vista. Requiring composition will automatically disable GDI support for this format (this is a Microsoft limitation).Note: If both
setCompositionRequired()
andsetGDISupportRequired()
are set OpenInventor will try to choose a pixel format with composition support.The default value is false but can be overridden using the OIV_PFD_SUPPORT_COMPOSITION preference (see
SoPreferences
).
-
setSampleBuffersEnabled
public void setSampleBuffersEnabled(boolean enable)
Sets the sample buffers state of this format.
-
isAvailable
public boolean isAvailable()
Returns true if this format is available on the system.
The display must be valid (see the setDisplay() function).
-
hasStereo
public boolean hasStereo()
Returns true if this format has stereo.
-
hasAccumBuffer
public boolean hasAccumBuffer()
Returns true if this format has an accumulation buffer.
-
setRgbEnabled
public void setRgbEnabled(boolean enabled)
Sets the RGB state of this format.
-
setAccumBufferBits
public void setAccumBufferBits(int size)
Sets the accumulation buffer bits of this format.
-
getSamplesCount
public int getSamplesCount()
Returns the samples count of this format.
-
getAccumBufferBits
public int getAccumBufferBits()
Returns the accumulation buffer bits of this format.
-
setStereoEnabled
public void setStereoEnabled(boolean enable)
Sets the stereo state of this format.
-
-