Ok thanks!
I adapted love.run to my purposes it's ok I still have events.
But do I need to process even events I don't need?
Screen goes black half of the time love.graphics.present()
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Screen goes black half of the time love.graphics.present()
You most likely need every event. If you don't need them, there's nearly no overhead - you'd have more if you tried to figure out what events you need, I think.
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
Re: Screen goes black half of the time love.graphics.present()
Is there something wrong in this? I used it to replace love.graphics.present()
Everything drawn is drawn in the canvas.
I only get black screen
Everything drawn is drawn in the canvas.
Code: Select all
love.graphics.setCanvas() -- Set target to screen
love.graphics.draw(canvas) -- Draw canvas to screen
love.graphics.present() -- Refresh screen
love.graphics.setCanvas(canvas) -- Set target to canvas
Re: Screen goes black half of the time love.graphics.present()
You don't need to replace anything or to alter love.run. Just draw whatever needs to stay to a canvas, then draw the canvas itself to screen:
Code: Select all
love.draw = function()
love.graphics.setCanvas(canvas)
--do whatever;draw a line, draw a circle, an image, whatever you need
love.graphics.setCanvas()
love.graphics.draw(canvas)
end
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
Re: Screen goes black half of the time love.graphics.present()
I changed it to
It works well now
Code: Select all
love.graphics.setColor(255, 255, 255, 255)
love.graphics.setCanvas() -- Set target to screen
love.graphics.draw(canvas) -- Draw canvas to screen
love.graphics.present() -- Refresh screen
love.graphics.setCanvas(canvas) -- Set target to canvas
Re: Screen goes black half of the time love.graphics.present()
Hey when I use love.graphics.scale or scale on love.graphics.draw(canvas), sometimes love.exe crashes randomly. Sometimes when I quit the program it crashes but sometimes it crashes in the middle of it? This is not a memory crash.
Also when I use my zoom in function, the screen gets refreshed after window is resize and I can often see the whole frame flashing upside down beneath the normal frame? There is no rotation anywhere in my code why does this happen?
EDIT: the crash always happens when I quit the program and if the window was resized by the program during execution.
Also when I use my zoom in function, the screen gets refreshed after window is resize and I can often see the whole frame flashing upside down beneath the normal frame? There is no rotation anywhere in my code why does this happen?
EDIT: the crash always happens when I quit the program and if the window was resized by the program during execution.
Who is online
Users browsing this forum: Amazon [Bot], Google [Bot] and 3 guests