Panda3D
renderEffect.I
1 // Filename: renderEffect.I
2 // Created by: drose (14Mar02)
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 
16 ////////////////////////////////////////////////////////////////////
17 // Function: RenderEffect::compare_to
18 // Access: Published
19 // Description: Provides an arbitrary ordering among all unique
20 // RenderEffects, so we can store the essentially
21 // different ones in a big set and throw away the rest.
22 //
23 // This method is not needed outside of the RenderEffect
24 // class because all equivalent RenderEffect objects are
25 // guaranteed to share the same pointer; thus, a pointer
26 // comparison is always sufficient.
27 ////////////////////////////////////////////////////////////////////
28 INLINE int RenderEffect::
29 compare_to(const RenderEffect &other) const {
30  // First, we compare the types; if they are of different types then
31  // they sort differently.
32  TypeHandle type = get_type();
33  TypeHandle other_type = other.get_type();
34  if (type != other_type) {
35  return type.get_index() - other_type.get_index();
36  }
37 
38  // We only call compare_to_impl() if they have the same type.
39  return compare_to_impl(&other);
40 }
int compare_to(const RenderEffect &other) const
Provides an arbitrary ordering among all unique RenderEffects, so we can store the essentially differ...
Definition: renderEffect.I:29
int get_index() const
Returns the integer index associated with this TypeHandle.
Definition: typeHandle.I:253
This is the base class for a number of special render effects that may be set on scene graph nodes to...
Definition: renderEffect.h:56
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85