Skip to content

Instantly share code, notes, and snippets.

@astrarudra
Created April 14, 2024 18:43
Show Gist options
  • Save astrarudra/94e5ba0d02c5a7820e6e8f744f09a761 to your computer and use it in GitHub Desktop.
Save astrarudra/94e5ba0d02c5a7820e6e8f744f09a761 to your computer and use it in GitHub Desktop.
Test WebGL - HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WebGL Test</title>
<script>
window.onload = function() {
var canvas = document.createElement('canvas');
document.body.appendChild(canvas);
var gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
if (gl) {
document.body.innerText = 'WebGL is supported!';
} else {
document.body.innerText = 'WebGL is not supported!';
}
};
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment