*bump
Back in work today. Need to understand why I get nothing on Android.
function App:Start()
self.platformname = System:GetPlatformName()
if self.platformname=="iOS" or self.platformname=="Android" then
Device:SetOrientation(1)
self.usetouchcontrols = true
self.window = Window:Create("",0,0,1000,600,0)
else
self.usetouchcontrols = false
self.window = Window:Create("",0,0,600,1000,0)
-- self.window = Window:Create("",0,0,1800,1440,0)
end
self.context = Context:Create(self.window)
self.world = World:Create()
self.camera = Camera:Create()
self.camera:SetRotation(35,0,0)
self.camera:Move(0,0,-20)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)
--Create a model and apply the material
local material1 = Material:Load("Materials/fabric/ivologo.mat")
self.model = Model:Sphere(32)
self.model:SetMaterial(material1)
self.model:SetScale(6,6,6)
return true
end
function App:Loop()
if self.window:Closed() or self.window:KeyHit(Key.Escape) then
return false
end
self.model:Turn(0,Time:GetSpeed(),0)
-- self.context:SetColor(0,0,1)
-- self.context:Clear()
local p = self.window:GetMousePosition()
p.z = 5 + (p.x/50) + (p.y/50)
p = self.camera:UnProject(p)
self.model:SetPosition(p)
Time:Update()
self.world:Update()
self.world:Render()
--Display the device information on the screen
self.context:SetBlendMode(Blend.Alpha)
self.context:DrawText("GetOrientation : "..Device:GetOrientation(),2,2)
self.context:DrawText("GetAcceleration : "..Device:GetAcceleration():ToString(),2,22)
self.context:DrawText("GetMousePosition: "..self.window:GetMousePosition():ToString(),2,42)
self.context:DrawText("platformname : "..self.platformname,2,62)
self.context:DrawText("UPS : "..Time:UPS(),2,82)
self.context:DrawText(System:GetMemoryUsage(),2,102)
self.context:Sync(true)
return true
end