Sign in to follow this  
Bobboau

texture thing

Recommended Posts

makeing a texture management system, and I wanted to have a list of textures that could be of any of the classes derived from IDirect3DBaseTexture9, so I made a struct containing a pointer to one.
struct d3d_texture
{
	d3d_texture():ocupied(false),t_interface(NULL){};
	~d3d_texture(){if(t_interface)while(t_interface->Release());};
	IDirect3DBaseTexture9* t_interface;
	bool ocupied;
};

d3d_texture	internal_texture[MAX_D3D_TEXTURE_SLOTS];//this is inside a class
created useing this call
HRESULT hr = D3D_device->CreateTexture(x,y,1, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT,
(IDirect3DTexture9**)&internal_texture[t].t_interface, NULL);
locked useiong this
	_D3DLOCKED_RECT locked;
	((IDirect3DTexture9*)(tex->t_interface))->LockRect(0, &locked, NULL, 0);
when I lock, pbits and pitch are both 0, oddly when I GetLevelDesc everthing seems corect. any ideas? shouldn't this work? I want to beable to refer to a cube map or volume texture from this list of textures so I'd reather not use IDirect3DTexture9, and I just tried doing that and it doesn't seem to change anything so that isn't even the problem... ...wait it's D3DSURFACE_DESC.type is D3DRTYPE_SURFACE, shouldn't it be D3DRTYPE_TEXTURE... [Edited by - Coder on August 16, 2004 10:04:51 AM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this