Panda3D
 All Classes Functions Variables Enumerations
texturePoolFilter.cxx
1 // Filename: texturePoolFilter.cxx
2 // Created by: drose (27Jul06)
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 #include "texturePoolFilter.h"
16 
17 TypeHandle TexturePoolFilter::_type_handle;
18 
19 ////////////////////////////////////////////////////////////////////
20 // Function: TexturePoolFilter::Destructor
21 // Access: Public, Virtual
22 // Description:
23 ////////////////////////////////////////////////////////////////////
24 TexturePoolFilter::
25 ~TexturePoolFilter() {
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: TexturePoolFilter::pre_load
30 // Access: Public, Virtual
31 // Description: This method is called before each texture is loaded
32 // from disk, via the TexturePool, for the first time.
33 // If this method returns NULL, then a new Texture will
34 // be allocated and loaded from disk normally by the
35 // TexturePool; otherwise, if it returns non-NULL, then
36 // that returned pointer will be used as the Texture for
37 // this filename.
38 ////////////////////////////////////////////////////////////////////
40 pre_load(const Filename &, const Filename &, int, int, bool,
41  const LoaderOptions &) {
42  return NULL;
43 }
44 
45 ////////////////////////////////////////////////////////////////////
46 // Function: TexturePoolFilter::post_load
47 // Access: Public, Virtual
48 // Description: This method is called after each texture has been
49 // loaded from disk, via the TexturePool, for the first
50 // time. By the time this method is called, the Texture
51 // has already been fully read from disk. This method
52 // should return the Texture pointer that the
53 // TexturePool should actually return (usually it is the
54 // same as the pointer supplied).
55 ////////////////////////////////////////////////////////////////////
57 post_load(Texture *tex) {
58  return tex;
59 }
60 
61 ////////////////////////////////////////////////////////////////////
62 // Function: TexturePoolFilter::output
63 // Access: Public, Virtual
64 // Description:
65 ////////////////////////////////////////////////////////////////////
66 void TexturePoolFilter::
67 output(ostream &out) const {
68  out << get_type();
69 }
Specifies parameters that may be passed to the loader.
Definition: loaderOptions.h:26
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
Definition: texture.h:75
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
This is an abstract base class, a placeholder for any number of different classes that may wish to im...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85