Jump to content

Memory leak, Hide Widget Panel.


Yue
 Share

Recommended Posts

--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
local camera = Camera:Create()
camera:Move(0,0,-3)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)

model = Model:Box()
model:SetColor(0.0,0.0,1.0)


local gui = GUI:Create(context)
local base = gui:GetBase()
base:SetScript("Scripts/GUI/Panel.lua")
base:SetObject("backgroundcolor",Vec4(0,0,0,0.1))
pnl = Widget:Panel(300,100,200,200,base)

cam = Camera:Create()
while true do
        if window:Closed() or window:KeyHit(Key.Escape) then return false end

	--Time:Pause()
	pnl:Hide()
        model:Turn(0,Time:GetSpeed(),0);

        Time:Update()
        world:Update()
	
	
        world:Render()
		context:DrawStats(10, 10)
        context:Sync(false)
       collectgarbage()
end

 

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...