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