Panda3D
Loading...
Searching...
No Matches
antialiasAttrib.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 antialiasAttrib.h
10 * @author drose
11 * @date 2005-01-26
12 */
13
14#ifndef ANTIALIASATTRIB_H
15#define ANTIALIASATTRIB_H
16
17#include "pandabase.h"
18
19#include "renderAttrib.h"
20
21class FactoryParams;
22
23/**
24 * Specifies whether or how to enable antialiasing, if supported by the
25 * backend renderer.
26 */
27class EXPCL_PANDA_PGRAPH AntialiasAttrib : public RenderAttrib {
28PUBLISHED:
29 enum Mode {
30 M_none = 0x0000,
31 M_point = 0x0001,
32 M_line = 0x0002,
33 M_polygon = 0x0004,
34 M_multisample = 0x0008,
35 M_auto = 0x001f,
36 M_type_mask = 0x001f,
37
38 // Extra add-on bits for performancequality hints.
39 M_faster = 0x0020,
40 M_better = 0x0040,
41 M_dont_care = 0x0060,
42 };
43
44private:
45 INLINE AntialiasAttrib(unsigned short mode);
46
47PUBLISHED:
48 static CPT(RenderAttrib) make(unsigned short mode);
49 static CPT(RenderAttrib) make_default();
50
51 INLINE unsigned short get_mode() const;
52 INLINE unsigned short get_mode_type() const;
53 INLINE unsigned short get_mode_quality() const;
54
55PUBLISHED:
56 MAKE_PROPERTY(mode, get_mode);
57 MAKE_PROPERTY(mode_type, get_mode_type);
58 MAKE_PROPERTY(mode_quality, get_mode_quality);
59
60public:
61 virtual void output(std::ostream &out) const;
62
63protected:
64 virtual int compare_to_impl(const RenderAttrib *other) const;
65 virtual size_t get_hash_impl() const;
66 virtual CPT(RenderAttrib) compose_impl(const RenderAttrib *other) const;
67
68private:
69 unsigned short _mode;
70
71PUBLISHED:
72 static int get_class_slot() {
73 return _attrib_slot;
74 }
75 virtual int get_slot() const {
76 return get_class_slot();
77 }
78 MAKE_PROPERTY(class_slot, get_class_slot);
79
80public:
81 static void register_with_read_factory();
82 virtual void write_datagram(BamWriter *manager, Datagram &dg);
83
84protected:
85 static TypedWritable *make_from_bam(const FactoryParams &params);
86 void fillin(DatagramIterator &scan, BamReader *manager);
87
88public:
89 static TypeHandle get_class_type() {
90 return _type_handle;
91 }
92 static void init_type();
93 virtual TypeHandle get_type() const {
94 return get_class_type();
95 }
96 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
97
98private:
99 static TypeHandle _type_handle;
100 static int _attrib_slot;
101};
102
103#include "antialiasAttrib.I"
104
105#endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_mode
Returns the specified antialias mode.
static ConstPointerTo< RenderAttrib > make(unsigned short mode)
Constructs a new AntialiasAttrib object.
get_mode_type
Returns the specified antialias mode, with the quality bits masked out.
static ConstPointerTo< RenderAttrib > make_default()
Returns a RenderAttrib that corresponds to whatever the standard default properties for render attrib...
get_mode_quality
Returns the specified antialias mode, with the type bits masked out.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.