Panda3D
texturePoolFilter.cxx
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 texturePoolFilter.cxx
10  * @author drose
11  * @date 2006-07-27
12  */
13 
14 #include "texturePoolFilter.h"
15 
16 TypeHandle TexturePoolFilter::_type_handle;
17 
18 /**
19  *
20  */
21 TexturePoolFilter::
22 ~TexturePoolFilter() {
23 }
24 
25 /**
26  * This method is called before each texture is loaded from disk, via the
27  * TexturePool, for the first time. If this method returns NULL, then a new
28  * Texture will be allocated and loaded from disk normally by the TexturePool;
29  * otherwise, if it returns non-NULL, then that returned pointer will be used
30  * as the Texture for this filename.
31  */
32 PT(Texture) TexturePoolFilter::
33 pre_load(const Filename &, const Filename &, int, int, bool,
34  const LoaderOptions &) {
35  return nullptr;
36 }
37 
38 /**
39  * This method is called after each texture has been loaded from disk, via the
40  * TexturePool, for the first time. By the time this method is called, the
41  * Texture has already been fully read from disk. This method should return
42  * the Texture pointer that the TexturePool should actually return (usually it
43  * is the same as the pointer supplied).
44  */
45 PT(Texture) TexturePoolFilter::
46 post_load(Texture *tex) {
47  return tex;
48 }
49 
50 /**
51  *
52  */
53 void TexturePoolFilter::
54 output(std::ostream &out) const {
55  out << get_type();
56 }
Specifies parameters that may be passed to the loader.
Definition: loaderOptions.h:23
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
Definition: texture.h:71
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:39
PT(Texture) TexturePoolFilter
This method is called before each texture is loaded from disk, via the TexturePool, for the first time.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81