Jump to content
  • Advertisement
Sign in to follow this  
Sparhawk42

Problem with CDXUTTextHelper and Window-Maximize [Solved]

This topic is 4850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I get always the following Message, if I want to maximize my window (with Direct3D Debugmode on): Direct3D9: (ERROR) :All user created stateblocks must be freed before Reset can succeed. Reset Fails. This the code (boiled done, who causes this):
class NoStateFound
	: public GraphicState
{
	  public:
			NoStateFound( int stateId, GraphicEngine* graphEng ): GraphicState( stateId, graphEng )
			{};

			virtual void onFrameRender( double fTime, float fElapsedTime )
			{
				graphEng_->clear( 0, 0, 50 );

				if( graphEng_->beginScene() )
				{

					graphEng_->beginText( FONT_ARIAL_BOLD_04 );
	
					graphEng_->endText();

					graphEng_->endScene();
				}

			}

};




With GraphicEngine functions as follows:
void 
GraphicEngineDirect3d::beginText( int fontId )
{
	if( txtHelper_ ) 
	{
		delete txtHelper_;
	}
	txtHelper_ = new CDXUTTextHelper( getD3DFont( fontId ), textSprite_, 0 );
	txtHelper_->Begin();
}

void GraphicEngineDirect3d::endText()
{
	if( txtHelper_ )
	{
		txtHelper_->End();
		delete txtHelper_;
		txtHelper_ = NULL;
	}
}




and
CDXUTTextHelper* txtHelper_

The above is caused by beginText endText Block in NoStateFound. So what must I do with txtHelper_, when my window is maximized... an explicit call to raphicEngineDirect3d::endText() didn't fix the problem. Thanks for your help. [Edited by - Sparhawk42 on August 7, 2005 7:02:03 AM]

Share this post


Link to post
Share on other sites
Advertisement
I would really appreciate some help on this topic.

By the way the window maximize case is just the easiest to reproduce case for me, this problem happens also, when toggling fullscreen/window or changing Screenresolution in full screen.

Share this post


Link to post
Share on other sites
I really are stuck with this buck, so maybe someone has any Idea...

here is some more code to maybe clarify the situation:



void CDXUTTextHelper::Begin()
{
if( m_pSprite )
m_pSprite->Begin( D3DXSPRITE_ALPHABLEND | D3DXSPRITE_SORT_TEXTURE );
}
void CDXUTTextHelper::End()
{
if( m_pSprite )
m_pSprite->End();
}




ID3DXSprite* m_pSprite;


Share this post


Link to post
Share on other sites
I've fixed this one now on my own. I had just to add two missing Callbacks on OnReset and onLostDevice, and to forward the calls to all fonts and the textSprite_

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!