Jump to content
  • Advertisement
Sign in to follow this  
startreky498

From Surface to Verteces

This topic is 4880 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'm trying to draw a quad (set of 4 vertexes) with a texture from a surface. I can't find a function that will allow me to do this. using iDirect3DDevice9*::SetTexture in conjunction with ::DrawPrimitiveUP worked fine for me, but now I want to use surfaces. Is there a function that will allow me to draw a quad with a surface? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You can't use surfaces (IDirect3DSurface9) for that type of rendering, at a high-level textures and surfaces are very similar, but it's here where the differentiation becomes important.

I would suggest you look into using the "level 0" surface for an IDirect3DTexture9; either lock it and copy your surface in, or just write to it (as a D3DPOOL_MANAGED resource) and call UpdateTexture() to re-upload it to VRAM for usage...

Alternatively, if you're rendering a 1:1 (or close) copy of your surface, you can look into using StretchRect() to render directly from your surface to another (the screen in this case), however this isn't usually very fast!

hth
Jack

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!