Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

OpenGLCache.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr
00003  *cr            (C) Copyright 1995-2008 The Board of Trustees of the
00004  *cr                        University of Illinois
00005  *cr                         All Rights Reserved
00006  *cr
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  * RCS INFORMATION:
00011  *
00012  *      $RCSfile: OpenGLCache.h,v $
00013  *      $Author: johns $        $Locker:  $             $State: Exp $
00014  *      $Revision: 1.6 $       $Date: 2008/03/27 19:36:41 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  *   Class to manage caching of OpenGL-related resources and handles
00019  ***************************************************************************/
00020 #ifndef OPENGLCACHE_H
00021 #define OPENGLCACHE_H
00022 
00023 #include <stdlib.h>
00024 #include "OpenGLExtensions.h"
00025 
00026 #define GLCACHE_FAIL 0
00027 
00031 class OpenGLCache {
00032 private:
00033   struct idlink {
00034     idlink *next;           
00035     int used;               
00036     const unsigned long id; 
00037     const GLuint gltag;     
00038 
00039     idlink(unsigned long theid, GLuint tag, idlink *thenext)
00040     : next(thenext), used(1), id(theid), gltag(tag) {}
00041   };
00042 
00043   idlink * cache;           
00044 
00045 public:
00046   OpenGLCache();
00047   ~OpenGLCache(); 
00048 
00049   void encache(unsigned long id, GLuint tag); 
00050   void markUnused();                 
00051   GLuint markUsed(unsigned long id); 
00052   GLuint deleteUnused();             
00053 };
00054 
00055 #endif

Generated on Thu Oct 9 01:26:13 2008 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002