Panda3D
|
This is a special class object that holds all the information returned by a particular GSG to indicate the texture's internal context identifier. More...
#include "textureContext.h"
Public Member Functions | |
TextureContext (PreparedGraphicsObjects *pgo, Texture *tex, int view) | |
virtual TypeHandle | force_init_type () |
Texture * | get_texture () const |
Returns the pointer to the associated Texture object. | |
virtual TypeHandle | get_type () const |
int | get_view () const |
Returns the specific view of a multiview texture this context represents. | |
void | mark_loaded () |
Should be called after the texture has been loaded into graphics memory, this updates the internal flags for changed_size() and modified(). | |
void | mark_needs_reload () |
Should be called to indicate the texture should be reloaded at the nearest opportunity. | |
void | mark_simple_loaded () |
Should be called after the texture's "simple" image has been loaded into graphics memory. | |
void | mark_unloaded () |
Should be called after the texture has been forced out of texture memory. | |
virtual void | output (ostream &out) const |
void | update_data_size_bytes (size_t new_data_size_bytes) |
Should be called (usually by a derived class) when the on-card size of this object has changed. | |
bool | was_image_modified () const |
Returns true if the texture image has been modified since the last time mark_loaded() was called. | |
bool | was_modified () const |
Returns true if the texture properties or image have been modified since the last time mark_loaded() was called. | |
bool | was_properties_modified () const |
Returns true if the texture properties (unrelated to the image) have been modified since the last time mark_loaded() was called. | |
bool | was_simple_image_modified () const |
Returns true if the texture's "simple" image has been modified since the last time mark_simple_loaded() was called. | |
virtual void | write (ostream &out, int indent_level) const |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
Friends | |
class | PreparedGraphicsObjects |
This is a special class object that holds all the information returned by a particular GSG to indicate the texture's internal context identifier.
Textures typically have an immediate-mode and a retained-mode operation. When using textures in retained-mode (in response to Texture::prepare()), the GSG will create some internal handle for the texture and store it here. The texture stores all of these handles internally.
Definition at line 38 of file textureContext.h.
Texture * TextureContext::get_texture | ( | ) | const [inline] |
Returns the pointer to the associated Texture object.
Definition at line 37 of file textureContext.I.
Referenced by DXGraphicsStateGuardian9::apply_texture(), DXGraphicsStateGuardian8::apply_texture(), GraphicsStateGuardian::async_reload_texture(), DXTextureContext9::create_texture(), DXTextureContext8::create_texture(), DXTextureContext9::evict_lru(), DXTextureContext8::evict_lru(), DXTextureContext9::extract_texture_data(), DXTextureContext8::extract_texture_data(), DXGraphicsStateGuardian9::framebuffer_copy_to_texture(), DXGraphicsStateGuardian8::framebuffer_copy_to_texture(), DXGraphicsStateGuardian9::prepare_texture(), DXGraphicsStateGuardian8::prepare_texture(), wdxGraphicsBuffer8::select_cube_map(), TinyGraphicsStateGuardian::update_texture(), DXGraphicsStateGuardian9::update_texture(), DXGraphicsStateGuardian8::update_texture(), DXGraphicsStateGuardian9::upload_texture(), and DXGraphicsStateGuardian8::upload_texture().
int TextureContext::get_view | ( | ) | const [inline] |
Returns the specific view of a multiview texture this context represents.
In the usual case, with a non-multiview texture, this will be 0.
Definition at line 49 of file textureContext.I.
Referenced by PreparedGraphicsObjects::release_all_textures(), and PreparedGraphicsObjects::release_texture().
static void TextureContext::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from BufferContext.
Reimplemented in DXTextureContext8, DXTextureContext9, and TinyTextureContext.
Definition at line 75 of file textureContext.h.
References BufferContext::init_type().
Referenced by TinyTextureContext::init_type(), DXTextureContext9::init_type(), and DXTextureContext8::init_type().
void TextureContext::mark_loaded | ( | ) | [inline] |
Should be called after the texture has been loaded into graphics memory, this updates the internal flags for changed_size() and modified().
Definition at line 121 of file textureContext.I.
References Texture::get_image_modified(), Texture::get_properties_modified(), BufferContext::set_resident(), and BufferContext::update_modified().
Referenced by DXTextureContext9::create_texture(), DXTextureContext8::create_texture(), TinyGraphicsStateGuardian::framebuffer_copy_to_texture(), DXGraphicsStateGuardian9::framebuffer_copy_to_texture(), and DXGraphicsStateGuardian8::framebuffer_copy_to_texture().
void TextureContext::mark_needs_reload | ( | ) | [inline] |
Should be called to indicate the texture should be reloaded at the nearest opportunity.
Definition at line 170 of file textureContext.I.
References UpdateSeq::old().
void TextureContext::mark_simple_loaded | ( | ) | [inline] |
Should be called after the texture's "simple" image has been loaded into graphics memory.
Definition at line 138 of file textureContext.I.
References Texture::get_properties_modified(), Texture::get_simple_image_modified(), BufferContext::set_resident(), and BufferContext::update_modified().
void TextureContext::mark_unloaded | ( | ) | [inline] |
Should be called after the texture has been forced out of texture memory.
Definition at line 154 of file textureContext.I.
References UpdateSeq::old(), BufferContext::set_resident(), and BufferContext::update_modified().
Referenced by TinyTextureContext::evict_lru(), DXTextureContext9::evict_lru(), DXTextureContext8::evict_lru(), DXGraphicsStateGuardian9::upload_texture(), and DXGraphicsStateGuardian8::upload_texture().
void TextureContext::update_data_size_bytes | ( | size_t | new_data_size_bytes | ) | [inline] |
Should be called (usually by a derived class) when the on-card size of this object has changed.
Reimplemented from BufferContext.
Definition at line 108 of file textureContext.I.
References AdaptiveLruPage::set_lru_size().
Referenced by DXTextureContext9::create_texture(), DXTextureContext8::create_texture(), TinyTextureContext::evict_lru(), DXTextureContext9::evict_lru(), DXTextureContext8::evict_lru(), TinyGraphicsStateGuardian::framebuffer_copy_to_texture(), DXGraphicsStateGuardian9::upload_texture(), and DXGraphicsStateGuardian8::upload_texture().
bool TextureContext::was_image_modified | ( | ) | const [inline] |
Returns true if the texture image has been modified since the last time mark_loaded() was called.
Definition at line 85 of file textureContext.I.
References Texture::get_image_modified().
Referenced by TinyGraphicsStateGuardian::update_texture(), Texture::was_image_modified(), and was_modified().
bool TextureContext::was_modified | ( | ) | const [inline] |
Returns true if the texture properties or image have been modified since the last time mark_loaded() was called.
Definition at line 62 of file textureContext.I.
References was_image_modified(), and was_properties_modified().
Referenced by DXGraphicsStateGuardian8::update_texture(), and DXGraphicsStateGuardian9::update_texture().
bool TextureContext::was_properties_modified | ( | ) | const [inline] |
Returns true if the texture properties (unrelated to the image) have been modified since the last time mark_loaded() was called.
Definition at line 74 of file textureContext.I.
References Texture::get_properties_modified().
Referenced by was_modified().
bool TextureContext::was_simple_image_modified | ( | ) | const [inline] |
Returns true if the texture's "simple" image has been modified since the last time mark_simple_loaded() was called.
Definition at line 97 of file textureContext.I.
References Texture::get_simple_image_modified().
Referenced by DXGraphicsStateGuardian9::upload_texture(), and DXGraphicsStateGuardian8::upload_texture().