Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- define functions to be used later -->
- <script type="text/javascript">
- var GLwall;
- function GLdraw(){
- }
- function startGL(canvas) {
- GLwall = null;
- // Try to grab the standard context. If it fails, fallback to experimental.
- GLwall = canvas.getContext("webgl", {alpha: false}) ||
- canvas.getContext("experimental-webgl", {alpha: false});
- if (!GLwall) {
- alert("Could not initialise WebGL, sorry :-(");
- }else{
- canvas.width = 400;
- canvas.height = 300;
- GLwall.viewport(0, 0, canvas.width, canvas.height);
- GLdraw();
- }
- }
- </script>
- <!-- define the canvas element -->
- <canvas id="webglTest1" width=400 height=300 ></canvas>
- <!-- call the startGL function to start the canvas element -->
- <script type="text/javascript">
- var startTest1 = document.getElementById('webglTest1');
- startGL(startTest1);
- </script>
Add Comment
Please, Sign In to add comment