]> git.cworth.org Git - apitrace/blobdiff - wrappers/egltrace.py
check for error in eglMakeCurrent wrapper
[apitrace] / wrappers / egltrace.py
index 81ae3c2ec16717ab49c524733dd892f52d5792d7..f40b8a06a863e2875d8704d6c8f64d4f03d1e82c 100644 (file)
@@ -53,18 +53,20 @@ class EglTracer(GlTracer):
         GlTracer.traceFunctionImplBody(self, function)
 
         if function.name == 'eglMakeCurrent':
-            print '    // update the profile'
-            print '    if (ctx != EGL_NO_CONTEXT) {'
-            print '        EGLint api = EGL_OPENGL_ES_API, version = 1;'
-            print '        gltrace::Context *tr = gltrace::getContext();'
-            print '        _eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_TYPE, &api);'
-            print '        _eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_VERSION, &version);'
-            print '        if (api == EGL_OPENGL_API)'
-            print '            tr->profile = gltrace::PROFILE_COMPAT;'
-            print '        else if (version == 1)'
-            print '            tr->profile = gltrace::PROFILE_ES1;'
-            print '        else'
-            print '            tr->profile = gltrace::PROFILE_ES2;'
+            print '    if (_result) {'
+            print '        // update the profile'
+            print '        if (ctx != EGL_NO_CONTEXT) {'
+            print '            EGLint api = EGL_OPENGL_ES_API, version = 1;'
+            print '            gltrace::Context *tr = gltrace::getContext();'
+            print '            _eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_TYPE, &api);'
+            print '            _eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_VERSION, &version);'
+            print '            if (api == EGL_OPENGL_API)'
+            print '                tr->profile = gltrace::PROFILE_COMPAT;'
+            print '            else if (version == 1)'
+            print '                tr->profile = gltrace::PROFILE_ES1;'
+            print '            else'
+            print '                tr->profile = gltrace::PROFILE_ES2;'
+            print '        }'
             print '    }'