Panda3D
|
Public Member Functions | |
DXTextureContext8 (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 () |
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 () |
IDirect3DTexture8 * | get_d3d_2d_texture () const |
Returns the Direct3D object that represents the texture, in the case of a 1-d or 2-d texture. | |
IDirect3DCubeTexture8 * | get_d3d_cube_texture () const |
Returns the Direct3D object that represents the texture, in the case of a cube map texture. | |
IDirect3DBaseTexture8 * | get_d3d_texture () const |
Returns the Direct3D object that represents the texture, whatever kind of texture it is. | |
IDirect3DVolumeTexture8 * | 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, IDirect3DSurface8 *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 | wdxGraphicsBuffer8 |
Definition at line 26 of file dxTextureContext8.h.
bool DXTextureContext8::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 101 of file dxTextureContext8.cxx.
References delete_texture(), Texture::estimate_texture_memory(), 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 DXGraphicsStateGuardian8::framebuffer_copy_to_texture(), wdxGraphicsBuffer8::select_cube_map(), and DXGraphicsStateGuardian8::upload_texture().
HRESULT DXTextureContext8::d3d_surface_to_texture | ( | RECT & | source_rect, |
IDirect3DSurface8 * | d3d_surface, | ||
bool | inverted, | ||
Texture * | result, | ||
int | z | ||
) | [static] |
copies source_rect in pD3DSurf to upper left of texture
Definition at line 1064 of file dxTextureContext8.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 DXGraphicsStateGuardian8::do_framebuffer_copy_to_ram().
void DXTextureContext8::delete_texture | ( | ) |
Release the surface used to store the texture.
Definition at line 906 of file dxTextureContext8.cxx.
Referenced by create_texture(), evict_lru(), and DXGraphicsStateGuardian8::upload_texture().
void DXTextureContext8::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 77 of file dxTextureContext8.cxx.
References delete_texture(), AdaptiveLruPage::dequeue_lru(), TextureContext::get_texture(), TextureContext::mark_unloaded(), AdaptiveLruPage::mark_used_lru(), and TextureContext::update_data_size_bytes().
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 927 of file dxTextureContext8.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 DXGraphicsStateGuardian8::extract_texture_data().
IDirect3DTexture8 * DXTextureContext8::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 dxTextureContext8.I.
Referenced by DXGraphicsStateGuardian8::framebuffer_copy_to_texture().
IDirect3DCubeTexture8 * DXTextureContext8::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 dxTextureContext8.I.
IDirect3DBaseTexture8 * DXTextureContext8::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 dxTextureContext8.I.
Referenced by DXGraphicsStateGuardian8::apply_texture().
IDirect3DVolumeTexture8 * DXTextureContext8::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 dxTextureContext8.I.
bool DXTextureContext8::has_mipmaps | ( | ) | const [inline] |
Returns true if the texture was created with mipmaps, false otherwise.
Definition at line 23 of file dxTextureContext8.I.
Referenced by DXGraphicsStateGuardian8::apply_texture().
static void DXTextureContext8::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 70 of file dxTextureContext8.h.
References TextureContext::init_type().