Quote:Original post by Nik02Quote:Original post by MannyCalavera
Is more convenient == slow in any cas when I use these (my try with LoadSurfaceFromSurface was damn slow)? :)
LoadSurfaceFromSurface is relatively slow, if it has to filter the data or format conversion is required. If both the source and destination are of exactly same size and format, then the function, as far as I know, performs a direct blit and that is fast. Remember: if you want to stretch the data with your own function, it will have to do the same steps anyway.
Woah, this information will come in handy. :) Thanks.
Quote:Original post by Nik02Quote:
I always thought locking was only required when I change vertices diffuse colors and so (I did some pure 3d-programming before I took the ID3DXSprites). Is it necessary as long as I use this functions?
Any function that moves data between d3d resources have to lock the said resources, be it manually or internally by d3d. The functions that I listed do lock the resources, but it is transparent to the programmer. Nevertheless, any type of lock should be avoided unless necessary, because it may stall the rendering pipe - as the hw cannot do anything with the locked data before it is unlocked.
Ok, so I'll have to look out to prevent unnecessary locking.
Quote:Original post by Nik02Quote:
I tried it as GraphicsBas suggested, but the alphachannel of the part of surface 1 which I drew on surface 3 seems to clear the underlying pixels (from surface 2).
Do you know of any problems with alphachannels and this kind of "surface-compositing"?
The surface transfer functions do not perform alpha-blending; instead, they just overwrite the destination alpha values with the source alpha values.
If you want to do alpha blending, you need to render some geometry (a quad, for example) with the texture containing the alpha values to the destination surface (which must be designated as a render target). Of course, you could also manually lock the surfaces, and do software blending on them, but that is usually orders of magnitude slower than the equivalent hardware procedure.
Well, I'm not entirely sure how to do this. I can create a rectangle and texture it so far and I also know how to show it on the screen. What I didn't understand yet is how to use surfaces as RenderTargets (all my tries with Device.CreateRenderTarget didn't work out like I hoped). If you could give me a quick push in the right direction I would be very happy. :)
Quote:Original post by Nik02
Please ask for more info if needed.
Thanks for the kind offer. I just did. :)
And thanks again for the great help and all the information.