00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef SO_GL_DIPLAY_LIST
00025 #define SO_GL_DIPLAY_LIST
00026
00027 #include <Inventor/SbBasic.h>
00028 #include <Inventor/sys/SoGLType.h>
00029
00030 #include <Inventor/devices/SoBaseContextObject.h>
00031
00032 #ifdef _MSC_VER
00033 #pragma warning( push )
00034 #pragma warning(disable:4251)
00035 #endif
00036
00037
00038 #ifndef GLhandle
00039 typedef unsigned long GLhandle;
00040 #endif
00041
00042 class SoGLRenderCache;
00043 class SoGLContext;
00044 class SoState;
00045
00062 SoEXTENDER_Documented class SoDEPRECATED SoGLDisplayList : public SoBaseContextObject
00063 {
00064 public:
00065
00066 enum Type
00067 {
00068 DISPLAY_LIST,
00069 TEXTURE1D_OBJECT,
00070 TEXTURE2D_OBJECT,
00071 TEXTURE2D_ARRAY_OBJECT,
00072 TEXTURE3D_OBJECT,
00073 TEXTURE_CUBE_MAP_OBJECT,
00074 FRAGMENT_PROGRAM_OBJECT,
00075 VERTEX_PROGRAM_OBJECT,
00076 TEXTURE_RECTANGLE_OBJECT,
00077 GLSL_FRAGMENT_SHADER_OBJECT,
00078 GLSL_VERTEX_SHADER_OBJECT,
00079 GLSL_GEOMETRY_SHADER_OBJECT,
00080 GLSL_PROGRAM_OBJECT,
00081 BUFFER_OBJECT,
00082 FRAMEBUFFER_OBJECT,
00083 ARRAY_BUFFER_OBJECT,
00084 ELEMENT_ARRAY_BUFFER_OBJECT,
00085 RENDERBUFFER_OBJECT,
00086 QUERY,
00087 GLSL_TESSELLATION_CONTROL_SHADER_OBJECT,
00088 GLSL_TESSELLATION_EVALUATION_SHADER_OBJECT,
00089 TRANSFORM_FEEDBACK
00090 };
00091
00102 SoGLDisplayList(SoState *state, Type type, int numToAllocate=1);
00103
00110 void open(SoState *state, int index = 0);
00111
00121 bool close(SoState *state);
00122
00134 void call(SoState *state, int index = 0);
00135
00140 void addDependency(SoState *state);
00141
00145 Type getType() { return type; }
00146
00150 int getNumAllocated() { return num; }
00151
00155 GLuint getFirstIndex() { return startIndex; }
00156
00160 SoGLRenderCache * getParentRenderCache()
00161 { return parentRenderCache; }
00162
00166 void setParentRenderCache(SoGLRenderCache *parent);
00167
00172 void setCompileAndExecute( SbBool flag );
00173
00174
00179 SbBool getCompileAndExecute() const;
00180
00181 private:
00182
00187 SoGLDisplayList(SoState *state);
00188
00192 static bool isDisplayListOpen();
00193
00197 uint64_t getUniqueId() const { return m_uniqueId; }
00198
00199 private:
00200
00201
00202 virtual ~SoGLDisplayList();
00203
00204 private:
00205 GLenum m_bufferObjectType;
00206
00207 SoGLRenderCache *parentRenderCache;
00208 Type type;
00209 GLuint startIndex;
00210 int num;
00211
00212
00213 GLenum newListMode;
00214
00215
00216 static SbThreadMutex s_classMutex;
00217 static uint64_t s_nextUniqueId;
00218 uint64_t m_uniqueId;
00219 };
00220
00221 #ifdef _MSC_VER
00222 #pragma warning( pop )
00223 #endif
00224
00225 #endif //SO_GL_DIPLAY_LIST
00226
00227
00228