@@ -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 = [
@@ -280,7 +280,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
280
280
// glGetError() to fetch it. As per GLES2 spec, only the first error is
281
281
// remembered, and subsequent errors are discarded until the user has
282
282
// cleared the stored error by a call to glGetError().
283
- recordError : function recordError ( errorCode ) {
283
+ recordError : ( errorCode ) => {
284
284
#if GL_TRACK_ERRORS
285
285
if ( ! GL . lastError ) {
286
286
GL . lastError = errorCode ;
@@ -370,7 +370,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
370
370
}
371
371
} ,
372
372
373
- getTempVertexBuffer : function getTempVertexBuffer ( sizeBytes ) {
373
+ getTempVertexBuffer : ( sizeBytes ) = > {
374
374
var idx = GL . log2ceilLookup ( sizeBytes ) ;
375
375
var ringbuffer = GL . currentContext . tempVertexBuffers1 [ idx ] ;
376
376
var nextFreeBufferIndex = GL . currentContext . tempVertexBufferCounters1 [ idx ] ;
@@ -387,7 +387,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
387
387
return ringbuffer [ nextFreeBufferIndex ] ;
388
388
} ,
389
389
390
- getTempIndexBuffer : function getTempIndexBuffer ( sizeBytes ) {
390
+ getTempIndexBuffer : ( sizeBytes ) => {
391
391
var idx = GL . log2ceilLookup ( sizeBytes ) ;
392
392
var ibo = GL . currentContext . tempIndexBuffers [ idx ] ;
393
393
if ( ibo ) {
@@ -405,7 +405,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
405
405
// doublebuffered temp VB memory pointers, so that every second frame
406
406
// utilizes different set of temp buffers. The aim is to keep the set of
407
407
// buffers being rendered, and the set of buffers being updated disjoint.
408
- newRenderingFrameStarted : function newRenderingFrameStarted ( ) {
408
+ newRenderingFrameStarted : ( ) = > {
409
409
if ( ! GL . currentContext ) {
410
410
return ;
411
411
}
@@ -450,13 +450,13 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
450
450
451
451
#if GL_FFP_ONLY
452
452
enabledClientAttribIndices : [ ] ,
453
- enableVertexAttribArray : function enableVertexAttribArray ( index ) {
453
+ enableVertexAttribArray : ( index ) = > {
454
454
if ( ! GL . enabledClientAttribIndices [ index ] ) {
455
455
GL . enabledClientAttribIndices [ index ] = true ;
456
456
GLctx . enableVertexAttribArray ( index ) ;
457
457
}
458
458
} ,
459
- disableVertexAttribArray : function disableVertexAttribArray ( index ) {
459
+ disableVertexAttribArray : ( index ) => {
460
460
if ( GL . enabledClientAttribIndices [ index ] ) {
461
461
GL . enabledClientAttribIndices [ index ] = false ;
462
462
GLctx . disableVertexAttribArray ( index ) ;
@@ -465,7 +465,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
465
465
#endif
466
466
467
467
#if FULL_ES2
468
- calcBufLength : function calcBufLength ( size , type , stride , count ) {
468
+ calcBufLength : ( size , type , stride , count ) => {
469
469
if ( stride > 0 ) {
470
470
return count * stride ; // XXXvlad this is not exactly correct I don't think
471
471
}
@@ -475,7 +475,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
475
475
476
476
usedTempBuffers : [ ] ,
477
477
478
- preDrawHandleClientVertexAttribBindings : function preDrawHandleClientVertexAttribBindings ( count ) {
478
+ preDrawHandleClientVertexAttribBindings : ( count ) = > {
479
479
GL . resetBufferBinding = false ;
480
480
481
481
// TODO: initial pass to detect ranges we need to upload, might not need
@@ -499,7 +499,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
499
499
}
500
500
} ,
501
501
502
- postDrawHandleClientVertexAttribBindings : function postDrawHandleClientVertexAttribBindings ( ) {
502
+ postDrawHandleClientVertexAttribBindings : ( ) = > {
503
503
if ( GL . resetBufferBinding ) {
504
504
GLctx . bindBuffer ( 0x8892 /*GL_ARRAY_BUFFER*/ , GL . buffers [ GLctx . currentArrayBufferBinding ] ) ;
505
505
}
@@ -3673,7 +3673,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
3673
3673
, '$emulGlGenVertexArrays'
3674
3674
#endif
3675
3675
] ,
3676
- glGenVertexArrays : function ( n , arrays ) {
3676
+ glGenVertexArrays : ( n , arrays ) = > {
3677
3677
#if LEGACY_GL_EMULATION
3678
3678
emulGlGenVertexArrays ( n , arrays ) ;
3679
3679
#else
@@ -4204,13 +4204,13 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
4204
4204
'SDL_GL_GetProcAddress' ,
4205
4205
'eglGetProcAddress' ,
4206
4206
'glfwGetProcAddress'
4207
- ] . forEach ( function ( name ) {
4208
- LibraryGL [ name ] = function ( name ) { abort ( ) ; return 0 ; } ;
4207
+ ] . forEach ( ( name ) => {
4208
+ LibraryGL [ name ] = ( name ) => { abort ( ) ; return 0 ; } ;
4209
4209
// Due to the two pass nature of compiling .js files,
4210
4210
// in INCLUDE_FULL_LIBRARY mode, we must include the above
4211
4211
// stub functions, but not their __deps message handlers.
4212
4212
#if ! INCLUDE_FULL_LIBRARY
4213
- LibraryGL [ name + '__deps' ] = [ function ( ) {
4213
+ LibraryGL [ name + '__deps' ] = [ ( ) => {
4214
4214
error ( `linker: Undefined symbol: ${ name } (). Please pass -sGL_ENABLE_GET_PROC_ADDRESS at link time to link in ${ name } ().` ) ;
4215
4215
} ] ;
4216
4216
#endif
@@ -4235,15 +4235,12 @@ function createGLPassthroughFunctions(lib, funcs) {
4235
4235
const num = data [ 0 ] ;
4236
4236
const names = data [ 1 ] ;
4237
4237
const args = range ( num ) . map ( ( i ) => 'x' + i ) . join ( ', ' ) ;
4238
- const plainStub = `(function(${ args } ) { GLctx.NAME(${ args } ) })` ;
4239
- const returnStub = `(function(${ args } ) { return GLctx.NAME(${ args } ) })` ;
4238
+ const stub = `(${ args } ) => GLctx.NAME(${ args } )` ;
4240
4239
const sigEnd = range ( num ) . map ( ( ) => 'i' ) . join ( '' ) ;
4241
4240
names . split ( ' ' ) . forEach ( ( name ) => {
4242
- let stub = plainStub ;
4243
4241
let sig ;
4244
4242
if ( name . endsWith ( '*' ) ) {
4245
4243
name = name . slice ( 0 , - 1 ) ;
4246
- stub = returnStub ;
4247
4244
sig = 'i' + sigEnd ;
4248
4245
} else {
4249
4246
sig = 'v' + sigEnd ;
0 commit comments