From cd5d048d1c2f26b5333d5a8dfd11193b87260974 Mon Sep 17 00:00:00 2001 From: xgoff Date: Fri, 3 Aug 2012 16:38:03 -0500 Subject: add version check --- README.md | 4 ++-- fakecanvas.lua | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 22f5e2c..2e0c6a3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ fakecanvas is an attempt at emulating the functionality of canvases (render to texture) for hardware that does not support them. -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). +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: @@ -51,7 +51,7 @@ fakecanvas directly replaces some of LÖVE's functions, so there are no special * `setOption(name, value)`: sets the option `name` to `value`. current options are: * `"vflip"`: use vertically-flipped texture coords for the canvas image, to match those of real canvases. visually this makes no difference, but does make a difference inside shaders. if your shaders are not sensitive to this information, you can disable this option and get a possible performance boost. by setting this option before calling `setCanvas()`, you can control this behavior on a per fake canvas basis. boolean: default `true` -* `getOption(name)`: gets the current value of option `name`. +* `getOption(name)`: gets the current value of option `name` ### Example main.lua diff --git a/fakecanvas.lua b/fakecanvas.lua index b170896..3827366 100644 --- a/fakecanvas.lua +++ b/fakecanvas.lua @@ -24,6 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --]] +assert(love._version:match "^0.8", "fakecanvas requires LOVE 0.8") assert(debug, "fake canvases require access to the debug library") local canvas_supported = love.graphics.isSupported "canvas" -- cgit v1.2.3-54-g00ecf