00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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