diff options
-rw-r--r-- | README.md | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,12 +1,14 @@ ##fakecanvas -fakecanvas is an attempt at emulating the functionality of canvases (render to texture) for hardware that does not support them. +fakecanvas is an attempt at emulating the functionality of canvases (render to texture) for hardware that does not support them. it was meant to answer a question: can you do it? the answer is yes, but at a cost... it is more or less a drop-in library, in that all you need to do is call `require 'fakecanvas'` (preferably inside `love.load`) to use it. fakecanvas' own functions will only be used if `love.graphics.isSupported "canvas"` is false, unless this behavior is overridden (see below). note: you must be using LÖVE 0.8 it uses (a few) screenshots in order to isolate drawing operations, which means there are some amusing drawbacks: * `setCanvas()` is fairly expensive +* clearing a canvas is really expensive +* each `setCanvas()` call will allocate several megs of ram, this isn't a huge deal if you draw to canvases only occasionally. draw to one every frame, though... * possible drawing issues if you call `love.graphics.present()` yourself, specifically between `setCanvas()` calls * canvas width/height cannot exceed the window's width/height, and if your hardware lacks PO2 support, canvases will be further limited to that as well. ie: for an 800x600 display the max canvas size is 512x512. 1024x768 will limit you to 1024x512, and so on. * any other weirdness you might run across |