00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef GLDISPLAYLIST_H
00019 #define GLDISPLAYLIST_H
00020
00021 #include <GL/gl.h>
00022
00028 class GLDisplayList
00029 {
00030 GLuint listId;
00031 bool compiled;
00032
00033 public:
00034 GLDisplayList() { compiled = false;}
00035 ~GLDisplayList() {}
00036
00037 inline bool isCompiled()
00038 { return compiled; }
00039
00040 inline void del()
00041 { glDeleteLists(listId,1); compiled = false;}
00042
00043 inline void genList()
00044 { del(); listId = glGenLists(1); compiled = false;}
00045
00046 inline void compile()
00047 { compiled = true; glNewList(listId, GL_COMPILE); }
00048
00049 inline void compileAndExecute()
00050 { compiled = true; glNewList(listId, GL_COMPILE_AND_EXECUTE); }
00051
00052 inline void endCompile()
00053 { glEndList(); }
00054
00055 inline void execute()
00056 { glCallList(listId); }
00057 };
00058
00059 #endif