net.java.games.jogl.impl

Class 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 String
getExtensionCorrespondingToFunction(String glFunctionName)
Returns the extension name that corresponds to the given extension function.
protected void
initAvailableExtensions()
boolean
isExtensionAvailable(String glExtensionName)
boolean
isFunctionAvailable(String glFunctionName)
protected boolean
isPartOfAvailableExtensions(String glFunctionName)
static boolean
isPartOfGLCore(String glVersionString, String glFunctionName)
Returns true if the given OpenGL function is part of the OpenGL core that corresponds to the give OpenGL version string.

Method Details

flush

public void flush()

getExtensionCorrespondingToFunction

protected static String getExtensionCorrespondingToFunction(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.

initAvailableExtensions

protected void initAvailableExtensions()

isExtensionAvailable

public boolean isExtensionAvailable(String glExtensionName)

isFunctionAvailable

public boolean isFunctionAvailable(String glFunctionName)

isPartOfAvailableExtensions

protected boolean isPartOfAvailableExtensions(String glFunctionName)

isPartOfGLCore

public static boolean isPartOfGLCore(String glVersionString,
                                     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