   [SOLVED] combine/extend texture
  It's quite simple but I am not sure how to approach it.I have two textures, lets call them tex1 and tex2. I want to extend tex1 at right edge where it ends with tex2. So now tex1 and tex2 are combined into one texture.I did some searches but came up with mostly something else or directx related. I am using SDL as a wrapper so I will be using SDL_Surface to create a texture.[Edited by - energydrink on April 22, 2010 1:21:47 PM]
  I don't know SDL but I can image two basic approaches:1. If you have the textures in system memory, you can interleave the textures' memory before uploading them, i.e. line1 of tex1, line 1 of tex2, line 2 of tex1, ...2. You can use render-to-texture approach: bind the target texture as a render target and render to quads with tex1 and tex2 to the corresponding areas of the target texture.   ;  Cool, I'll think I will look into render-to-texture approach. Not sure exactly what you meant with the first suggestion, care to elaborate?   ;  I successfully got render-to-texture to work, one quad, one texture. Thanks for the help!   ;  Just to clear up on method 1:Suppose you have the textures like this:4444  DDDD3333  CCCC2222  BBBB1111  AAAAIn memory they are stored in two 1D arrays (each 16 pixels), which might look like this:1111222233334444 and AAAABBBBCCCCDDDDCreating a texture like this4444DDDD3333CCCC2222BBBB1111AAAAwould mean to interleave the two arrays:1111AAAA2222BBBB3333CCCC4444DDDD   