Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SiliconMunky

Drawing to a texture or surface.

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

Ok, so here''s the deal. I want to be able to generate the texture that I''m going to lay over my terrain at run time, that way I won''t have to have every single texture premade and loaded into memory (there won''t be enough video memory). So what I want to be able to do is load a bunch of small textures and then ''blit'' them on to a larger texture that I will wrap over the current terrain. So how do I draw one texture on to another?

Share this post


Link to post
Share on other sites
Advertisement
IDirect3DDevice9 :: UpdateSurface(arg)

List of arguements
or

IDirect3DDevice8 :: CopyRects(arg)

uh, i dont use d3d8 so i cant help yah with this one, but i believe these are both SURFACE functions, so i think you said u were using a texture? im sure theres soem way u could use these...maybe...

Share this post


Link to post
Share on other sites
What kind of trouble are you having with UpdateSurface? Does it return some kind of error value? What does the debug spew say?

UpdateSurface is basically there to transfer a block of data from system memory to video memory. The source surface must be in D3DPOOL_SYSTEMMEM and the destination surface must be in D3DPOOL_DEFAULT. Also, no stretching is allowed. This is all from the DX9 docs

neneboricua

Share this post


Link to post
Share on other sites
quote:
Original post by neneboricua19
What kind of trouble are you having with UpdateSurface? Does it return some kind of error value? What does the debug spew say?

UpdateSurface is basically there to transfer a block of data from system memory to video memory. The source surface must be in D3DPOOL_SYSTEMMEM and the destination surface must be in D3DPOOL_DEFAULT. Also, no stretching is allowed. This is all from the DX9 docs

neneboricua


ohh, i guess i missed that part about where the surfaces must be located. Strange.

Thanks nene.

Share this post


Link to post
Share on other sites
D3DXLoadSurfaceFromSurface is more general utility for blitting, if you''re working in sys->sys memory.

UpdateSurface is indeed meant to be used primarily in agp uploads.

-Nik

Share this post


Link to post
Share on other sites
Ok, thanks Nik02, I got D3DXLoadSurfaceFromSurface to copy one surface on to another. But my next question is, how could I draw one surface on to another texture with an alhpa channel? I haven't yet tested using alpha values with D3DXLoadSurfaceFromSurface (because of my problem with DxTex), but I don't think it's going to work.

Any tips?

Thanks.


[edited by - SiliconMunky on December 2, 2003 12:18:58 PM]

Share this post


Link to post
Share on other sites
I believe the alpha will be copied as well. I''m not at my own machine now, so I can''t verify this until tomorrow.

-Nik

Share this post


Link to post
Share on other sites
quote:
Original post by Nik02
I believe the alpha will be copied as well. I''m not at my own machine now, so I can''t verify this until tomorrow.

-Nik


K, thanks Nik02,

I''ll be trying to get it to work tonight when I get home from work. Hopefully I can get some sort of picture file with an alhpa channel without having to convert using DxTex, since mine isn''t working.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!