Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gl4java
Class GLCapabilities  view GLCapabilities download GLCapabilities.java

java.lang.Object
  extended bygl4java.GLCapabilities
All Implemented Interfaces:
java.lang.Cloneable

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

Specifies a set of OpenGL capabilities that a rendering context must support, such as color depth and whether stereo is enabled. It currently contains the minimal number of routines which allow configuration on all supported window systems.


Field Summary
private  int accumAlphaBits
           
private  int accumBlueBits
           
private  int accumGreenBits
           
private  int accumRedBits
           
private  int alphaBits
           
private  int blueBits
           
private  int buffer
           
private static int BUFFER_DOUBLE
           
private static int BUFFER_SINGLE
           
private  int color
           
private static int COLOR_INDEX
           
private static int COLOR_RGBA
           
private  int depthBits
           
private  int fullscreen
           
private static int FULLSCREEN_OFF
           
private static int FULLSCREEN_ON
           
private  int greenBits
           
private  long nativeVisualID
          this is the holder for the native visualID, e.g.
private  int redBits
           
private  int stencilBits
           
private  int stereo
           
private static int STEREO_OFF
           
private static int STEREO_ON
           
 
Constructor Summary
GLCapabilities()
          Creates a GLCapabilities object.
GLCapabilities(boolean doubleBuffer, boolean stereoView, boolean rgba, int stencilBits, int accumRedSize, int accumGreenSize, int accumBlueSize, int accumAlphaSize)
          Creates a GLCapabilities object.
 
Method Summary
 java.lang.Object clone()
          This method may be called to create a new copy of the Object.
 int getAccumAlphaBits()
          Returns number of bits requested for accumulation buffer's alpha component.
 int getAccumBlueBits()
          Returns number of bits requested for accumulation buffer's blue component.
 int getAccumGreenBits()
          Returns number of bits requested for accumulation buffer's green component.
 int getAccumRedBits()
          Returns number of bits requested for accumulation buffer's red component.
 int getAlphaBits()
          Returns number of bits requested for color buffer's alpha component.
 int getBlueBits()
          Returns number of bits requested for color buffer's blue component.
 int getDepthBits()
          Returns number of bits requested for depth buffer
 boolean getDoubleBuffered()
          Indicates whether double-buffering is enabled.
 int getGreenBits()
          Returns number of bits requested for color buffer's green component.
 long getNativeVisualID()
          Get the fetched native VisualID.
 int getRedBits()
          Returns number of bits requested for color buffer's red component.
 int getStencilBits()
          Returns number of bits requested for stencil buffer
 boolean getStereo()
          Indicates whether stereo is enabled.
 boolean getTrueColor()
          Indicates whether true color (as opposed to indexed color) is enabled.
static void main(java.lang.String[] args)
           
 void setAccumAlphaBits(int accumAlphaBits)
          Sets number of bits requested for accumulation buffer's alpha component.
 void setAccumBlueBits(int accumBlueBits)
          Sets number of bits requested for accumulation buffer's blue component.
 void setAccumGreenBits(int accumGreenBits)
          Sets number of bits requested for accumulation buffer's green component.
 void setAccumRedBits(int accumRedBits)
          Sets number of bits requested for accumulation buffer's red component.
 void setAlphaBits(int alphaBits)
          Sets number of bits requested for color buffer's alpha component.
 void setBlueBits(int blueBits)
          Sets number of bits requested for color buffer's blue component.
 void setDepthBits(int depthBits)
          Sets number of bits requested for depth buffer
 void setDoubleBuffered(boolean onOrOff)
          Enables or disables double buffering.
 void setGreenBits(int greenBits)
          Sets number of bits requested for color buffer's green component.
 void setNativeVisualID(long id)
          Set the fetched native VisualID.
 void setRedBits(int redBits)
          Sets number of bits requested for color buffer's red component.
 void setStencilBits(int stencilBits)
          Sets number of bits requested for stencil buffer
 void setStereo(boolean onOrOff)
          Enables or disables stereo viewing.
 void setTrueColor(boolean onOrOff)
          Enables or disables true color (RGBA mode).
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BUFFER_SINGLE

private static final int BUFFER_SINGLE
See Also:
Constant Field Values

BUFFER_DOUBLE

private static final int BUFFER_DOUBLE
See Also:
Constant Field Values

COLOR_INDEX

private static final int COLOR_INDEX
See Also:
Constant Field Values

COLOR_RGBA

private static final int COLOR_RGBA
See Also:
Constant Field Values

STEREO_OFF

private static final int STEREO_OFF
See Also:
Constant Field Values

STEREO_ON

private static final int STEREO_ON
See Also:
Constant Field Values

FULLSCREEN_OFF

private static final int FULLSCREEN_OFF
See Also:
Constant Field Values

FULLSCREEN_ON

private static final int FULLSCREEN_ON
See Also:
Constant Field Values

buffer

private int buffer

color

private int color

stereo

private int stereo

fullscreen

private int fullscreen

depthBits

private int depthBits

stencilBits

private int stencilBits

redBits

private int redBits

greenBits

private int greenBits

blueBits

private int blueBits

alphaBits

private int alphaBits

accumRedBits

private int accumRedBits

accumGreenBits

private int accumGreenBits

accumBlueBits

private int accumBlueBits

accumAlphaBits

private int accumAlphaBits

nativeVisualID

private long nativeVisualID
this is the holder for the native visualID, e.g. Win32's number of the PIXELFORMATDESC, or X11's VisualID

Constructor Detail

GLCapabilities

public GLCapabilities(boolean doubleBuffer,
                      boolean stereoView,
                      boolean rgba,
                      int stencilBits,
                      int accumRedSize,
                      int accumGreenSize,
                      int accumBlueSize,
                      int accumAlphaSize)
Creates a GLCapabilities object. All attributes are in a default state, they can be configured by the client. The arguments are the usual user defined capabilities, which can be set here for construction.


GLCapabilities

public GLCapabilities()
Creates a GLCapabilities object. All attributes are in a default state, they can be configured by the client.

Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: java.lang.Object
This method may be called to create a new copy of the Object. The typical behavior is as follows:
  • o == o.clone() is false
  • o.getClass() == o.clone().getClass() is true
  • o.equals(o) is true

However, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override Object.equals(Object)>Object.equals(Object) 55 .

If the Object you call clone() on does not implement java.lang.Cloneable (which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.

Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.

All array types implement Cloneable, and override this method as follows (it should never fail):

 public Object clone()
 {
   try
     {
       super.clone();
     }
   catch (CloneNotSupportedException e)
     {
       throw new InternalError(e.getMessage());
     }
 }
 


getDoubleBuffered

public boolean getDoubleBuffered()
Indicates whether double-buffering is enabled.


getTrueColor

public boolean getTrueColor()
Indicates whether true color (as opposed to indexed color) is enabled.


getStereo

public boolean getStereo()
Indicates whether stereo is enabled.


setDoubleBuffered

public void setDoubleBuffered(boolean onOrOff)
Enables or disables double buffering.


setTrueColor

public void setTrueColor(boolean onOrOff)
Enables or disables true color (RGBA mode).


setStereo

public void setStereo(boolean onOrOff)
Enables or disables stereo viewing.


getDepthBits

public int getDepthBits()
Returns number of bits requested for depth buffer


setDepthBits

public void setDepthBits(int depthBits)
Sets number of bits requested for depth buffer


getStencilBits

public int getStencilBits()
Returns number of bits requested for stencil buffer


setStencilBits

public void setStencilBits(int stencilBits)
Sets number of bits requested for stencil buffer


getRedBits

public int getRedBits()
Returns number of bits requested for color buffer's red component. On some systems and in color index mode only the color depth, which is the sum of the red, green, and blue bits, is considered.


setRedBits

public void setRedBits(int redBits)
Sets number of bits requested for color buffer's red component. On some systems and in color index mode only the color depth, which is the sum of the red, green, and blue bits, is considered.


getGreenBits

public int getGreenBits()
Returns number of bits requested for color buffer's green component. On some systems and in color index mode only the color depth, which is the sum of the red, green, and blue bits, is considered.


setGreenBits

public void setGreenBits(int greenBits)
Sets number of bits requested for color buffer's green component. On some systems and in color index mode only the color depth, which is the sum of the red, green, and blue bits, is considered.


getBlueBits

public int getBlueBits()
Returns number of bits requested for color buffer's blue component. On some systems and in color index mode only the color depth, which is the sum of the red, green, and blue bits, is considered.


setBlueBits

public void setBlueBits(int blueBits)
Sets number of bits requested for color buffer's blue component. On some systems and in color index mode only the color depth, which is the sum of the red, green, and blue bits, is considered.


getAlphaBits

public int getAlphaBits()
Returns number of bits requested for color buffer's alpha component. On some systems and in color index mode only the color depth, which is the sum of the red, green, and blue bits, is considered.


setAlphaBits

public void setAlphaBits(int alphaBits)
Sets number of bits requested for color buffer's alpha component. On some systems and in color index mode only the color depth, which is the sum of the red, green, and blue bits, is considered.


getAccumRedBits

public int getAccumRedBits()
Returns number of bits requested for accumulation buffer's red component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.


setAccumRedBits

public void setAccumRedBits(int accumRedBits)
Sets number of bits requested for accumulation buffer's red component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.


getAccumGreenBits

public int getAccumGreenBits()
Returns number of bits requested for accumulation buffer's green component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.


setAccumGreenBits

public void setAccumGreenBits(int accumGreenBits)
Sets number of bits requested for accumulation buffer's green component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.


getAccumBlueBits

public int getAccumBlueBits()
Returns number of bits requested for accumulation buffer's blue component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.


setAccumBlueBits

public void setAccumBlueBits(int accumBlueBits)
Sets number of bits requested for accumulation buffer's blue component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.


getAccumAlphaBits

public int getAccumAlphaBits()
Returns number of bits requested for accumulation buffer's alpha component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.


setAccumAlphaBits

public void setAccumAlphaBits(int accumAlphaBits)
Sets number of bits requested for accumulation buffer's alpha component. On some systems only the accumulation buffer depth, which is the sum of the red, green, and blue bits, is considered.


setNativeVisualID

public void setNativeVisualID(long id)
Set the fetched native VisualID. This is an interface for the Factory and GLContext. Because the GLCapabilities are copied through the handling between the Factory and GLContext, you cannot missuse it .. this is the holder for the native visualID, e.g. Win32's number of the PIXELFORMATDESC, or X11's VisualID


getNativeVisualID

public long getNativeVisualID()
Get the fetched native VisualID. This is an interface for the Factory and GLContext. this is the holder for the native visualID, e.g. Win32's number of the PIXELFORMATDESC, or X11's VisualID


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


main

public static void main(java.lang.String[] args)