org.newdawn.slick.opengl.pbuffer
Class GraphicsFactory

java.lang.Object
  extended by org.newdawn.slick.opengl.pbuffer.GraphicsFactory

public class GraphicsFactory
extends java.lang.Object

A factory to produce an appropriate render to texture graphics context based on current hardware

Author:
kevin

Constructor Summary
GraphicsFactory()
           
 
Method Summary
static Graphics getGraphicsForImage(Image image)
          Get a graphics context for a particular image
static void releaseGraphicsForImage(Image image)
          Release any graphics context that is assocaited with the given image
static void setUseFBO(boolean useFBO)
          Force FBO use on or off
static boolean usingFBO()
          Check if we're using FBO for dynamic textures
static boolean usingPBuffer()
          Check if we're using PBuffer for dynamic textures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicsFactory

public GraphicsFactory()
Method Detail

setUseFBO

public static void setUseFBO(boolean useFBO)
Force FBO use on or off

Parameters:
useFBO - True if we should try and use FBO for offscreen images

usingFBO

public static boolean usingFBO()
Check if we're using FBO for dynamic textures

Returns:
True if we're using FBOs

usingPBuffer

public static boolean usingPBuffer()
Check if we're using PBuffer for dynamic textures

Returns:
True if we're using PBuffer

getGraphicsForImage

public static Graphics getGraphicsForImage(Image image)
                                    throws SlickException
Get a graphics context for a particular image

Parameters:
image - The image for which to retrieve the graphics context
Returns:
The graphics context
Throws:
SlickException - Indicates it wasn't possible to create a graphics context given available hardware.

releaseGraphicsForImage

public static void releaseGraphicsForImage(Image image)
                                    throws SlickException
Release any graphics context that is assocaited with the given image

Parameters:
image - The image to release
Throws:
SlickException - Indicates a failure to release the context


Copyright © 2006 New Dawn Software. All Rights Reserved.