com.partnersoft.gui.opengl
Class OpenglControl

java.lang.Object
  extended by com.partnersoft.gui.opengl.OpenglControl
Direct Known Subclasses:
SphericalImageDisplay

public class OpenglControl
extends java.lang.Object

A GUI control wrapper for a GL drawing surface.

Subclasses should implement display(GL, GLU)

Copyright 2009 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
OpenglControl()
           
OpenglControl(boolean heavyweight, boolean fsaa)
           
 
Method Summary
 OpenglFontHandle addFont(java.lang.String name, java.awt.Font font)
           
 OpenglTextureHandle addTexture(java.lang.String name, java.awt.image.BufferedImage image)
          Adds a textureHandle to this control's GL context, and returns the ID.
 OpenglTextureHandle addTexture(java.lang.String name, byte[] imageBytes, java.lang.String extension)
          Adds a textureHandle to this control's GL context, and returns the ID.
 OpenglTextureHandle addTexture(java.lang.String name, javax.swing.Icon icon)
          Adds a textureHandle to this control's GL context, and returns the ID.
 OpenglTextureHandle addTexture(java.lang.String name, VfsFile file)
          Adds a textureHandle to this control's GL context, and returns the ID.
 void clearTextures()
          Notifies the control to clear and remove all textures on the next display pass.
protected  void display(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu)
          This is the workhorse method.
 void errorCheck(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu)
           
 OpenglFontHandle fontNamed(java.lang.String name)
           
 javax.media.opengl.GLAutoDrawable getGLAutoDrawable()
           
 java.awt.Component getGui()
           
 boolean isAntialiased()
           
 boolean isHeavyweight()
           
 boolean isMipmapped()
           
 boolean isUsingFractionalMetrics()
           
 void logInfo(javax.media.opengl.GL gl)
           
 void setAntialiased(boolean antialiased)
           
 void setMipmapped(boolean mipmapped)
           
 void setUsingFractionalMetrics(boolean usingFractionalMetrics)
           
 OpenglTextureHandle textureNamed(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenglControl

public OpenglControl()

OpenglControl

public OpenglControl(boolean heavyweight,
                     boolean fsaa)
Method Detail

display

protected void display(javax.media.opengl.GL gl,
                       javax.media.opengl.glu.GLU glu)
This is the workhorse method. Override it with your specific GL commands.


addTexture

public OpenglTextureHandle addTexture(java.lang.String name,
                                      javax.swing.Icon icon)
Adds a textureHandle to this control's GL context, and returns the ID. If the name is already registered, returns that copy instead of creating a new one. Returns null if it fails for some reason.


addTexture

public OpenglTextureHandle addTexture(java.lang.String name,
                                      java.awt.image.BufferedImage image)
Adds a textureHandle to this control's GL context, and returns the ID. If the name is already registered, returns that copy instead of creating a new one. Returns null if it fails for some reason.


addTexture

public OpenglTextureHandle addTexture(java.lang.String name,
                                      VfsFile file)
Adds a textureHandle to this control's GL context, and returns the ID. If the name is already registered, returns that copy instead of creating a new one. Returns null if it fails for some reason.


addTexture

public OpenglTextureHandle addTexture(java.lang.String name,
                                      byte[] imageBytes,
                                      java.lang.String extension)
Adds a textureHandle to this control's GL context, and returns the ID. If the name is already registered, returns that copy instead of creating a new one. Returns null if it fails for some reason.


clearTextures

public void clearTextures()
Notifies the control to clear and remove all textures on the next display pass.


textureNamed

public OpenglTextureHandle textureNamed(java.lang.String name)

addFont

public OpenglFontHandle addFont(java.lang.String name,
                                java.awt.Font font)

fontNamed

public OpenglFontHandle fontNamed(java.lang.String name)

getGui

public java.awt.Component getGui()

getGLAutoDrawable

public javax.media.opengl.GLAutoDrawable getGLAutoDrawable()

errorCheck

public void errorCheck(javax.media.opengl.GL gl,
                       javax.media.opengl.glu.GLU glu)

logInfo

public void logInfo(javax.media.opengl.GL gl)

isHeavyweight

public boolean isHeavyweight()

isMipmapped

public boolean isMipmapped()

setMipmapped

public void setMipmapped(boolean mipmapped)

isAntialiased

public boolean isAntialiased()

setAntialiased

public void setAntialiased(boolean antialiased)

isUsingFractionalMetrics

public boolean isUsingFractionalMetrics()

setUsingFractionalMetrics

public void setUsingFractionalMetrics(boolean usingFractionalMetrics)