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