@@ -55,25 +55,25 @@ var LibraryHtml5WebGL = {
55
55
#if ASSERTIONS
56
56
assert ( attributes ) ;
57
57
#endif
58
- var a = attributes >> 2 ;
59
- var powerPreference = HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . powerPreference } } } >> 2 ) ] ;
58
+ var powerPreference = { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . powerPreference , 'i32' ) } } } ;
60
59
var contextAttributes = {
61
- 'alpha' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . alpha } } } >> 2 ) ] ,
62
- 'depth' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . depth } } } >> 2 ) ] ,
63
- 'stencil' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . stencil } } } >> 2 ) ] ,
64
- 'antialias' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . antialias } } } >> 2 ) ] ,
65
- 'premultipliedAlpha' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha } } } >> 2 ) ] ,
66
- 'preserveDrawingBuffer' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . preserveDrawingBuffer } } } >> 2 ) ] ,
60
+ 'alpha' : ! ! { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . alpha , 'i32' ) } } } ,
61
+ 'depth' : ! ! { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . depth , 'i32' ) } } } ,
62
+ 'stencil' : ! ! { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . stencil , 'i32' ) } } } ,
63
+ 'antialias' : ! ! { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . antialias , 'i32' ) } } } ,
64
+ 'premultipliedAlpha' : ! ! { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha , 'i32' ) } } } ,
65
+ 'preserveDrawingBuffer' : ! ! { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . preserveDrawingBuffer , 'i32' ) } } } ,
67
66
'powerPreference' : emscripten_webgl_power_preferences [ powerPreference ] ,
68
- 'failIfMajorPerformanceCaveat' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . failIfMajorPerformanceCaveat } } } >> 2 ) ] ,
67
+ 'failIfMajorPerformanceCaveat' : ! ! { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . failIfMajorPerformanceCaveat , 'i32' ) } } } ,
69
68
// The following are not predefined WebGL context attributes in the WebGL specification, so the property names can be minified by Closure.
70
- majorVersion : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion } } } >> 2 ) ] ,
71
- minorVersion : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . minorVersion } } } >> 2 ) ] ,
72
- enableExtensionsByDefault : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . enableExtensionsByDefault } } } >> 2 ) ] ,
73
- explicitSwapControl : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . explicitSwapControl } } } >> 2 ) ] ,
74
- proxyContextToMainThread : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . proxyContextToMainThread } } } >> 2 ) ] ,
75
- renderViaOffscreenBackBuffer : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . renderViaOffscreenBackBuffer } } } >> 2 ) ]
69
+ majorVersion: { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion , 'i32' ) } } } ,
70
+ minorVersion: { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . minorVersion , 'i32' ) } } } ,
71
+ enableExtensionsByDefault: { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . enableExtensionsByDefault , 'i32' ) } } } ,
72
+ explicitSwapControl: { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . explicitSwapControl , 'i32' ) } } } ,
73
+ proxyContextToMainThread: { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . proxyContextToMainThread , 'i32' ) } } } ,
74
+ renderViaOffscreenBackBuffer: { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . renderViaOffscreenBackBuffer , 'i32' ) } } }
76
75
} ;
76
+ err ( contextAttributes ) ;
77
77
78
78
var canvas = findCanvasEventTarget ( target ) ;
79
79
0 commit comments