Original Post
Hello everyone, I'm drawing a GUI dialog. The overall performance is OK, but when the controls (buttons with captions) are drawn for the first time, the frame takes about 10 times longer to draw. Unfortunately, a smooth animation must be played at the same time, so this delay is obvious to the user. What I need is some way to preload resources for ID3DXFont objects that draw captions for the buttons, so that the first frame takes not longer than any other frame. I've tried ID3DXFont::PreloadText, but it doesn't seem to change anything. Actually, I don't see why it should, since it only accepts a text string, which may very well differ from the string passed to ID3DXFont::Draw. I've also tried to pass a ID3DXSprite to ID3DXFont::Draw, but the problem persists. From what I notices, the first call to ID3DXSprite::Draw caches something, so that subsequent calls are 10 times faster. Could you please give me some advice? P.S. I use DirectX 9.0c SDK. Thank you