Panda3D
textureReloadRequest.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 textureReloadRequest.I
10  * @author drose
11  * @date 2008-08-12
12  */
13 
14 /**
15  * Create a new TextureReloadRequest, and add it to the loader via
16  * load_async(), to begin an asynchronous load.
17  */
19 TextureReloadRequest(const std::string &name,
20  PreparedGraphicsObjects *pgo, Texture *texture,
21  bool allow_compressed) :
22  AsyncTask(name),
23  _pgo(pgo),
24  _texture(texture),
25  _allow_compressed(allow_compressed)
26 {
27  nassertv(_pgo != nullptr);
28  nassertv(_texture != nullptr);
29 }
30 
31 /**
32  * Returns the PreparedGraphicsObjects object associated with this
33  * asynchronous TextureReloadRequest.
34  */
37  return _pgo;
38 }
39 
40 /**
41  * Returns the Texture object associated with this asynchronous
42  * TextureReloadRequest.
43  */
44 INLINE Texture *TextureReloadRequest::
45 get_texture() const {
46  return _texture;
47 }
48 
49 /**
50  * Returns the "allow compressed" flag associated with this asynchronous
51  * TextureReloadRequest.
52  */
53 INLINE bool TextureReloadRequest::
55  return _allow_compressed;
56 }
57 
58 /**
59  * Returns true if this request has completed, false if it is still pending.
60  * Equivalent to `req.done() and not req.cancelled()`.
61  * @see done()
62  */
63 INLINE bool TextureReloadRequest::
64 is_ready() const {
65  return (FutureState)AtomicAdjust::get(_future_state) == FS_finished;
66 }
bool is_ready() const
Returns true if this request has completed, false if it is still pending.
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
A table of objects that are saved within the graphics context for reference by handle later.
static Integer get(const Integer &var)
Atomically retrieves the snapshot value of the indicated variable.
PreparedGraphicsObjects * get_prepared_graphics_objects() const
Returns the PreparedGraphicsObjects object associated with this asynchronous TextureReloadRequest.
This class represents a concrete task performed by an AsyncManager.
Definition: asyncTask.h:32
TextureReloadRequest(const std::string &name, PreparedGraphicsObjects *pgo, Texture *texture, bool allow_compressed)
Create a new TextureReloadRequest, and add it to the loader via load_async(), to begin an asynchronou...
bool get_allow_compressed() const
Returns the "allow compressed" flag associated with this asynchronous TextureReloadRequest.