Jump to content

Should I call getTexture out of render loop ?


Tchernobill

Recommended Posts

Hi,

 

Do you think I should continue to call getTexture within the render loop or is it worth the added work/complexity to store getTexture to minimise thoses calls.

 

1/ keep it simple s.

function ISUICustom:render()
	self:drawTexture(getTexture("MyPrettyPic.png"), 0, 0, 1, 1, 1, 1);
end

2/ preload getTexture

function ISUICustom:render()
	self:drawTexture(self.texture, 0, 0, 1, 1, 1, 1);
end

function ISUICustom:new()
	self.texture = getTexture("MyPrettyPic.png");
end

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...