00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef TEXTURECONTEXT_H
00016 #define TEXTURECONTEXT_H
00017
00018 #include "pandabase.h"
00019
00020 #include "bufferContext.h"
00021 #include "texture.h"
00022 #include "preparedGraphicsObjects.h"
00023 #include "adaptiveLru.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class EXPCL_PANDA_GOBJ TextureContext : public BufferContext, public AdaptiveLruPage {
00039 public:
00040 INLINE TextureContext(PreparedGraphicsObjects *pgo, Texture *tex, int view);
00041
00042 PUBLISHED:
00043 INLINE Texture *get_texture() const;
00044 INLINE int get_view() const;
00045
00046 INLINE bool was_modified() const;
00047 INLINE bool was_properties_modified() const;
00048 INLINE bool was_image_modified() const;
00049 INLINE bool was_simple_image_modified() const;
00050
00051 public:
00052 INLINE void update_data_size_bytes(size_t new_data_size_bytes);
00053 INLINE void mark_loaded();
00054 INLINE void mark_simple_loaded();
00055 INLINE void mark_unloaded();
00056 INLINE void mark_needs_reload();
00057
00058 virtual void output(ostream &out) const;
00059 virtual void write(ostream &out, int indent_level) const;
00060
00061 private:
00062
00063
00064
00065 Texture *_texture;
00066 int _view;
00067 UpdateSeq _properties_modified;
00068 UpdateSeq _image_modified;
00069 UpdateSeq _simple_image_modified;
00070
00071 public:
00072 static TypeHandle get_class_type() {
00073 return _type_handle;
00074 }
00075 static void init_type() {
00076 BufferContext::init_type();
00077 register_type(_type_handle, "TextureContext",
00078 BufferContext::get_class_type());
00079 }
00080 virtual TypeHandle get_type() const {
00081 return get_class_type();
00082 }
00083 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00084
00085 private:
00086 static TypeHandle _type_handle;
00087
00088 friend class PreparedGraphicsObjects;
00089 };
00090
00091 inline ostream &operator << (ostream &out, const TextureContext &context) {
00092 context.output(out);
00093 return out;
00094 }
00095
00096 #include "textureContext.I"
00097
00098 #endif
00099