Panda3D
 All Classes Functions Variables Enumerations
textureReloadRequest.I
1 // Filename: textureReloadRequest.I
2 // Created by: drose (12Aug08)
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: TextureReloadRequest::Constructor
18 // Access: Published
19 // Description: Create a new TextureReloadRequest, and add it to the loader
20 // via load_async(), to begin an asynchronous load.
21 ////////////////////////////////////////////////////////////////////
23 TextureReloadRequest(const string &name,
24  PreparedGraphicsObjects *pgo, Texture *texture,
25  bool allow_compressed) :
26  AsyncTask(name),
27  _pgo(pgo),
28  _texture(texture),
29  _allow_compressed(allow_compressed),
30  _is_ready(false)
31 {
32  nassertv(_pgo != (PreparedGraphicsObjects *)NULL);
33  nassertv(_texture != (Texture *)NULL);
34 }
35 
36 ////////////////////////////////////////////////////////////////////
37 // Function: TextureReloadRequest::get_prepared_graphics_objects
38 // Access: Published
39 // Description: Returns the PreparedGraphicsObjects object associated with
40 // this asynchronous TextureReloadRequest.
41 ////////////////////////////////////////////////////////////////////
44  return _pgo;
45 }
46 
47 ////////////////////////////////////////////////////////////////////
48 // Function: TextureReloadRequest::get_texture
49 // Access: Published
50 // Description: Returns the Texture object associated with
51 // this asynchronous TextureReloadRequest.
52 ////////////////////////////////////////////////////////////////////
54 get_texture() const {
55  return _texture;
56 }
57 
58 ////////////////////////////////////////////////////////////////////
59 // Function: TextureReloadRequest::get_allow_compressed
60 // Access: Published
61 // Description: Returns the "allow compressed" flag associated with
62 // this asynchronous TextureReloadRequest.
63 ////////////////////////////////////////////////////////////////////
64 INLINE bool TextureReloadRequest::
66  return _allow_compressed;
67 }
68 
69 ////////////////////////////////////////////////////////////////////
70 // Function: TextureReloadRequest::is_ready
71 // Access: Published
72 // Description: Returns true if this request has completed, false if
73 // it is still pending.
74 ////////////////////////////////////////////////////////////////////
75 INLINE bool TextureReloadRequest::
76 is_ready() const {
77  return _is_ready;
78 }
bool get_allow_compressed() const
Returns the "allow compressed" flag associated with this asynchronous TextureReloadRequest.
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
A table of objects that are saved within the graphics context for reference by handle later...
Texture * get_texture() const
Returns the Texture object associated with this asynchronous TextureReloadRequest.
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:43
bool is_ready() const
Returns true if this request has completed, false if it is still pending.
TextureReloadRequest(const 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...