Panda3D
Loading...
Searching...
No Matches
savedContext.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 savedContext.h
10 * @author drose
11 * @date 2001-06-11
12 */
13
14#ifndef SAVEDCONTEXT_H
15#define SAVEDCONTEXT_H
16
17#include "pandabase.h"
18
19#include "typedObject.h"
20
21/**
22 * This is the base class for all GSG-specific context objects, such as
23 * TextureContext and GeomContext. It exists mainly to provide some
24 * structural organization.
25 */
26class EXPCL_PANDA_GOBJ SavedContext : public TypedObject {
27public:
28 INLINE SavedContext();
29
30 virtual void output(std::ostream &out) const;
31 virtual void write(std::ostream &out, int indent_level) const;
32
33PUBLISHED:
34 static TypeHandle get_class_type() {
35 return _type_handle;
36 }
37public:
38 static void init_type() {
40 register_type(_type_handle, "SavedContext",
41 TypedObject::get_class_type());
42 }
43 virtual TypeHandle get_type() const {
44 return get_class_type();
45 }
46 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
47
48private:
49 static TypeHandle _type_handle;
50};
51
52inline std::ostream &operator << (std::ostream &out, const SavedContext &context) {
53 context.output(out);
54 return out;
55}
56
57#include "savedContext.I"
58
59#endif
This is the base class for all GSG-specific context objects, such as TextureContext and GeomContext.
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
Definition typedObject.h:88
static void init_type()
This function is declared non-inline to work around a compiler bug in g++ 2.96.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.