D3D Font issue

Started by
-1 comments, last by SmoothRide 14 years, 10 months ago
I have a strange issue with the font feature. It used to work correctly in my program, but recently I began experiencing this glitch where the font appears for a few seconds when I start the program and then disappears. It reappears every few seconds, very briefly, and then goes away again. I don't understand what is going on with it. I was hoping maybe somebody ran into this issue before and knows how to fix it. For reference purposes, see code snippets below. I pretty much took it all from online tutorials. Here's my font creation code:

	HRESULT hr;
	hr=D3DXCreateFont(p_dx_device,     //D3D Device
                     -MulDiv(16, 96, 72),               //Font height
                     0,                //Font width
                     0,        //Font Weight
                     0,                //MipLevels
                     false,            //Italic
                     ANSI_CHARSET,  //CharSet
                     OUT_DEFAULT_PRECIS, //OutputPrecision
                     DEFAULT_QUALITY, //Quality
                     FF_MODERN,//PitchAndFamily
                     "Arial",          //pFacename,
                     &p_dx_font);         //ppFont

	return p_dx_font;

Here's the display call:

	_itoa(in_frame_counter, str, 10);
	if(FAILED(SetRect(&rectangle, 0, 0, 200, 40))){
			rectangle.top = 0;
			rectangle.left = 0;
			rectangle.right = 200;
			rectangle.bottom = 40;
	}
        p_dx_font->DrawText(NULL, str, -1, &rectangle, DT_LEFT|DT_NOCLIP, 0xffff0000);

This topic is closed to new replies.

Advertisement