aboutsummaryrefslogtreecommitdiff
path: root/src/library_egl.js
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2012-10-13 11:41:11 +0300
committerAlon Zakai <alonzakai@gmail.com>2012-10-17 12:44:20 -0700
commit5e2d3c4595aa28199a9f60c7cbd8cc699abbd32e (patch)
tree2da181e69e239c59797ff3fc11495db1e84e85f2 /src/library_egl.js
parentaedc5f0a0f128ad18a47d238c34cb603b817506a (diff)
Add explicit braces to one-liner if statements in library_egl.js.
Diffstat (limited to 'src/library_egl.js')
-rw-r--r--src/library_egl.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/library_egl.js b/src/library_egl.js
index 62a6ce67..1c35ddf4 100644
--- a/src/library_egl.js
+++ b/src/library_egl.js
@@ -25,10 +25,12 @@ var LibraryEGL = {
EGL.setErrorCode(0x300C /* EGL_BAD_PARAMETER */);
return 0;
}
- if (numConfigs)
+ if (numConfigs) {
{{{ makeSetValue('numConfigs', '0', '1', 'i32') }}}; // Total number of supported configs: 1.
- if (config && config_size > 0)
+ }
+ if (config && config_size > 0) {
{{{ makeSetValue('config', '0', '62002' /* Magic ID for the only EGLConfig supported by Emscripten */, 'i32') }}};
+ }
EGL.setErrorCode(0x3000 /* EGL_SUCCESS */);
return 1;
@@ -45,8 +47,9 @@ var LibraryEGL = {
// "emulates" X11, and eglGetDisplay is expected to accept/receive a pointer to an X11 Display object.
// Therefore, be lax and allow anything to be passed in, and return the magic handle to our default EGLDisplay object.
-// if (nativeDisplayType == 0 /* EGL_DEFAULT_DISPLAY */)
+// if (nativeDisplayType == 0 /* EGL_DEFAULT_DISPLAY */) {
return 62000; // Magic ID for Emscripten 'default display'
+// }
// else
// return 0; // EGL_NO_DISPLAY
},
@@ -54,10 +57,12 @@ var LibraryEGL = {
// EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
eglInitialize: function(display, majorVersion, minorVersion) {
if (display == 62000 /* Magic ID for Emscripten 'default display' */) {
- if (majorVersion)
+ if (majorVersion) {
{{{ makeSetValue('majorVersion', '0', '1', 'i32') }}}; // Advertise EGL Major version: '1'
- if (minorVersion)
+ }
+ if (minorVersion) {
{{{ makeSetValue('minorVersion', '0', '4', 'i32') }}}; // Advertise EGL Minor version: '4'
+ }
EGL.setErrorCode(0x3000 /* EGL_SUCCESS */);
return 1;
}