Skip to content

Commit

Permalink
Retina support
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwinters committed Dec 26, 2017
1 parent 5a4d8d8 commit 8846e66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gl.js
Expand Up @@ -13,6 +13,8 @@ for(var i = 1; i <= 5; i++) {
const positions = new Float32Array(flatten(arrays.map(flatten)));

function initWebGL(canvas){
canvas.width = canvas.clientWidth * devicePixelRatio;
canvas.height = canvas.clientHeight * devicePixelRatio;
const gl = canvas.getContext('webgl');
const vshader = gl.createShader(gl.VERTEX_SHADER)
gl.shaderSource(vshader,
Expand Down
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -4,7 +4,7 @@
</head>
<body>
<p>Click on one of the patterns below:</p>
<canvas id='canvas' width='900' height='900'></canvas>
<canvas id='canvas' style='width: 100vmin; height: 100vmin'></canvas>
<script src='jquery-3.1.0.js'></script>
<script src='utils.js'></script>
<script src='nodes.js'></script>
Expand Down

0 comments on commit 8846e66

Please sign in to comment.