|
@@ -129,7 +129,7 @@
|
|
|
</style>
|
|
</style>
|
|
|
</head>
|
|
</head>
|
|
|
<body class="">
|
|
<body class="">
|
|
|
- @* <canvas id="canvas"></canvas> *@
|
|
|
|
|
|
|
+ <canvas id="canvas"></canvas>
|
|
|
<div id="msg-box"></div>
|
|
<div id="msg-box"></div>
|
|
|
<script src="~/Scripts/jquery.signalR-2.4.1.min.js"></script>
|
|
<script src="~/Scripts/jquery.signalR-2.4.1.min.js"></script>
|
|
|
<script src="~/signalr/hubs"></script>
|
|
<script src="~/signalr/hubs"></script>
|
|
@@ -347,14 +347,16 @@
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
- <script>
|
|
|
|
|
|
|
+<script>
|
|
|
|
|
|
|
|
////Based on https://www.youtube.com/watch?v=3CycKKJiwis
|
|
////Based on https://www.youtube.com/watch?v=3CycKKJiwis
|
|
|
var canvas = document.getElementById("canvas");
|
|
var canvas = document.getElementById("canvas");
|
|
|
var mobile = navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i);
|
|
var mobile = navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i);
|
|
|
- canvas.width = window.innerWidth;
|
|
|
|
|
- canvas.height = window.innerHeight; // Initialize the GL context
|
|
|
|
|
-
|
|
|
|
|
|
|
+ //canvas.width = window.innerWidth;
|
|
|
|
|
+ //canvas.height = window.innerHeight; // Initialize the GL context
|
|
|
|
|
+ // 背景调整为图片,canvas宽度为0
|
|
|
|
|
+ canvas.width = 0;
|
|
|
|
|
+ canvas.height = 0;
|
|
|
var gl = canvas.getContext('webgl');
|
|
var gl = canvas.getContext('webgl');
|
|
|
|
|
|
|
|
if (!gl) {
|
|
if (!gl) {
|
|
@@ -379,6 +381,8 @@
|
|
|
function onWindowResize() {
|
|
function onWindowResize() {
|
|
|
canvas.width = window.innerWidth;
|
|
canvas.width = window.innerWidth;
|
|
|
canvas.height = window.innerHeight;
|
|
canvas.height = window.innerHeight;
|
|
|
|
|
+ canvas.width = 0;
|
|
|
|
|
+ canvas.height = 0;
|
|
|
gl.viewport(0, 0, canvas.width, canvas.height);
|
|
gl.viewport(0, 0, canvas.width, canvas.height);
|
|
|
gl.uniform1f(widthHandle, window.innerWidth);
|
|
gl.uniform1f(widthHandle, window.innerWidth);
|
|
|
gl.uniform1f(heightHandle, window.innerHeight);
|
|
gl.uniform1f(heightHandle, window.innerHeight);
|