I'm trying to draw antialiased arcs and circles but they slow down the environment alot. So i thought of trying to cache them by drawing them to an image or something.
I looked through the documentation and turns out there is a way - draw to a framebuffer. I tried it but I got an error message "not supported by your opengl implementation". Even if my computer would support it, it meant that the feature isn't portable. =\
I thought of drawing to an image, but there is no way to redirect drawing operations to images... that means I have to come up with a copy of every love.graphics drawing operation, (polygon, rectangle, line, etc...).
Maybe I should just switch to a computer with a complete opengl driver...
How to cache drawing operations?
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: How to cache drawing operations?
Your computer may yet support framebuffers. Make sure not to create a framebuffer with a non-Po2 resolution. Create one with something like 32x32, 64x64, 128x128 ... 1024x1024.
ImageData might be what you're looking for. You can then convert an ImageData object into an Image to be drawn. Make sure you don't do this heaps, it's not the fastest thing in the world.appleide wrote:I thought of drawing to an image, but there is no way to redirect drawing operations to images... that means I have to come up with a copy of every love.graphics drawing operation, (polygon, rectangle, line, etc...).
Re: How to cache drawing operations?
Yeah, but then I'd have to rewrite all those functions for use on images... :/BlackBulletIV wrote:Your computer may yet support framebuffers. Make sure not to create a framebuffer with a non-Po2 resolution. Create one with something like 32x32, 64x64, 128x128 ... 1024x1024.
ImageData might be what you're looking for. You can then convert an ImageData object into an Image to be drawn. Make sure you don't do this heaps, it's not the fastest thing in the world.appleide wrote:I thought of drawing to an image, but there is no way to redirect drawing operations to images... that means I have to come up with a copy of every love.graphics drawing operation, (polygon, rectangle, line, etc...).
Also, noticed there's no way to convert framebuffers into imagedata; You can't seem to save stuff from the screen into a file?
- TechnoCat
- Inner party member
- Posts: 1612
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: How to cache drawing operations?
http://love2d.org/wiki/Framebuffer:getImageDataappleide wrote:Also, noticed there's no way to convert framebuffers into imagedata; You can't seem to save stuff from the screen into a file?
http://love2d.org/wiki/love.graphics.newScreenshot
and http://love2d.org/forums/viewtopic.php? ... ving+image
Re: How to cache drawing operations?
I just wasn't looking hard enough before I made that comment.TechnoCat wrote:http://love2d.org/wiki/Framebuffer:getImageDataappleide wrote:Also, noticed there's no way to convert framebuffers into imagedata; You can't seem to save stuff from the screen into a file?
http://love2d.org/wiki/love.graphics.newScreenshot
and http://love2d.org/forums/viewtopic.php? ... ving+image
Re: How to cache drawing operations?
Here's another example of drawing to an image:
http://love2d.org/forums/viewtopic.php?f=5&t=2576
http://love2d.org/forums/viewtopic.php?f=5&t=2576
Who is online
Users browsing this forum: No registered users and 3 guests