@@ -30,12 +30,12 @@ var LibraryHtml5WebGL = {
30
30
HEAP32 [ a + i ] = 0 ;
31
31
}
32
32
33
- HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . alpha } } } >> 2 ) ] =
34
- HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . depth } } } >> 2 ) ] =
35
- HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . antialias } } } >> 2 ) ] =
36
- HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha } } } >> 2 ) ] =
37
- HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion } } } >> 2 ) ] =
38
- HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . enableExtensionsByDefault } } } >> 2 ) ] = 1 ;
33
+ HEAP8 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . alpha } } } ) ] =
34
+ HEAP8 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . depth } } } ) ] =
35
+ HEAP8 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . antialias } } } ) ] =
36
+ HEAP8 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha } } } ) ] =
37
+ HEAP8 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion } } } ) ] =
38
+ HEAP8 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . enableExtensionsByDefault } } } ) ] = 1 ;
39
39
40
40
#if PTHREADS
41
41
// Default context initialization state (user can override):
@@ -80,25 +80,25 @@ var LibraryHtml5WebGL = {
80
80
#if ASSERTIONS
81
81
assert ( attributes ) ;
82
82
#endif
83
- var a = attributes >> 2 ;
84
- var powerPreference = HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . powerPreference } } } >> 2 ) ] ;
83
+ var powerPreference = { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . powerPreference , 'i32' ) } } } ;
85
84
var contextAttributes = {
86
- 'alpha' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . alpha } } } >> 2 ) ] ,
87
- 'depth' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . depth } } } >> 2 ) ] ,
88
- 'stencil' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . stencil } } } >> 2 ) ] ,
89
- 'antialias' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . antialias } } } >> 2 ) ] ,
90
- 'premultipliedAlpha' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha } } } >> 2 ) ] ,
91
- 'preserveDrawingBuffer' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . preserveDrawingBuffer } } } >> 2 ) ] ,
85
+ 'alpha ': ! ! { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . alpha , 'i32' ) } } } ,
86
+ 'depth' : ! ! { { { makeGetValue ( ' attributes ' , C_STRUCTS . EmscriptenWebGLContextAttributes . depth , ' i32 ' ) } } } ,
87
+ 'stencil' : ! ! { { { makeGetValue ( ' attributes ' , C_STRUCTS . EmscriptenWebGLContextAttributes . stencil , ' i32 ' ) } } } ,
88
+ 'antialias ': ! ! { { { makeGetValue ( ' attributes ' , C_STRUCTS . EmscriptenWebGLContextAttributes . antialias , ' i32 ' ) } } } ,
89
+ 'premultipliedAlpha ': ! ! { { { makeGetValue ( ' attributes ' , C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha , ' i32 ' ) } } } ,
90
+ 'preserveDrawingBuffer ': ! ! { { { makeGetValue ( ' attributes ' , C_STRUCTS . EmscriptenWebGLContextAttributes . preserveDrawingBuffer , ' i32 ' ) } } } ,
92
91
'powerPreference ': emscripten_webgl_power_preferences [ powerPreference ] ,
93
- 'failIfMajorPerformanceCaveat' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . failIfMajorPerformanceCaveat } } } >> 2 ) ] ,
92
+ 'failIfMajorPerformanceCaveat' : ! ! { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . failIfMajorPerformanceCaveat , 'i32' ) } } } ,
94
93
// The following are not predefined WebGL context attributes in the WebGL specification, so the property names can be minified by Closure.
95
- majorVersion : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion } } } >> 2 ) ] ,
96
- minorVersion : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . minorVersion } } } >> 2 ) ] ,
97
- enableExtensionsByDefault : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . enableExtensionsByDefault } } } >> 2 ) ] ,
98
- explicitSwapControl : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . explicitSwapControl } } } >> 2 ) ] ,
99
- proxyContextToMainThread : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . proxyContextToMainThread } } } >> 2 ) ] ,
100
- renderViaOffscreenBackBuffer : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . renderViaOffscreenBackBuffer } } } >> 2 ) ]
94
+ majorVersion : { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion , 'i32' ) } } } ,
95
+ minorVersion : { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . minorVersion , 'i32' ) } } } ,
96
+ enableExtensionsByDefault : { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . enableExtensionsByDefault , 'i32' ) } } } ,
97
+ explicitSwapControl : { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . explicitSwapControl , 'i32' ) } } } ,
98
+ proxyContextToMainThread : { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . proxyContextToMainThread , 'i32' ) } } } ,
99
+ renderViaOffscreenBackBuffer : { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . renderViaOffscreenBackBuffer , 'i32' ) } } }
101
100
} ;
101
+ err ( contextAttributes ) ;
102
102
103
103
var canvas = findCanvasEventTarget ( target ) ;
104
104
0 commit comments