com.xith3d.render.jogl
Class PBufferCanvasPeer

java.lang.Object
  extended by CanvasPeerImpl
      extended by com.xith3d.render.jogl.PBufferCanvasPeer

public class PBufferCanvasPeer
extends CanvasPeerImpl

Author:
Nicolas Brodu This CanvasPeer renders into an Image made from a pbuffer => uses hardware acceleration Note that since is is copied back to an image, this is probably not what you want to make fast games. On the other hand, if all you want is visualize large scenes requirering HW rendering to compute, and with a nice Swing interface all around, this maybe worth a look. This canvas only renders the scene when updateImage is called. It will not render the scene when View.renderOnce() is called. TODO: Many improvements. Main idea would be to write directly to a VolatileImage. Indeed, as it is now, the rendering happens on a pbuffer in vram. But instead of a direct vram->vram operation as could be expected with a VolatileImage, the BufferedImage used here does vram->ram and then will do ram->vram again probably when the user displays the image. What a mess!

Field Summary
protected  PBufferCanvas3D c3d
           
protected static GLContext ctx
           
protected  GLCapabilities glc
           
protected  boolean initialized
           
protected  GLPbufferImpl pbuffer
           
protected  boolean refreshing
           
protected  DirectBufferedImage snapshotImage
           
protected  java.lang.String title
           
 
Constructor Summary
PBufferCanvasPeer(PBufferCanvas3D c3d, RenderPeer renderPeer, java.lang.Object owner, int width, int height, int bits, boolean fullScreen, GLCapabilities gc)
           
 
Method Summary
 void display(GLDrawable drawable)
           
 java.awt.image.BufferedImage getLastImage()
           
 java.awt.Point getLocation()
          
 java.awt.Dimension getSize()
          
 java.lang.String getTitle()
          
 void init()
           
static void initContext(java.lang.Object owner)
           
 boolean isInitialized()
           
 void render(RenderFrame frame)
           
 void renderDebug(RenderFrame frame, java.lang.String logfile)
           
 void setLocation(int x, int y)
          
 void setLocation(java.awt.Point p)
          
 void setSize(java.awt.Dimension d)
          
 void setSize(int width, int height)
          
 void setTitle(java.lang.String title)
           
 java.awt.image.BufferedImage updateImage()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pbuffer

protected GLPbufferImpl pbuffer

ctx

protected static GLContext ctx

glc

protected GLCapabilities glc

title

protected java.lang.String title

refreshing

protected boolean refreshing

snapshotImage

protected DirectBufferedImage snapshotImage

c3d

protected PBufferCanvas3D c3d

initialized

protected boolean initialized
Constructor Detail

PBufferCanvasPeer

public PBufferCanvasPeer(PBufferCanvas3D c3d,
                         RenderPeer renderPeer,
                         java.lang.Object owner,
                         int width,
                         int height,
                         int bits,
                         boolean fullScreen,
                         GLCapabilities gc)
                  throws java.lang.RuntimeException
Throws:
java.lang.RuntimeException
Method Detail

initContext

public static void initContext(java.lang.Object owner)

isInitialized

public boolean isInitialized()

display

public void display(GLDrawable drawable)

init

public void init()

render

public void render(RenderFrame frame)

renderDebug

public void renderDebug(RenderFrame frame,
                        java.lang.String logfile)

updateImage

public java.awt.image.BufferedImage updateImage()

getLastImage

public java.awt.image.BufferedImage getLastImage()

setTitle

public void setTitle(java.lang.String title)
See Also:
CanvasPeer#setTitle

getTitle

public java.lang.String getTitle()


setSize

public void setSize(int width,
                    int height)


setSize

public void setSize(java.awt.Dimension d)


getSize

public java.awt.Dimension getSize()


setLocation

public void setLocation(int x,
                        int y)


setLocation

public void setLocation(java.awt.Point p)


getLocation

public java.awt.Point getLocation()