Jump to content

  • Log In with Google      Sign In   
  • Create Account


GPU particles disappear when i try to render text?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 the dodger uk   Members   -  Reputation: 148

Like
0Likes
Like

Posted 03 March 2013 - 02:55 PM

	static RECT textbox;

	static LPD3DX10FONT ppFont;
	string str("fred");
	static bool done = false;
	if ( !done)
	{
		SetRect(&textbox, 0, 0, 1344, 745);
	
		D3DX10CreateFont(g_pd3dDevice,    // the D3D Device
			17,    // font height
			0,    // default font width
			FW_NORMAL,    // font weight
			1,    // not using MipLevels
			false,    // italic font
			DEFAULT_CHARSET,    // default character set
			OUT_DEFAULT_PRECIS,    // default OutputPrecision,
			DEFAULT_QUALITY,    // default Quality
			DEFAULT_PITCH | FF_DONTCARE,    // default pitch and family
			"Arial",    // use Facename Arial
			&ppFont);    // the font object

		done = true;
	}
	D3DXCOLOR white(1,1,1,1);

	ppFont->DrawTextA(NULL,str.c_str(),strlen(str.c_str()),&textbox,DT_LEFT | DT_TOP,white);
	// Present the backbuffer contents to the display. 1st parameter = 0: present immediately,  = 1: wait for next vsync
	g_pSwapChain->Present( 1, 0 );
 

 

 i have this HACKED in and if i use it , it makes the gpu particles disaper,  , if i not DrawTextA , then the particles apear 

 

 
can any one tell me what stupid mistake i am making here please


Sponsor:

#2 Yourself   Crossbones+   -  Reputation: 1042

Like
0Likes
Like

Posted 03 March 2013 - 03:50 PM

you do not have to present the backbuffer every time you make a draw call, only once a frame (at the end).

if however, this is the end of the render function, check device settings (culling, input layouts, ...) as the drawing of the text might change some settings.



#3 GuardianX   Crossbones+   -  Reputation: 1486

Like
0Likes
Like

Posted 04 March 2013 - 03:59 AM

You must change your states to default after rendering font object, since it changes some of them internally.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS