Panda3D
Public Member Functions | Static Public Member Functions | Friends
TextureContext Class Reference

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"

Inheritance diagram for TextureContext:
BufferContext AdaptiveLruPage SavedContext LinkedListNode AdaptiveLruPageDynamicList AdaptiveLruPageStaticList TypedObject LinkedListNode LinkedListNode MemoryBase DXTextureContext8 DXTextureContext9 TinyTextureContext

List of all members.

Public Member Functions

 TextureContext (PreparedGraphicsObjects *pgo, Texture *tex, int view)
virtual TypeHandle force_init_type ()
Textureget_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

Detailed Description

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.


Member Function Documentation

Texture * TextureContext::get_texture ( ) const [inline]
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 DXTextureContext9, DXTextureContext8, and TinyTextureContext.

Definition at line 75 of file textureContext.h.

References BufferContext::init_type().

Referenced by TinyTextureContext::init_type(), DXTextureContext8::init_type(), and DXTextureContext9::init_type().

void TextureContext::mark_loaded ( ) [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().

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]
void TextureContext::update_data_size_bytes ( size_t  new_data_size_bytes) [inline]
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().

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 DXGraphicsStateGuardian8::upload_texture(), and DXGraphicsStateGuardian9::upload_texture().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations