com.sun.opengl.impl
Class FunctionAvailabilityCache

java.lang.Object
  extended by com.sun.opengl.impl.FunctionAvailabilityCache

public final class FunctionAvailabilityCache
extends java.lang.Object

A utility object intended to be used by implementations to act as a cache of which OpenGL functions are currently available on both the host machine and display.


Method Summary
 void flush()
          Flush the cache.
protected static java.lang.String getExtensionCorrespondingToFunction(java.lang.String glFunctionName)
          Returns the extension name that corresponds to the given extension function.
protected  void initAvailableExtensions()
           
 boolean isExtensionAvailable(java.lang.String glExtensionName)
           
 boolean isFunctionAvailable(java.lang.String glFunctionName)
           
protected  boolean isPartOfAvailableExtensions(java.lang.String glFunctionName)
           
static boolean isPartOfGLCore(java.lang.String glVersionString, java.lang.String glFunctionName)
          Returns true if the given OpenGL function is part of the OpenGL core that corresponds to the give OpenGL version string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

flush

public void flush()
Flush the cache. The cache will be rebuilt lazily as calls to isFunctionAvailable(String) are received.


isFunctionAvailable

public boolean isFunctionAvailable(java.lang.String glFunctionName)

isExtensionAvailable

public boolean isExtensionAvailable(java.lang.String glExtensionName)

initAvailableExtensions

protected void initAvailableExtensions()

isPartOfAvailableExtensions

protected boolean isPartOfAvailableExtensions(java.lang.String glFunctionName)

isPartOfGLCore

public static boolean isPartOfGLCore(java.lang.String glVersionString,
                                     java.lang.String glFunctionName)
Returns true if the given OpenGL function is part of the OpenGL core that corresponds to the give OpenGL version string.

Parameters:
glVersionString - must be of the form "X" or "X.Y" or "X.Y.Z", where X, Y, and Z are integers
Throws:
GLException - if the glFunctionName passed in is not the name of any known OpenGL extension function.

getExtensionCorrespondingToFunction

protected static java.lang.String getExtensionCorrespondingToFunction(java.lang.String glFunctionName)
Returns the extension name that corresponds to the given extension function. For example, it will return "GL_EXT_vertex_array" when the argument is "glNormalPointerEXT". Please see http://oss.sgi.com/projects/ogl-sample/registry/index.html for a list of extension names and the functions they expose.



Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.