Code:
typedef struct BMAP {
	C_LINK	link;
	long 	width,height; // original size of the bitmap
	long	bytespp;	// original bytes per pixel (1..4)
	void	*ptr;		// internal use
	byte	*pixels;	// ptr to palettized, 565, 4444, 888 or 8888 coded original image
	long	flags;      // see BMPF_... above
	void	*d3dtex;	// 	LPDIRECT3DTEXTURE9 (usually a different format than the original image)
	float	u1,v1,u2,v2; // texture pixel bounds
	long	u,v;		// cutout start size
	long	refcount;	// for implicitely created bmaps
	long	finalwidth,finalheight,finalbytespp;
	long	pitch,finalpitch;
	long	miplevels;
	long	finalformat;
	void	*finalbits;	// bitmap content when locked, otherwise NULL
} BMAP;


->
void *d3dtex; // LPDIRECT3DTEXTURE9 (usually a different format than the original image)

That's what you are looking for. DirectX functions do not accept acknex BMAPs. That pointer might be empty though (for example when the texture has not been visible/ drawn at least once yet), need to check for != NULL.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends