00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef BUFFERCONTEXT_H
00016 #define BUFFERCONTEXT_H
00017
00018 #include "pandabase.h"
00019
00020 #include "savedContext.h"
00021 #include "updateSeq.h"
00022 #include "linkedListNode.h"
00023 #include "bufferContextChain.h"
00024 #include "bufferResidencyTracker.h"
00025
00026 class PreparedGraphicsObjects;
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 class EXPCL_PANDA_GOBJ BufferContext : public SavedContext, private LinkedListNode {
00042 public:
00043 BufferContext(BufferResidencyTracker *residency);
00044 virtual ~BufferContext();
00045
00046 PUBLISHED:
00047 INLINE size_t get_data_size_bytes() const;
00048 INLINE UpdateSeq get_modified() const;
00049 INLINE bool get_active() const;
00050 INLINE bool get_resident() const;
00051
00052 public:
00053 INLINE void set_active(bool flag);
00054 INLINE void set_resident(bool flag);
00055
00056 INLINE BufferContext *get_next() const;
00057
00058 INLINE void update_data_size_bytes(size_t new_data_size_bytes);
00059 INLINE void update_modified(UpdateSeq new_modified);
00060
00061 private:
00062 void set_owning_chain(BufferContextChain *chain);
00063
00064 private:
00065 BufferResidencyTracker *_residency;
00066 int _residency_state;
00067
00068 size_t _data_size_bytes;
00069 UpdateSeq _modified;
00070 BufferContextChain *_owning_chain;
00071
00072 public:
00073 static TypeHandle get_class_type() {
00074 return _type_handle;
00075 }
00076 static void init_type() {
00077 SavedContext::init_type();
00078 register_type(_type_handle, "BufferContext",
00079 SavedContext::get_class_type());
00080 }
00081 virtual TypeHandle get_type() const {
00082 return get_class_type();
00083 }
00084 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00085
00086 private:
00087 static TypeHandle _type_handle;
00088
00089 friend class PreparedGraphicsObjects;
00090 friend class BufferResidencyTracker;
00091 friend class BufferContextChain;
00092 };
00093
00094 #include "bufferContext.I"
00095
00096 #endif
00097