Panda3D
 All Classes Functions Variables Enumerations
bufferContextChain.h
1 // Filename: bufferContextChain.h
2 // Created by: drose (16Mar06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef BUFFERCONTEXTCHAIN_H
16 #define BUFFERCONTEXTCHAIN_H
17 
18 #include "pandabase.h"
19 #include "linkedListNode.h"
20 
21 class BufferContext;
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : BufferContextChain
25 // Description : This class maintains a linked list of BufferContexts
26 // that might be allocated on the graphics card in some
27 // context. There is a different BufferContextChain for
28 // resident textures, active textures, evicted textures,
29 // etc.
30 //
31 // The primary purpose of this class is to facilitate
32 // PStats reporting of graphics memory usage.
33 ////////////////////////////////////////////////////////////////////
34 class EXPCL_PANDA_GOBJ BufferContextChain : private LinkedListNode {
35 public:
36  INLINE BufferContextChain();
37  INLINE ~BufferContextChain();
38 
39  INLINE size_t get_total_size() const;
40  INLINE int get_count() const;
41 
42  BufferContext *get_first();
43 
44  void take_from(BufferContextChain &other);
45 
46  void write(ostream &out, int indent_level) const;
47 
48 private:
49  INLINE void adjust_bytes(int delta);
50  size_t _total_size;
51  int _count;
52 
53  friend class BufferContext;
54 };
55 
56 #include "bufferContextChain.I"
57 
58 #endif
59 
This is a base class for those kinds of SavedContexts that occupy an easily-measured (and substantial...
Definition: bufferContext.h:41
This just stores the pointers to implement a doubly-linked list of some kind of object.
This class maintains a linked list of BufferContexts that might be allocated on the graphics card in ...