Sign in to follow this  
startreky498

From Surface to Verteces

Recommended Posts

startreky498    144
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
jollyjeffers    1570
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this