Hy everyone,
I was thinking about using love for general application development, but would be essential to disable a lot of the things that are useful for games but not for a general application. To start, would be interesting to "hack" the main loop, so would be possible to save some cpu time. But how can I edit it?
At first I want to just call love.draw when needed.
Hacking love.run ()
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Hacking love.run ()
If you want to make a general application, you're most probably better off with a proper tool for that job (I read about wxlua somewhere, but I've never used it).
That said, the wiki contains the default [wiki]love.run[/wiki]. Just grab that code, edit it as you see fit and put it at the top of main.lua. That will redefine the function.
That said, the wiki contains the default [wiki]love.run[/wiki]. Just grab that code, edit it as you see fit and put it at the top of main.lua. That will redefine the function.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Hacking love.run ()
Some other options would be to save it as a separate file, like "gameloop.lua" or whatever, and either assign it to love.run in the body of your main.lua (outside any function), or for and advanced hack, you could even do this in conf.lua (inside the function this time), if you wanted to.
Up- and downsides are left as an excercise to the forumgoer.
Up- and downsides are left as an excercise to the forumgoer.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: Bing [Bot] and 1 guest