Gerrit wrote:I'm wondering why there isn't the possibility to draw on a backbuffer first.
AFAICT, you always
draw to the back buffer. Then LÖVE swaps the buffers for you automatically upon return from your draw() function.
Gerrit wrote:Are there plans to make it possible to create and edit images?
That would be nice for image compositing, but not for back-buffering. There are special memory areas of video hardware optimized for being the current framebuffer, thus "swapping" buffers is really just swapping their roles, not actually copying any memory. An API to let you create off-screen images really has very little to do with the back buffer these days.
It would make some stuff easier to do and would improve the flow. If you wonder what I'm talking about, drawing on the backbuffer could look like this:
Code: Select all
backbuffer = love.graphics.newImage( 200, 200, 32 ) -- width/height/depth
backbuffer.graphics.setBackgroundColor( 255, 255, 255 ) -- set the background white
No, it's good the way it is. How about this, though:
Code: Select all
myImage = love.graphics.newImage(200, 200, 32)
love.graphics.setColor( 0, 0, 0 ) -- set the color to black
love.graphics.rectangle( 0, 50, 50, 50, 50 ) -- draw a rectangle
love.graphics.draw( backbuffer, getWidth() / 2, getHeight() / 2 ) -- draw the backbuffer to the screen
Gerrit wrote:I really miss the possibility to create images on the fly and it's also great if you are using not the whole screen for your game. Say you have a border. Now you could draw everything on a backbuffer which is smaller then your screen and draw that into the middle. If the border is static you wouldn't need to change anything (except your backbuffer in the middle) about it every frame.
You're really worrying too much about this. Redrawing every pixel in your game's border is not very expensive on modern machines, even on handheld's. In fact, if you redrew every pixel on your screen only once,
your program would absolutely fly...
I vote for image compositing