Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. Software Development
  3. VOXL SDK
  4. EGL example for voxl2

EGL example for voxl2

Scheduled Pinned Locked Moved VOXL SDK
3 Posts 3 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • John KellerJ Offline
    John KellerJ Offline
    John Keller
    wrote on last edited by
    #1

    I saw that the voxl2 supports OpenGLES 3.1 and I would like to port over some of our OpenGL code to run on the voxl2. I am starting off by trying to get EGL to initialize with the following program but it is failing on the call to eglInitialize with error 0x3001 which is EGL_NOT_INITIALIZED. I am building with gcc egl-query.c -o egl-query -lEGL.

    Is there any examples of using EGL/OpenGL or does anyone know how to get this working?

    Thank you

    #include <EGL/egl.h>
    #include <EGL/eglext.h>
    #include <stdio.h>
    
    int main(void)
    {
        EGLDisplay display;
        EGLint major, minor;
    
        display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
        if (display == EGL_NO_DISPLAY) {
            printf("eglGetDisplay failed\n");
            return 1;
        }
    
        if (!eglInitialize(display, &major, &minor)) {
            EGLint err = eglGetError();
            printf("eglInitialize failed (0x%x)\n", err);
            return 1;
        }
    
        printf("EGL initialized successfully\n");
        printf("EGL version: %d.%d\n", major, minor);
    
        const char* vendor     = eglQueryString(display, EGL_VENDOR);
        const char* version    = eglQueryString(display, EGL_VERSION);
        const char* extensions = eglQueryString(display, EGL_EXTENSIONS);
        const char* clientapis = eglQueryString(display, EGL_CLIENT_APIS);
    
        printf("EGL_VENDOR:      %s\n", vendor ? vendor : "(null)");
        printf("EGL_VERSION:     %s\n", version ? version : "(null)");
        printf("EGL_CLIENT_APIS: %s\n", clientapis ? clientapis : "(null)");
        printf("EGL_EXTENSIONS:\n%s\n", extensions ? extensions : "(null)");
    
        eglTerminate(display);
        return 0;
    }
    
    
    Andrew JongA 1 Reply Last reply
    0
    • John KellerJ John Keller

      I saw that the voxl2 supports OpenGLES 3.1 and I would like to port over some of our OpenGL code to run on the voxl2. I am starting off by trying to get EGL to initialize with the following program but it is failing on the call to eglInitialize with error 0x3001 which is EGL_NOT_INITIALIZED. I am building with gcc egl-query.c -o egl-query -lEGL.

      Is there any examples of using EGL/OpenGL or does anyone know how to get this working?

      Thank you

      #include <EGL/egl.h>
      #include <EGL/eglext.h>
      #include <stdio.h>
      
      int main(void)
      {
          EGLDisplay display;
          EGLint major, minor;
      
          display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
          if (display == EGL_NO_DISPLAY) {
              printf("eglGetDisplay failed\n");
              return 1;
          }
      
          if (!eglInitialize(display, &major, &minor)) {
              EGLint err = eglGetError();
              printf("eglInitialize failed (0x%x)\n", err);
              return 1;
          }
      
          printf("EGL initialized successfully\n");
          printf("EGL version: %d.%d\n", major, minor);
      
          const char* vendor     = eglQueryString(display, EGL_VENDOR);
          const char* version    = eglQueryString(display, EGL_VERSION);
          const char* extensions = eglQueryString(display, EGL_EXTENSIONS);
          const char* clientapis = eglQueryString(display, EGL_CLIENT_APIS);
      
          printf("EGL_VENDOR:      %s\n", vendor ? vendor : "(null)");
          printf("EGL_VERSION:     %s\n", version ? version : "(null)");
          printf("EGL_CLIENT_APIS: %s\n", clientapis ? clientapis : "(null)");
          printf("EGL_EXTENSIONS:\n%s\n", extensions ? extensions : "(null)");
      
          eglTerminate(display);
          return 0;
      }
      
      
      Andrew JongA Offline
      Andrew JongA Offline
      Andrew Jong
      wrote on last edited by
      #2

      Bump on this, if anyone might know how we can use OpenGL. Thanks!

      Alex KushleyevA 1 Reply Last reply
      0
      • Andrew JongA Andrew Jong

        Bump on this, if anyone might know how we can use OpenGL. Thanks!

        Alex KushleyevA Offline
        Alex KushleyevA Offline
        Alex Kushleyev
        ModalAI Team
        wrote on last edited by
        #3

        @Andrew-Jong , we are able to reproduce the error that you are seeing. I believe that you may need to set up a virtual display in order to get this to work. You could try doing so using Weston compositor, which would normally run if the display was available. Please try it and let us know if you are able to get it to work (or not).

        You would need to create a config file /etc/xdg/weston/weston.ini

        and try running it manually like this :

        weston --idle-time=0 --config=/etc/xdg/weston/weston.ini
        

        a sample config file might look something like this:

        # configuration file for Weston
        [core]
        idle-time=0
        repaint-window=15
        
        [output]
        name=virtual-1
        mode=on
        

        We have not tested this yet, but hopefully it's a good start.

        Alex

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        ModalAI
        Categories Recent Tags ModalAI.com Docs
        © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups