d3d_texfree only decreases with draw_quad, because video memory is only allocated when the bmap is rendered. From what I now learned, generating a texture fails not only when not enough video memory is available, but also when not enough normal memory is available. So you must have enough of both.