Skip to content

Added GL.Shader.fromURL(vsURL, fsURL) and GL.create({canvas: myCanvas}) #10

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
default canvas size 800x600 added back in
  • Loading branch information
toaarnio committed Oct 16, 2012
commit 8c9352bc9b99f812cb34b0be01e350c61378c6eb
7 changes: 6 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ var GL = {
// canvas.
create: function(options) {
options = options || {};
var canvas = options.canvas || document.createElement('canvas');
var canvas = options.canvas;
if (!canvas) {
canvas = document.createElement('canvas');
canvas.width = options.width || 800;
canvas.height = options.height || 600;
}
if (!('alpha' in options)) options.alpha = false;
try { gl = canvas.getContext('webgl', options); } catch (e) {}
try { gl = gl || canvas.getContext('experimental-webgl', options); } catch (e) {}
Expand Down