Results 1 to 1 of 1

Thread: EGL contexts with SDL initialization

  1. #1
    Join Date
    May 2013

    EGL contexts with SDL initialization

    When I initialize an OpenGL context with SDL 1.2, GLX is able to retrieve it, but EGL can't.
    Code :
    gcc -o egl egl.c -lX11 -lEGL -lSDL -lGL
    Code :
    #include <EGL/egl.h>
    #include <GL/glx.h>
    #include <SDL/SDL.h>
    int main(){
      SDL_SetVideoMode(200, 200, 0, SDL_OPENGL);
      printf(eglGetCurrentContext() == EGL_NO_CONTEXT ? "EGL KO\n" : "EGL OK\n");
      printf(glXGetCurrentContext() == NULL           ? "GLX KO\n" : "GLX OK\n");
      return 0;
    This code displays "EGL KO" and "GLX OK"
    Is it the expected behavior ? If it is, how can I retrieve the OpenGL context ?
    Thanks for your help
    Last edited by azmeuk; 05-02-2013 at 06:33 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean