Surface vs. Texture

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Surface vs. Texture

      I am wondering in a 2D game, when is the right time to use surfaces and when to use textrures?

      Is it that surfaces should be used for the background?
      and textured Sprites for each game object?

      Can the background be a textured quad?

      What is the correct way to do this? or is it really up to a matter of preference?

    • It is a matter of preference. Sprites actually just create quads with textures just as you might do.

      Doing your own textured quads would allow you to use pixel shaders which I don't think sprites allow.

      Copying a surface is usually used only for backgrounds, sprites and quads can be used for backgrounds as well.

      If you don't need pixel shaders for your 2D game or only need it as a post processing effect I'd suggest to use sprites. Very simple way of drawing the game objects (and backgrounds), sort by Z in case your game allows different heights (like let's say, Ultima 7) and will get results really fast, easy to animate too.