Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Create Window:</p> <pre><code>Window root; XSetWindowAttributes swa; XSetWindowAttributes xattr; Atom wm_state; XWMHints hints; XEvent xev; EGLConfig ecfg; EGLint num_config; Window win; /* * X11 native display initialization */ x_display = XOpenDisplay(NULL); if ( x_display == NULL ) { return EGL_FALSE; } root = DefaultRootWindow(x_display); swa.event_mask = ExposureMask | PointerMotionMask | KeyPressMask; win = XCreateWindow( x_display, root, 0, 0, esContext-&gt;width, esContext-&gt;height, 0, CopyFromParent, InputOutput, CopyFromParent, CWEventMask, &amp;swa ); xattr.override_redirect = FALSE; XChangeWindowAttributes ( x_display, win, CWOverrideRedirect, &amp;xattr ); hints.input = TRUE; hints.flags = InputHint; XSetWMHints(x_display, win, &amp;hints); // make the window visible on the screen XMapWindow (x_display, win); XStoreName (x_display, win, title); // get identifiers for the provided atom name strings wm_state = XInternAtom (x_display, "_NET_WM_STATE", FALSE); memset ( &amp;xev, 0, sizeof(xev) ); xev.type = ClientMessage; xev.xclient.window = win; xev.xclient.message_type = wm_state; xev.xclient.format = 32; xev.xclient.data.l[0] = 1; xev.xclient.data.l[1] = FALSE; XSendEvent ( x_display, DefaultRootWindow ( x_display ), FALSE, SubstructureNotifyMask, &amp;xev ); </code></pre> <p>Set color:</p> <pre><code> glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f ); // Set the viewport glViewport ( 0, 0, esContext-&gt;width, esContext-&gt;height ); // Clear the color buffer glClear ( GL_COLOR_BUFFER_BIT ); </code></pre> <p>Sources:</p> <ul> <li><a href="https://github.com/danginsburg/opengles-book-samples/blob/master/LinuxX11/Chapter_2/Hello_Triangle/Hello_Triangle.c" rel="nofollow noreferrer">https://github.com/danginsburg/opengles-book-samples/blob/master/LinuxX11/Chapter_2/Hello_Triangle/Hello_Triangle.c</a></li> <li><a href="https://github.com/danginsburg/opengles-book-samples/blob/master/LinuxX11/Common/esUtil.c" rel="nofollow noreferrer">https://github.com/danginsburg/opengles-book-samples/blob/master/LinuxX11/Common/esUtil.c</a></li> <li><a href="https://github.com/danginsburg/opengles-book-samples/blob/master/LinuxX11/Common/esUtil.h" rel="nofollow noreferrer">https://github.com/danginsburg/opengles-book-samples/blob/master/LinuxX11/Common/esUtil.h</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload