Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native functions not working #28

Open
cpBurn opened this issue Jun 11, 2015 · 1 comment
Open

Native functions not working #28

cpBurn opened this issue Jun 11, 2015 · 1 comment

Comments

@cpBurn
Copy link

cpBurn commented Jun 11, 2015

By the description:

var canvas = fx.canvas();
Before you can apply any filters you will need a canvas, which stores the result of the filters you apply. Canvas creation is done through fx.canvas(), which creates and returns a new WebGL tag with additional methods specific to glfx.js. This call will throw an error message if the browser doesn't support WebGL.

But

var canvas = fx.canvas();
var ctx = canvas.getContext('2d'); //Returns null

Also drawImage, getImageData, putImageData throws "not a function" error.

I want to take advantage of some effects of Glfx and also do some work on my own. For example use Glitch effect (http://snorpey.github.io/jpg-glitch/).

@fesor
Copy link

fesor commented Jun 18, 2015

You can't have two context on single canvas

var canvas1 = document.createElement('canvas'),
      cavas2 = document.createElement('canvas');

canvas1.getContext('2d'); //CanvasRenderingContext2D
canvas1.getContext('webgl'); // null
canvas2.getContext('webgl'); //WebGLRenderingContext
canvas2.getContext('2d'); // null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants