<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><p style="margin-top:0px;color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008000373840332px">Please help,</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008000373840332px">I have been going around and around with this problem but cannot seem to make any headway. I hope that one of you OpenGL EGL experts can help.<span class="gmail-Apple-converted-space"> </span><img src="https://community.khronos.org/images/emoji/twitter/slight_smile.png?v=12" title=":slight_smile:" class="emoji" alt=":slight_smile:" width="20" height="20" style="border-style: none; vertical-align: middle; width: 20px; height: 20px; aspect-ratio: 20 / 20;"></p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008000373840332px">I have created a program that uses OpenGL EGL (version 1.5) with OpenGL 3 that successfully renders an offscreen triangle and saves it to an image file (PNG) when I<span class="gmail-Apple-converted-space"> </span>ssh<span class="gmail-Apple-converted-space"> </span><em>without</em><span class="gmail-Apple-converted-space"> </span>X11 forwarding on my Linux (Ubuntu 22.04) machine.</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008000373840332px">However when I try the same thing using<span class="gmail-Apple-converted-space"> </span>ssh<span class="gmail-Apple-converted-space"> </span><em>with</em><span class="gmail-Apple-converted-space"> </span>X11 forwarding enabled I get the following EGL error when I call<span class="gmail-Apple-converted-space"> </span>eglInitialize(…): 12290 (I<span class="gmail-Apple-converted-space"> </span><em>think</em><span class="gmail-Apple-converted-space"> </span>is<span class="gmail-Apple-converted-space"> </span>EGL_BAD_ACCESS).</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008000373840332px">This seems really weird and I hope it is something simple that I am just not currently seeing.</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008000373840332px">I really like using OpenGL with EGL but need a way to remedy this situation if possible. Is there a way for EGL to determine if X11 forwarding is being employed and to ignore it or some other solution?</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008000373840332px">The snippet of relevant C++ code follows, with area where error occurs marked:</p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008000373840332px"><span class="gmail-hljs-meta" style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">#<span class="gmail-hljs-meta-keyword">include</span> <span class="gmail-hljs-meta-string"><iostream></span></span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">
</span><span class="gmail-hljs-meta" style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">#<span class="gmail-hljs-meta-keyword">include</span> <span class="gmail-hljs-meta-string"><cstdlib></span></span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">
</span><span class="gmail-hljs-meta" style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">#<span class="gmail-hljs-meta-keyword">include</span> <span class="gmail-hljs-meta-string"><EGL/egl.h></span></span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">
</span><span class="gmail-hljs-meta" style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">#<span class="gmail-hljs-meta-keyword">define</span> EGL_EGLEXT_PROTOTYPES</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">
</span><span class="gmail-hljs-meta" style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">#<span class="gmail-hljs-meta-keyword">define</span> GL_GLEXT_PROTOTYPES</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">
</span><span class="gmail-hljs-meta" style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">#<span class="gmail-hljs-meta-keyword">include</span> <span class="gmail-hljs-meta-string"><EGL/eglext.h></span></span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">
</span><span class="gmail-hljs-meta" style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">#<span class="gmail-hljs-meta-keyword">include</span> <span class="gmail-hljs-meta-string"><GL/gl.h></span></span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">
...
EGLDisplay display = </span><span class="gmail-hljs-built_in" style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">eglGetDisplay</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">(EGL_DEFAULT_DISPLAY);
</span><span class="gmail-hljs-keyword" style="color:rgb(38,38,38);font-weight:bold;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">if</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">(display == EGL_NO_DISPLAY) {
std::cerr << </span><span class="gmail-hljs-string" style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">"Failed to get EGL display: "</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)"> << </span><span class="gmail-hljs-built_in" style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">eglGetError</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">() << std::endl;
</span><span class="gmail-hljs-built_in" style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">exit</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">(EXIT_FAILURE);
}
EGLint major;
EGLint minor;
</span><span class="gmail-hljs-keyword" style="color:rgb(38,38,38);font-weight:bold;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">if</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">(</span><span class="gmail-hljs-built_in" style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">eglInitialize</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">(display, &major, &minor) == EGL_FALSE) {
</span><span class="gmail-hljs-comment" style="font-style:italic;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">// ERROR 12290 is generated here</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">
std::cerr << </span><span class="gmail-hljs-string" style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">"Failed to initialize EGL: "</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)"> << </span><span class="gmail-hljs-built_in" style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">eglGetError</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">() << std::endl;
</span><span class="gmail-hljs-built_in" style="font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">exit</span><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)">(EXIT_FAILURE);
}
...</span><br></p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008000373840332px"><span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)"><br></span></p><p style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:15.008000373840332px">Any help would be greatly appreciated.<span style="color:rgb(38,38,38);font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace;white-space:pre;background-color:rgb(249,249,249)"><br></span></p></div></div>