com.jogamp.opengl
Class FBObject.Attachment

java.lang.Object
  extended by com.jogamp.opengl.FBObject.Attachment
Direct Known Subclasses:
FBObject.RenderAttachment, FBObject.TextureAttachment
Enclosing class:
FBObject

public abstract static class FBObject.Attachment
extends Object

Common super class of all attachments


Nested Class Summary
static class FBObject.Attachment.Type
           
 
Field Summary
 int format
          immutable the internal format
 FBObject.Attachment.Type type
          immutable type [#COLOR, #DEPTH, #STENCIL, #COLOR_TEXTURE, #DEPTH_TEXTURE, #STENCIL_TEXTURE ]
 
Method Summary
 boolean equals(Object o)
           Comparison by type, format, width, height and name.
 void formatToGLCapabilities(GLCapabilities caps, boolean rgba8Avail)
          Writes the internal format to the given GLCapabilities object.
abstract  void free(GL gl)
          Releases the attachment if initialized, i.e.
 int getHeight()
          height of attachment
 int getName()
          buffer name [1..max], maybe a texture or renderbuffer name, depending on type.
static FBObject.Attachment.Type getType(int attachmentPoint, int maxColorAttachments)
           
 int getWidth()
          width of attachment
 int hashCode()
           Hashed by type, format, width, height and name.
abstract  boolean initialize(GL gl)
          Initializes the attachment and set it's parameter, if uninitialized, i.e.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

type

public final FBObject.Attachment.Type type
immutable type [#COLOR, #DEPTH, #STENCIL, #COLOR_TEXTURE, #DEPTH_TEXTURE, #STENCIL_TEXTURE ]


format

public final int format
immutable the internal format

Method Detail

formatToGLCapabilities

public final void formatToGLCapabilities(GLCapabilities caps,
                                         boolean rgba8Avail)
Writes the internal format to the given GLCapabilities object.

Parameters:
caps - the destination for format bits
rgba8Avail - whether rgba8 is available

getWidth

public final int getWidth()
width of attachment


getHeight

public final int getHeight()
height of attachment


getName

public final int getName()
buffer name [1..max], maybe a texture or renderbuffer name, depending on type.


initialize

public abstract boolean initialize(GL gl)
                            throws GLException
Initializes the attachment and set it's parameter, if uninitialized, i.e. name is zero.
            final boolean init = 0 == name;
            if( init ) {
                do init ..
            }
            return init;
 

Returns:
true if newly initialized, otherwise false.
Throws:
GLException - if buffer generation or setup fails. The just created buffer name will be deleted in this case.

free

public abstract void free(GL gl)
                   throws GLException
Releases the attachment if initialized, i.e. name is not zero.
            if(0 != name) {
                do free ..
                name = 0;
            }
 

Throws:
GLException - if buffer release fails.

equals

public boolean equals(Object o)

Comparison by type, format, width, height and name.

Overrides:
equals in class Object

hashCode

public int hashCode()

Hashed by type, format, width, height and name.

Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getType

public static FBObject.Attachment.Type getType(int attachmentPoint,
                                               int maxColorAttachments)


Copyright 2010 JogAmp Community.