Panda3D
|
Public Member Functions | |
DXTextureContext9 (PreparedGraphicsObjects *pgo, Texture *tex, int view) | |
bool | create_simple_texture (DXScreenData &scrn) |
bool | create_texture (DXScreenData &scrn) |
Use panda texture's pixelbuffer to create a texture for the specified device. | |
void | delete_texture () |
Release the surface used to store the texture. | |
virtual void | evict_lru () |
Evicts the page from the LRU. | |
bool | extract_texture_data (DXScreenData &scrn) |
This method will be called in the draw thread to download the texture memory's image into its ram_image value. | |
virtual TypeHandle | force_init_type () |
IDirect3DTexture9 * | get_d3d_2d_texture () const |
Returns the Direct3D object that represents the texture, in the case of a 1-d or 2-d texture. | |
IDirect3DCubeTexture9 * | get_d3d_cube_texture () const |
Returns the Direct3D object that represents the texture, in the case of a cube map texture. | |
IDirect3DBaseTexture9 * | get_d3d_texture () const |
Returns the Direct3D object that represents the texture, whatever kind of texture it is. | |
IDirect3DVolumeTexture9 * | get_d3d_volume_texture () const |
Returns the Direct3D object that represents the texture, in the case of a 3-d texture. | |
virtual TypeHandle | get_type () const |
bool | has_mipmaps () const |
Returns true if the texture was created with mipmaps, false otherwise. | |
Static Public Member Functions | |
static HRESULT | d3d_surface_to_texture (RECT &source_rect, IDirect3DSurface9 *d3d_surface, bool inverted, Texture *result, int z) |
copies source_rect in pD3DSurf to upper left of texture | |
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 | wdxGraphicsBuffer9 |
Definition at line 28 of file dxTextureContext9.h.
bool DXTextureContext9::create_texture | ( | DXScreenData & | scrn | ) |
Use panda texture's pixelbuffer to create a texture for the specified device.
This code gets the attributes of the texture from the bitmap, creates the texture, and then copies the bitmap into the texture. The return value is true if the texture is successfully created, false otherwise.
Definition at line 110 of file dxTextureContext9.cxx.
References extract_texture_data(), Texture::get_anisotropic_degree(), Texture::get_compression(), GraphicsStateGuardian::get_engine(), Texture::get_format(), Texture::get_fullpath(), BamCache::get_global_ptr(), Texture::get_magfilter(), Texture::get_match_framebuffer_format(), Texture::get_minfilter(), Texture::get_num_components(), Texture::get_num_loadable_ram_mipmap_images(), Texture::get_post_load_store_cache(), Texture::get_ram_image(), Texture::get_ram_image_compression(), Texture::get_render_to_texture(), TextureContext::get_texture(), Texture::get_texture_type(), Texture::get_uncompressed_ram_image(), Texture::get_x_size(), Texture::get_y_size(), Texture::get_z_size(), Texture::has_ram_image(), TextureContext::mark_loaded(), Texture::set_anisotropic_degree(), BamCacheRecord::set_data(), Texture::set_post_load_store_cache(), BamCache::store(), GraphicsEngine::texture_uploaded(), and TextureContext::update_data_size_bytes().
Referenced by DXGraphicsStateGuardian9::framebuffer_copy_to_texture(), and DXGraphicsStateGuardian9::upload_texture().
HRESULT DXTextureContext9::d3d_surface_to_texture | ( | RECT & | source_rect, |
IDirect3DSurface9 * | d3d_surface, | ||
bool | inverted, | ||
Texture * | result, | ||
int | z | ||
) | [static] |
copies source_rect in pD3DSurf to upper left of texture
Definition at line 1303 of file dxTextureContext9.cxx.
References Texture::get_component_type(), Texture::get_component_width(), Texture::get_expected_ram_page_size(), Texture::get_num_components(), Texture::get_x_size(), Texture::get_y_size(), and Texture::modify_ram_image().
Referenced by DXGraphicsStateGuardian9::do_framebuffer_copy_to_ram().
void DXTextureContext9::delete_texture | ( | ) |
Release the surface used to store the texture.
Definition at line 1060 of file dxTextureContext9.cxx.
Referenced by evict_lru(), and DXGraphicsStateGuardian9::upload_texture().
void DXTextureContext9::evict_lru | ( | ) | [virtual] |
Evicts the page from the LRU.
Called internally when the LRU determines that it is full. May also be called externally when necessary to explicitly evict the page.
It is legal for this method to either evict the page as requested, do nothing (in which case the eviction will be requested again at the next epoch), or requeue itself on the tail of the queue (in which case the eviction will be requested again much later).
Reimplemented from AdaptiveLruPage.
Definition at line 81 of file dxTextureContext9.cxx.
References delete_texture(), AdaptiveLruPage::dequeue_lru(), TextureContext::get_texture(), TextureContext::mark_unloaded(), AdaptiveLruPage::mark_used_lru(), and TextureContext::update_data_size_bytes().
bool DXTextureContext9::extract_texture_data | ( | DXScreenData & | screen | ) |
This method will be called in the draw thread to download the texture memory's image into its ram_image value.
It returns true on success, false otherwise.
Definition at line 1082 of file dxTextureContext9.cxx.
References Texture::clear_ram_image(), Texture::get_component_width(), Texture::get_expected_mipmap_x_size(), Texture::get_expected_mipmap_y_size(), Texture::get_num_components(), TextureContext::get_texture(), Texture::get_texture_type(), Texture::set_component_type(), Texture::set_format(), Texture::set_ram_image(), Texture::set_ram_mipmap_image(), Texture::set_x_size(), Texture::set_y_size(), and Texture::set_z_size().
Referenced by create_texture(), and DXGraphicsStateGuardian9::extract_texture_data().
IDirect3DTexture9 * DXTextureContext9::get_d3d_2d_texture | ( | ) | const [inline] |
Returns the Direct3D object that represents the texture, in the case of a 1-d or 2-d texture.
Definition at line 45 of file dxTextureContext9.I.
Referenced by DXGraphicsStateGuardian9::framebuffer_copy_to_texture().
IDirect3DCubeTexture9 * DXTextureContext9::get_d3d_cube_texture | ( | ) | const [inline] |
Returns the Direct3D object that represents the texture, in the case of a cube map texture.
Definition at line 67 of file dxTextureContext9.I.
IDirect3DBaseTexture9 * DXTextureContext9::get_d3d_texture | ( | ) | const [inline] |
Returns the Direct3D object that represents the texture, whatever kind of texture it is.
Definition at line 34 of file dxTextureContext9.I.
Referenced by DXGraphicsStateGuardian9::apply_texture().
IDirect3DVolumeTexture9 * DXTextureContext9::get_d3d_volume_texture | ( | ) | const [inline] |
Returns the Direct3D object that represents the texture, in the case of a 3-d texture.
Definition at line 56 of file dxTextureContext9.I.
bool DXTextureContext9::has_mipmaps | ( | ) | const [inline] |
Returns true if the texture was created with mipmaps, false otherwise.
Definition at line 23 of file dxTextureContext9.I.
Referenced by DXGraphicsStateGuardian9::apply_texture().
static void DXTextureContext9::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 TextureContext.
Definition at line 76 of file dxTextureContext9.h.
References TextureContext::init_type().