ah ok... you would still have to use the same ratio as the texture itself to prevent it from stretching...
it doesn't appear to be too bad of a hit resource wise for the extra buffer... but its hard to say how many it will take until it affects you:
require("Scripts/constants/keycodes")
RegisterAbstractPath("")
Graphics(800,600)
fw=CreateFramework()
fw.main.camera:SetPositionf(0,0,-2)
SetBackgroundColor(Vec4(1,1,1,1))
material=LoadMaterial("abstract::cobblestones.mat")
mesh=CreateCube()
mesh:Paint(material)
ground=CreateCube()
ground:SetScalef(10.0,1.0,10.0)
ground:SetPositionf(0.0,-2.0,0.0)
ground:Paint(material)
light=CreateDirectionalLight()
light:SetRotationf(45,45,45)
parenttexture = LoadTexture("abstract::oildrum.dds")
childtexture = LoadTexture("abstract::locker.dds")
parentbuffer = CreateBuffer(TextureWidth(parenttexture),TextureHeight(parenttexture),1+2+4)
currentbuffer = CurrentBuffer()
function FlipHook()
SetBuffer(parentbuffer)
DrawImage(parenttexture,0, 0, TextureWidth(parenttexture),TextureHeight(parenttexture))
DrawImage(childtexture,400, 100, TextureWidth(childtexture)/3,TextureHeight(childtexture)/3)
parentimage = GetColorBuffer(parentbuffer, 0)
SetBuffer(currentbuffer)
DrawImage(parentimage,200, 200, TextureWidth(parentimage)/1.5,TextureHeight(parentimage)/1.5)
end
while AppTerminate()==0 do
mesh:Turnf(AppSpeed()*0.5,AppSpeed()*0.5,AppSpeed()*0.5)
fw:Update()
fw:Render()
Flip(0)
end
EDIT-- changed to allow for the textures to not be stretched...