@@ -136,7 +136,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
136
136
emscripten_webgl_enable_WEBGL_multi_draw : ( ctx ) => webgl_enable_WEBGL_multi_draw ( GL . contexts [ ctx ] . GLctx ) ,
137
137
138
138
$getEmscriptenSupportedExtensions__internal : true ,
139
- $getEmscriptenSupportedExtensions : function ( ctx ) {
139
+ $getEmscriptenSupportedExtensions : ( ctx ) => {
140
140
// Restrict the list of advertised extensions to those that we actually
141
141
// support.
142
142
var supportedExtensions = [
@@ -287,7 +287,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
287
287
// glGetError() to fetch it. As per GLES2 spec, only the first error is
288
288
// remembered, and subsequent errors are discarded until the user has
289
289
// cleared the stored error by a call to glGetError().
290
- recordError : function recordError ( errorCode ) {
290
+ recordError : ( errorCode ) => {
291
291
#if GL_TRACK_ERRORS
292
292
if ( ! GL . lastError ) {
293
293
GL . lastError = errorCode ;
@@ -377,7 +377,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
377
377
}
378
378
} ,
379
379
380
- getTempVertexBuffer : function getTempVertexBuffer ( sizeBytes ) {
380
+ getTempVertexBuffer : ( sizeBytes ) = > {
381
381
var idx = GL . log2ceilLookup ( sizeBytes ) ;
382
382
var ringbuffer = GL . currentContext . tempVertexBuffers1 [ idx ] ;
383
383
var nextFreeBufferIndex = GL . currentContext . tempVertexBufferCounters1 [ idx ] ;
@@ -394,7 +394,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
394
394
return ringbuffer [ nextFreeBufferIndex ] ;
395
395
} ,
396
396
397
- getTempIndexBuffer : function getTempIndexBuffer ( sizeBytes ) {
397
+ getTempIndexBuffer : ( sizeBytes ) => {
398
398
var idx = GL . log2ceilLookup ( sizeBytes ) ;
399
399
var ibo = GL . currentContext . tempIndexBuffers [ idx ] ;
400
400
if ( ibo ) {
@@ -412,7 +412,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
412
412
// doublebuffered temp VB memory pointers, so that every second frame
413
413
// utilizes different set of temp buffers. The aim is to keep the set of
414
414
// buffers being rendered, and the set of buffers being updated disjoint.
415
- newRenderingFrameStarted : function newRenderingFrameStarted ( ) {
415
+ newRenderingFrameStarted : ( ) = > {
416
416
if ( ! GL . currentContext ) {
417
417
return ;
418
418
}
@@ -457,13 +457,13 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
457
457
458
458
#if GL_FFP_ONLY
459
459
enabledClientAttribIndices : [ ] ,
460
- enableVertexAttribArray : function enableVertexAttribArray ( index ) {
460
+ enableVertexAttribArray : ( index ) = > {
461
461
if ( ! GL . enabledClientAttribIndices [ index ] ) {
462
462
GL . enabledClientAttribIndices [ index ] = true ;
463
463
GLctx . enableVertexAttribArray ( index ) ;
464
464
}
465
465
} ,
466
- disableVertexAttribArray : function disableVertexAttribArray ( index ) {
466
+ disableVertexAttribArray : ( index ) => {
467
467
if ( GL . enabledClientAttribIndices [ index ] ) {
468
468
GL . enabledClientAttribIndices [ index ] = false ;
469
469
GLctx . disableVertexAttribArray ( index ) ;
@@ -472,7 +472,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
472
472
#endif
473
473
474
474
#if FULL_ES2
475
- calcBufLength : function calcBufLength ( size , type , stride , count ) {
475
+ calcBufLength : ( size , type , stride , count ) => {
476
476
if ( stride > 0 ) {
477
477
return count * stride ; // XXXvlad this is not exactly correct I don't think
478
478
}
@@ -482,7 +482,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
482
482
483
483
usedTempBuffers : [ ] ,
484
484
485
- preDrawHandleClientVertexAttribBindings : function preDrawHandleClientVertexAttribBindings ( count ) {
485
+ preDrawHandleClientVertexAttribBindings : ( count ) = > {
486
486
GL . resetBufferBinding = false ;
487
487
488
488
// TODO: initial pass to detect ranges we need to upload, might not need
@@ -506,7 +506,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
506
506
}
507
507
} ,
508
508
509
- postDrawHandleClientVertexAttribBindings : function postDrawHandleClientVertexAttribBindings ( ) {
509
+ postDrawHandleClientVertexAttribBindings : ( ) = > {
510
510
if ( GL . resetBufferBinding ) {
511
511
GLctx . bindBuffer ( 0x8892 /*GL_ARRAY_BUFFER*/ , GL . buffers [ GLctx . currentArrayBufferBinding ] ) ;
512
512
}
@@ -3680,7 +3680,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
3680
3680
, '$emulGlGenVertexArrays'
3681
3681
#endif
3682
3682
] ,
3683
- glGenVertexArrays : function ( n , arrays ) {
3683
+ glGenVertexArrays : ( n , arrays ) = > {
3684
3684
#if LEGACY_GL_EMULATION
3685
3685
emulGlGenVertexArrays ( n , arrays ) ;
3686
3686
#else
@@ -4211,13 +4211,13 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
4211
4211
'SDL_GL_GetProcAddress' ,
4212
4212
'eglGetProcAddress' ,
4213
4213
'glfwGetProcAddress'
4214
- ] . forEach ( function ( name ) {
4215
- LibraryGL [ name ] = function ( name ) { abort ( ) ; return 0 ; } ;
4214
+ ] . forEach ( ( name ) => {
4215
+ LibraryGL [ name ] = ( name ) => { abort ( ) ; return 0 ; } ;
4216
4216
// Due to the two pass nature of compiling .js files,
4217
4217
// in INCLUDE_FULL_LIBRARY mode, we must include the above
4218
4218
// stub functions, but not their __deps message handlers.
4219
4219
#if ! INCLUDE_FULL_LIBRARY
4220
- LibraryGL [ name + '__deps' ] = [ function ( ) {
4220
+ LibraryGL [ name + '__deps' ] = [ ( ) => {
4221
4221
error ( `linker: Undefined symbol: ${ name } (). Please pass -sGL_ENABLE_GET_PROC_ADDRESS at link time to link in ${ name } ().` ) ;
4222
4222
} ] ;
4223
4223
#endif
@@ -4242,15 +4242,12 @@ function createGLPassthroughFunctions(lib, funcs) {
4242
4242
const num = data [ 0 ] ;
4243
4243
const names = data [ 1 ] ;
4244
4244
const args = range ( num ) . map ( ( i ) => 'x' + i ) . join ( ', ' ) ;
4245
- const plainStub = `(function(${ args } ) { GLctx.NAME(${ args } ) })` ;
4246
- const returnStub = `(function(${ args } ) { return GLctx.NAME(${ args } ) })` ;
4245
+ const stub = `(${ args } ) => GLctx.NAME(${ args } )` ;
4247
4246
const sigEnd = range ( num ) . map ( ( ) => 'i' ) . join ( '' ) ;
4248
4247
names . split ( ' ' ) . forEach ( ( name ) => {
4249
- let stub = plainStub ;
4250
4248
let sig ;
4251
4249
if ( name . endsWith ( '*' ) ) {
4252
4250
name = name . slice ( 0 , - 1 ) ;
4253
- stub = returnStub ;
4254
4251
sig = 'i' + sigEnd ;
4255
4252
} else {
4256
4253
sig = 'v' + sigEnd ;
0 commit comments