@@ -154,22 +154,18 @@ function addImmediateMode() {
154
154
uniform float pointSize;\
155
155
varying vec4 color;\
156
156
varying vec4 coord;\
157
- varying vec2 pixel;\
158
157
void main() {\
159
158
color = gl_Color;\
160
159
coord = gl_TexCoord;\
161
160
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\
162
- pixel = gl_Position.xy / gl_Position.w * 0.5 + 0.5;\
163
161
gl_PointSize = pointSize;\
164
162
}\
165
163
' , '\
166
164
uniform sampler2D texture;\
167
165
uniform float pointSize;\
168
166
uniform bool useTexture;\
169
- uniform vec2 windowSize;\
170
167
varying vec4 color;\
171
168
varying vec4 coord;\
172
- varying vec2 pixel;\
173
169
void main() {\
174
170
gl_FragColor = color;\
175
171
if (useTexture) gl_FragColor *= texture2D(texture, coord.xy);\
@@ -201,7 +197,6 @@ function addImmediateMode() {
201
197
if ( immediateMode . mode == - 1 ) throw 'mismatched gl.begin() and gl.end() calls' ;
202
198
immediateMode . mesh . compile ( ) ;
203
199
immediateMode . shader . uniforms ( {
204
- windowSize : [ gl . canvas . width , gl . canvas . height ] ,
205
200
useTexture : ! ! gl . getParameter ( gl . TEXTURE_BINDING_2D )
206
201
} ) . draw ( immediateMode . mesh , immediateMode . mode ) ;
207
202
immediateMode . mode = - 1 ;
@@ -381,11 +376,11 @@ function addOtherMethods() {
381
376
window . mozRequestAnimationFrame ||
382
377
window . webkitRequestAnimationFrame ||
383
378
function ( callback ) { setTimeout ( callback , 1000 / 60 ) ; } ;
384
- var time = new Date ( ) ;
379
+ var time = new Date ( ) . getTime ( ) ;
385
380
var context = gl ;
386
381
function update ( ) {
387
382
gl = context ;
388
- var now = new Date ( ) ;
383
+ var now = new Date ( ) . getTime ( ) ;
389
384
if ( gl . onupdate ) gl . onupdate ( ( now - time ) / 1000 ) ;
390
385
if ( gl . ondraw ) gl . ondraw ( ) ;
391
386
post ( update ) ;
0 commit comments