00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2019 The Board of Trustees of the 00004 *cr University of Illinois 00005 *cr All Rights Reserved 00006 *cr 00007 ***************************************************************************/ 00008 /*************************************************************************** 00009 * RCS INFORMATION: 00010 * 00011 * $RCSfile: OpenGLCache.h,v $ 00012 * $Author: johns $ $Locker: $ $State: Exp $ 00013 * $Revision: 1.11 $ $Date: 2020年02月26日 06:00:57 $ 00014 * 00015 ***************************************************************************/ 00021 #ifndef OPENGLCACHE_H 00022 #define OPENGLCACHE_H 00023 00024 #include <stdlib.h> 00025 #include "OpenGLExtensions.h" 00026 00027 #define GLCACHE_FAIL 0 00028 00032 class OpenGLCache { 00033 private: 00034 struct idlink { 00035 idlink *next; 00036 int used; 00037 const unsigned long id; 00038 const GLuint gltag; 00039 00040 idlink(unsigned long theid, GLuint tag, idlink *thenext) 00041 : next(thenext), used(1), id(theid), gltag(tag) {} 00042 }; 00043 00044 idlink * cache; 00045 00046 public: 00047 OpenGLCache(); 00048 ~OpenGLCache(); 00049 00050 void encache(unsigned long id, GLuint tag); 00051 void markUnused(); 00052 GLuint markUsed(unsigned long id); 00053 GLuint deleteUnused(); 00054 }; 00055 00056 #endif