Drawing to a texture or surface.

Started by
23 comments, last by SiliconMunky 20 years, 4 months ago
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?
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...
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
great, thank you.

why would they call it UpdateSurface? lol whatever. as long as it works.

thanks again.
Actually I''m having some trouble getting UpdateSurface(arg) to work, anyone have some suggestions or a code snippet?
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
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.
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

Niko Suni

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]
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

Niko Suni

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.

This topic is closed to new replies.

Advertisement