com.hermetica.magician
Class GLCapabilities

java.lang.Object
  |
  +--com.hermetica.magician.GLCapabilities

public class GLCapabilities
extends java.lang.Object
implements java.lang.Cloneable

The GLCapabilities class encapsulates the required format for a window that we wish to render onto, beit an X Visual, or a Win32 PIXELFORMATDESCRIPTOR. By using the GLCapabilities class, we can portably configure the settings for the required visual, which will then be tested to see if it is valid for the GLContext class it is attached to. The methods provided in this class need not all be used. Some methods may have no meaning under different types of window system, some are essentially X-specific, some Win32-specific. These will be ignored as required.

Version:
$Id: GLCapabilities.java,v 1.8 1999/07/20 21:44:35 descarte Exp descarte $
Author:
Alligator Descartes <descarte@arcana.co.uk>
See Also:
GLContext

Field Summary
static int COLOR_INDEX
          Colour-index colour
static int COLOUR_INDEX
          Colour-index colour
static int DOUBLEBUFFER
          Specify we want double-buffering
static int DRAW_TO_BITMAP
          Specify that we want to render to a window
static int DRAW_TO_WINDOW
          Specify that we want to render to a window
static int INDEXED
          Colour-index colour
static int MAIN_PLANE
          Specifies the main rendering plane
static int OVERLAY_PLANE
          Specifies that an overlay plane should be used
static int RGBA
          RGBA colour.
static int SINGLEBUFFER
          Specify that we don't want double-buffering
static int STEREO
          Specify that we want stereo rendering
static int STEREO_DONTCARE
          Specify that we don't care whether or not the target component context supports stereo rendering or not.
static int UNDERLAY_PLANE
          Specifies that an underlay plane should be used
static java.lang.String VERSION
          Version information
 
Constructor Summary
GLCapabilities()
           
 
Method Summary
static GLCapabilities[] enumerateCapabilities()
          Queries the underlying OpenGL implementation for all the possible visuals that are supported for the particular graphics cards
 int getAccumAlphaBits()
          Returns the number of alpha bit planes in the accumulation buffer
 int getAccumBits()
          Returns the number of bits in the accumulation buffer
 int getAccumBlueBits()
          Returns the number of blue bit planes in the accumulation buffer
 int getAccumGreenBits()
          Returns the number of green bit planes in the accumulation buffer
 int getAccumRedBits()
          Returns the number of red bit planes in the accumulation buffer
 int getAlphaBits()
          Returns the number of red bit planes in each RGBA buffer
 int getAlphaShift()
          Returns the alpha shift value
 int getAuxiliaryBuffers()
          Returns the number of auxiliary buffers
 int getBlueBits()
          Returns the number of blue bit planes in each RGBA buffer
 int getBlueShift()
          Returns the blue shift value
 int getColourBits()
          Returns the number of colour bit planes
 int getDepthBits()
          Returns the number of bits in the depth buffer
 int getDevice()
          Returns the device type that we have created a component with
 boolean getDirectRendering()
          Returns whether or not a direct rendering context is being used
 int getDoubleBuffered()
          Returns the current value of double-buffering in the component
 int getGreenBits()
          Returns the number of green bit planes in each RGBA buffer
 int getGreenShift()
          Returns the green shift value
 int getLayerType()
          Returns the type of rendering layer used by this visual
 int getPixelType()
          Returns the pixel type of the context
 int getRedBits()
          Returns the number of red bit planes in each RGBA buffer
 int getRedShift()
          Returns the red shift value
 int getStencilBits()
          Returns the number of bits in the stencil buffer
 int getStereo()
          Returns the current stereo rendering capabilities of the component
 boolean isLocked()
          Returns whether or not this capability object is locked, ie, the context associated with it has been created successfully.
 void setAccumAlphaBits(int numBits)
          Specifies the number of alpha bit planes in the accumulation buffer
 void setAccumBits(int numBits)
          Specifies the number of bits in the accumulation buffer
 void setAccumBlueBits(int numBits)
          Specifies the number of blue bit planes in the accumulation buffer
 void setAccumGreenBits(int numBits)
          Specifies the number of green bit planes in the accumulation buffer
 void setAccumRedBits(int numBits)
          Specifies the number of red bit planes in the accumulation buffer
 void setAlphaBits(int numBits)
          Sets the number of alpha bit planes in each RGBA buffer
 void setAlphaShift(int shift)
          Sets the shift count for alpha bit planes in each RGBA buffer.
 void setAuxiliaryBuffers(int numBuffers)
          Sets the number of auxiliary buffers
 void setBlueBits(int numBits)
          Sets the number of blue bit planes in each RGBA buffer
 void setBlueShift(int shift)
          Sets the shift count for blue bit planes in each RGBA buffer.
 void setColourBits(int numBits)
          Sets the number of desired colour bit planes
 void setDepthBits(int numBits)
          Sets the number of bits in the depth buffer
 void setDevice(int flags)
          Specifies to which device type we should render to
 void setDirectRendering(boolean isDirect)
          Sets whether or not a direct rendering context should be used
 void setDoubleBuffered(int flags)
          Specifies whether or not we want double-buffering
 void setGreenBits(int numBits)
          Sets the number of green bit planes in each RGBA buffer
 void setGreenShift(int shift)
          Sets the shift count for green bit planes in each RGBA buffer.
 void setLayerType(int layerType)
          Sets the type of rendering layer this visual should use
 void setPixelType(int flags)
          Specifies the pixel colour type for the component
 void setRedBits(int numBits)
          Sets the number of red bit planes in each RGBA buffer
 void setRedShift(int shift)
          Sets the shift count for red bit planes in each RGBA buffer.
 void setStencilBits(int numBits)
          Specifies the number of stencil bit planes in the stencil buffer
 void setStereo(int flags)
          Specifies the stereo rendering capabilities of the component
 java.lang.String toString()
          Displays the current settings of the capabilities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Version information

RGBA

public static final int RGBA
RGBA colour.
See Also:
setPixelType(int), getPixelType()

COLOUR_INDEX

public static final int COLOUR_INDEX
Colour-index colour
See Also:
setPixelType(int), getPixelType()

COLOR_INDEX

public static final int COLOR_INDEX
Colour-index colour
See Also:
setPixelType(int), getPixelType()

INDEXED

public static final int INDEXED
Colour-index colour
See Also:
setPixelType(int), getPixelType()

DOUBLEBUFFER

public static final int DOUBLEBUFFER
Specify we want double-buffering
See Also:
setDoubleBuffered(int), getDoubleBuffered(), SINGLEBUFFER

SINGLEBUFFER

public static final int SINGLEBUFFER
Specify that we don't want double-buffering
See Also:
setDoubleBuffered(int), getDoubleBuffered(), DOUBLEBUFFER

STEREO

public static final int STEREO
Specify that we want stereo rendering
See Also:
setStereo(int), getStereo(), STEREO_DONTCARE

STEREO_DONTCARE

public static final int STEREO_DONTCARE
Specify that we don't care whether or not the target component context supports stereo rendering or not.
See Also:
setStereo(int), getStereo(), STEREO

DRAW_TO_WINDOW

public static final int DRAW_TO_WINDOW
Specify that we want to render to a window
See Also:
setDevice(int), getDevice(), DRAW_TO_BITMAP

DRAW_TO_BITMAP

public static final int DRAW_TO_BITMAP
Specify that we want to render to a window
See Also:
setDevice(int), getDevice(), DRAW_TO_WINDOW

MAIN_PLANE

public static final int MAIN_PLANE
Specifies the main rendering plane

OVERLAY_PLANE

public static final int OVERLAY_PLANE
Specifies that an overlay plane should be used

UNDERLAY_PLANE

public static final int UNDERLAY_PLANE
Specifies that an underlay plane should be used
Constructor Detail

GLCapabilities

public GLCapabilities()
Method Detail

setPixelType

public final void setPixelType(int flags)
Specifies the pixel colour type for the component
See Also:
setPixelType(int), COLOUR_INDEX

getPixelType

public final int getPixelType()
Returns the pixel type of the context
See Also:
getPixelType(), RGBA

setDoubleBuffered

public final void setDoubleBuffered(int flags)
Specifies whether or not we want double-buffering
See Also:
getDoubleBuffered(), DOUBLEBUFFER, com.hermetica.magician.GLCapabilities#DOUBLEBUFFER_DONTCARE

getDoubleBuffered

public final int getDoubleBuffered()
Returns the current value of double-buffering in the component
See Also:
DOUBLEBUFFER, com.hermetica.magician.GLCapabilities#DOUBLEBUFFER_DONTCARE, getDoubleBuffered()

setStereo

public final void setStereo(int flags)
Specifies the stereo rendering capabilities of the component
See Also:
STEREO, STEREO_DONTCARE, getStereo()

getStereo

public final int getStereo()
Returns the current stereo rendering capabilities of the component
See Also:
STEREO, STEREO_DONTCARE, setStereo(int)

setDevice

public final void setDevice(int flags)
Specifies to which device type we should render to
See Also:
DRAW_TO_WINDOW, DRAW_TO_BITMAP, getDevice()

getDevice

public final int getDevice()
Returns the device type that we have created a component with
See Also:
DRAW_TO_WINDOW, DRAW_TO_BITMAP, setDevice(int)

setColourBits

public final void setColourBits(int numBits)
Sets the number of desired colour bit planes
See Also:
getColourBits()

getColourBits

public final int getColourBits()
Returns the number of colour bit planes
See Also:
setColourBits(int)

setRedBits

public final void setRedBits(int numBits)
Sets the number of red bit planes in each RGBA buffer
See Also:
getRedBits()

getRedBits

public final int getRedBits()
Returns the number of red bit planes in each RGBA buffer
See Also:
setRedBits(int)

setGreenBits

public final void setGreenBits(int numBits)
Sets the number of green bit planes in each RGBA buffer
See Also:
getGreenBits()

getGreenBits

public final int getGreenBits()
Returns the number of green bit planes in each RGBA buffer
See Also:
setGreenBits(int)

setBlueBits

public final void setBlueBits(int numBits)
Sets the number of blue bit planes in each RGBA buffer
See Also:
getBlueBits()

getBlueBits

public final int getBlueBits()
Returns the number of blue bit planes in each RGBA buffer
See Also:
setBlueBits(int)

setAlphaBits

public final void setAlphaBits(int numBits)
Sets the number of alpha bit planes in each RGBA buffer
See Also:
getAlphaBits()

getAlphaBits

public final int getAlphaBits()
Returns the number of red bit planes in each RGBA buffer
See Also:
setRedBits(int)

setRedShift

public final void setRedShift(int shift)
Sets the shift count for red bit planes in each RGBA buffer. This specifies where the red bits can be found in the colour buffer, for example, in an 8-bit, 256-colour visual, the last two bits in an 8-bit colour value are usually the two used for blue bit planes, therefore, the shift value will be 6.
See Also:
getRedShift()

getRedShift

public final int getRedShift()
Returns the red shift value
See Also:
setRedShift(int)

setGreenShift

public final void setGreenShift(int shift)
Sets the shift count for green bit planes in each RGBA buffer. This specifies where the green bits can be found in the colour buffer, for example, in an 8-bit, 256-colour visual, the last two bits in an 8-bit colour value are usually the two used for blue bit planes, therefore, the shift value will be 6.
See Also:
getGreenShift()

getGreenShift

public final int getGreenShift()
Returns the green shift value
See Also:
setGreenShift(int)

setBlueShift

public final void setBlueShift(int shift)
Sets the shift count for blue bit planes in each RGBA buffer. This specifies where the blue bits can be found in the colour buffer, for example, in an 8-bit, 256-colour visual, the last two bits in an 8-bit colour value are usually the two used for blue bit planes, therefore, the shift value will be 6.
See Also:
getBlueShift()

getBlueShift

public final int getBlueShift()
Returns the blue shift value
See Also:
setBlueShift(int)

setAlphaShift

public final void setAlphaShift(int shift)
Sets the shift count for alpha bit planes in each RGBA buffer. This specifies where the alpha bits can be found in the colour buffer, for example, in an 8-bit, 256-colour visual, the last two bits in an 8-bit colour value are usually the two used for blue bit planes, therefore, the shift value will be 6.
See Also:
getAlphaShift()

getAlphaShift

public final int getAlphaShift()
Returns the alpha shift value
See Also:
setAlphaShift(int)

setAccumBits

public final void setAccumBits(int numBits)
Specifies the number of bits in the accumulation buffer
See Also:
getAccumBits()

getAccumBits

public final int getAccumBits()
Returns the number of bits in the accumulation buffer
See Also:
setAccumBits(int)

setAccumRedBits

public final void setAccumRedBits(int numBits)
Specifies the number of red bit planes in the accumulation buffer
See Also:
getAccumRedBits()

getAccumRedBits

public final int getAccumRedBits()
Returns the number of red bit planes in the accumulation buffer
See Also:
setAccumRedBits(int)

setAccumGreenBits

public final void setAccumGreenBits(int numBits)
Specifies the number of green bit planes in the accumulation buffer
See Also:
getAccumGreenBits()

getAccumGreenBits

public final int getAccumGreenBits()
Returns the number of green bit planes in the accumulation buffer
See Also:
setAccumGreenBits(int)

setAccumBlueBits

public final void setAccumBlueBits(int numBits)
Specifies the number of blue bit planes in the accumulation buffer
See Also:
getAccumBlueBits()

getAccumBlueBits

public final int getAccumBlueBits()
Returns the number of blue bit planes in the accumulation buffer
See Also:
setAccumBlueBits(int)

setAccumAlphaBits

public final void setAccumAlphaBits(int numBits)
Specifies the number of alpha bit planes in the accumulation buffer
See Also:
getAccumAlphaBits()

getAccumAlphaBits

public final int getAccumAlphaBits()
Returns the number of alpha bit planes in the accumulation buffer
See Also:
setAccumAlphaBits(int)

setStencilBits

public final void setStencilBits(int numBits)
Specifies the number of stencil bit planes in the stencil buffer
See Also:
getStencilBits()

getStencilBits

public final int getStencilBits()
Returns the number of bits in the stencil buffer
See Also:
setStencilBits(int)

setDepthBits

public final void setDepthBits(int numBits)
Sets the number of bits in the depth buffer
See Also:
getDepthBits()

getDepthBits

public final int getDepthBits()
Returns the number of bits in the depth buffer
See Also:
setDepthBits(int)

setAuxiliaryBuffers

public final void setAuxiliaryBuffers(int numBuffers)
Sets the number of auxiliary buffers
See Also:
getAuxiliaryBuffers()

getAuxiliaryBuffers

public final int getAuxiliaryBuffers()
Returns the number of auxiliary buffers
See Also:
setAuxiliaryBuffers(int)

setLayerType

public final void setLayerType(int layerType)
Sets the type of rendering layer this visual should use
See Also:
getLayerType(), MAIN_PLANE, OVERLAY_PLANE, UNDERLAY_PLANE

getLayerType

public final int getLayerType()
Returns the type of rendering layer used by this visual
See Also:
setLayerType(int), MAIN_PLANE, OVERLAY_PLANE, UNDERLAY_PLANE

isLocked

public final boolean isLocked()
Returns whether or not this capability object is locked, ie, the context associated with it has been created successfully.
See Also:
GLContext

setDirectRendering

public final void setDirectRendering(boolean isDirect)
Sets whether or not a direct rendering context should be used

Parameters:
isDirect - Specifies whether or not a direct rendering context should be used

getDirectRendering

public final boolean getDirectRendering()
Returns whether or not a direct rendering context is being used

enumerateCapabilities

public static final GLCapabilities[] enumerateCapabilities()
Queries the underlying OpenGL implementation for all the possible visuals that are supported for the particular graphics cards


toString

public java.lang.String toString()
Displays the current settings of the capabilities
Overrides:
toString in class java.lang.Object