Jump to content
  • Advertisement
Sign in to follow this  
fluke

surface to surface copy

This topic is 4839 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

before i call the following: pTexture->GetSurfaceLevel(...); pDevice->UpdateSurface(pSurface,...); pSurface2->Release(); //begin scene, begin, blah, blah pDevice->Draw(...); //end, end scene, present, blah, blah i need to run my bitmap blitting routine (which is actually a font engine) and update pSurface. what is the correct method to do this? my source surface containing my font bitmap is called pFontSurface. testing wiht a single call such as the following is failing with a D3DERR_INVALIDCALL: RECT rc={0,0,50,12}; PONT pt={50,50}; pDevice->UpdateSurface(pFontSurface,&rc,pSurface,&pt); should i even be using UpdateSurface for this process or do i need to lock pSurface first and then access the memory directly (ughh...)? thanks in advance for your help/suggestions! note: D3DXLoadSurfaceFromSurface seems to work for me, but will several calls to this, blitting each letter cause performance problems? - also, it doesn't seem to support transparency!!! are there still better methods of accomplishing this? [Edited by - fluke on August 17, 2005 2:10:32 AM]

Share this post


Link to post
Share on other sites
Advertisement
When you get the D3DERR_INVALIDCALL error, what does the debug spew say? Whenever a DirectX call fails, the particular reason why it failed will be printed to the debug spew. This will help you figure out exactly what's wrong so you know where to concentrate your efforts to fix it.

If you're not sure what the debug spew is, check the forum FAQ for details on how to set it up.

neneboricua

Share this post


Link to post
Share on other sites
It's really not a good idea to implement a font engine like that. It reminds me of the system used in that Zen of D3D book. As you noticed, it will not support transparency (or a lot of other things) and performance is horrible as well.

You want your font data loaded as a texture, then draw textured quads. A simple implementation can be found here.

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!