14#ifndef DXTEXTURECONTEXT9_H
15#define DXTEXTURECONTEXT9_H
24class EXPCL_PANDADX DXTextureContext9 :
public TextureContext {
26 DXTextureContext9(PreparedGraphicsObjects *pgo,
Texture *tex,
int view);
27 virtual ~DXTextureContext9();
43 IDirect3DSurface9 *d3d_surface,
48 HRESULT fill_d3d_texture_mipmap_pixels(
int mip_level,
int depth_index, D3DFORMAT source_format);
49 HRESULT fill_d3d_texture_pixels(
DXScreenData &scrn,
bool compress_texture);
50 HRESULT fill_d3d_volume_texture_pixels(
DXScreenData &scrn);
51 static int down_to_power_2(
int value);
52 unsigned int get_bits_per_pixel(Texture::Format format,
int *alphbits);
53 PN_stdfloat d3d_format_to_bytes_per_pixel (D3DFORMAT format);
56 D3DFORMAT _d3d_format;
57 IDirect3DBaseTexture9 *_d3d_texture;
58 IDirect3DTexture9 *_d3d_2d_texture;
59 IDirect3DVolumeTexture9 *_d3d_volume_texture;
60 IDirect3DCubeTexture9 *_d3d_cube_texture;
66 bool _is_render_target;
72 static void init_type() {
73 TextureContext::init_type();
75 TextureContext::get_class_type());
78 return get_class_type();
80 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
85 friend class wdxGraphicsBuffer9;
virtual void evict_lru()
Evicts the page from the LRU.
bool create_texture(DXScreenData &scrn)
Use panda texture's pixelbuffer to create a texture for the specified device.
IDirect3DVolumeTexture9 * get_d3d_volume_texture() const
Returns the Direct3D object that represents the texture, in the case of a 3-d texture.
IDirect3DCubeTexture9 * get_d3d_cube_texture() const
Returns the Direct3D object that represents the texture, in the case of a cube map texture.
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.
IDirect3DBaseTexture9 * get_d3d_texture() const
Returns the Direct3D object that represents the texture, whatever kind of texture it is.
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_ima...
void delete_texture()
Release the surface used to store the texture.
static HRESULT d3d_surface_to_texture(RECT &source_rect, IDirect3DSurface9 *d3d_surface, bool inverted, Texture *result, int view, int z)
copies source_rect in pD3DSurf to upper left of texture
bool has_mipmaps() const
Returns true if the texture was created with mipmaps, false otherwise.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.