ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    EGL example for voxl2

    VOXL SDK
    1
    1
    18
    Loading More Posts
    • 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
      John Keller
      last edited by

      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;
      }
      
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Powered by NodeBB | Contributors