Class SoGLFormat

java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.devices.SoGLFormat
All Implemented Interfaces:
Cloneable

public class SoGLFormat extends Inventor implements Cloneable
OpenGL pixel format management class. This class provides functions to manage OpenGL pixel formats.
  • Constructor Details

    • 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 Details

    • clone

      public 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() and setGDISupportRequired() 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 overrides setAccelerationRequired().
      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() and setGDISupportRequired() 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.