Sign in to follow this  
ryan20fun

[D3D9] Texture vs Surface for Sprites

Recommended Posts

Hi EveryBody.

what would be better to use, IDirect3DTexture9 or IDirect3DSurface9 ?
i read Dissecting [url="http://www.gamedev.net/page/resources/_/reference/programming/dissecting-sprites-in-direct3d-r1608"]Sprites in D3D[/url] and see that a texture can only be as big as the Graphics card supports, where the surface has no limitation on size.

but other then that, what is the difference and why should i use the one instead of the other ?

sub question, i dont see a IDirect3DTexture10 / IDirect3DSurface10 interface, is that because it has not changed and is used in D3D 10/11 ?

Thanks in Advance.

Share this post


Link to post
Share on other sites
In general, a surface is just a memory area that holds images of a given pixel format.

A texture, on the other hand, is an union of 1 or more surfaces that can be used for texturing rendered geometry.

While it is possible to copy data directly between surfaces (offscreen to backbuffer, for example), the rendering of textures is generally faster.

Also, since textures do not limit you to rectangular copies, they are generally more suited to drawing transformable (movable, rotatable, scalable) objects such as game characters.

In D3D10 and D3D11, the interfaces are totally different from D3D9. The textures are more generalized as "shader resources", but there are still ID3D10Texture* specialized interfaces that implement typed mapping (analogous to locking) for these resources.

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