Panda3D
Loading...
Searching...
No Matches
bamEnums.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 bamEnums.h
10 * @author drose
11 * @date 2009-02-26
12 */
13
14#ifndef BAMENUMS_H
15#define BAMENUMS_H
16
17#include "pandabase.h"
18
19/**
20 * This class exists just to provide scoping for the enums shared by BamReader
21 * and BamWriter.
22 */
23class EXPCL_PANDA_PUTIL BamEnums {
24PUBLISHED:
25 /**
26 * This defines an enumerated type used to represent the endianness of
27 * certain numeric values stored in a Bam file. It really has only two
28 * possible values, either BE_bigendian or BE_littleendian; but through a
29 * preprocessor trick we also add BE_native, which is the same numerically
30 * as whichever value the hardware supports natively.
31 */
32 enum BamEndian {
33 BE_bigendian = 0,
34 BE_littleendian = 1,
35#ifdef WORDS_BIGENDIAN
36 BE_native = 0,
37#else
38 BE_native = 1,
39#endif
40 };
41
42 /**
43 * This is the code written along with each object. It is used to control
44 * object scoping.
45 */
47 // Indicates an object definition, and will always be eventually paired
48 // with a BOC_pop (which does not).
49 BOC_push,
50 BOC_pop,
51
52 // Includes an object definition but does not push the level; it is
53 // associated with the current level.
54 BOC_adjunct,
55
56 // Lists object IDs that have been deallocated on the sender end.
57 BOC_remove,
58
59 // May appear at any level and indicates the following datagram contains
60 // auxiliary file data that may be referenced by a later object.
61 BOC_file_data,
62 };
63
64 // This enum is used to control how textures are written to a bam stream.
65 enum BamTextureMode {
66 BTM_unchanged,
67 BTM_fullpath,
68 BTM_relative,
69 BTM_basename,
70 BTM_rawdata
71 };
72};
73
74EXPCL_PANDA_PUTIL std::ostream &operator << (std::ostream &out, BamEnums::BamEndian be);
75EXPCL_PANDA_PUTIL std::istream &operator >> (std::istream &in, BamEnums::BamEndian &be);
76
77EXPCL_PANDA_PUTIL std::ostream &operator << (std::ostream &out, BamEnums::BamObjectCode boc);
78
79EXPCL_PANDA_PUTIL std::ostream &operator << (std::ostream &out, BamEnums::BamTextureMode btm);
80EXPCL_PANDA_PUTIL std::istream &operator >> (std::istream &in, BamEnums::BamTextureMode &btm);
81
82#endif
This class exists just to provide scoping for the enums shared by BamReader and BamWriter.
Definition bamEnums.h:23
BamEndian
This defines an enumerated type used to represent the endianness of certain numeric values stored in ...
Definition bamEnums.h:32
BamObjectCode
This is the code written along with each object.
Definition bamEnums.h:46
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.