/* attempt to deal with prototype, bootstrap, jquery conflicts */ /* for dropdown menus */

Jump to content

Image of the Day

Today's #ScreenshotSaturday features Face Your Fears from Turtle Roc ... #virtualrealityshop #mobilevr #vrshop https://t.co/3qhSNAVNOZ
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now

GPU particles disappear when i try to render text?

4: Adsense

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   

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


#2 Yourself   Members   

1879
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   Members   

1586
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.