Difference between Surfaces and Textures?

Started by
1 comment, last by Nik02 17 years, 7 months ago
I've just started on Direct3D9, and I'm confused. I've had past experience with DirectDraw, and in DirectDraw every texture/bitmap/array of pixels was called a "surface". But in Direct3D9 they seem to be 2 different things. I thought they would be the same, just an array of pixels. But I guess not. So what's the difference between a surface and a texture in Direct3D9? Thanks.
NextWar: The Quest for Earth available now for Windows Phone 7.
Advertisement
Basically there's no difference, texture is just a superset of surfaces. One texture could have more surfaces(corresponding to each mip level)
A texture can also be volumetric (3d) or a box of six main surfaces (for cube mapping).

The concept of textures and surfaces is primarily abstract - they exist to ease the allocation and management of essentially flat video memory. DirectDraw just happens to implement this abstraction a little bit differently than D3D8 and up (and most programmers greatly prefer the new style).

In D3D9, people generally use texture objects and only extract the surface interfaces from them if some custom copying operation between the surfaces is needed. D3DX has many helpful routines for direct texture loading, so a new programmer (with a small project) may not need to access surfaces explicitly at all.

Niko Suni

This topic is closed to new replies.

Advertisement