Results 1 to 1 of 1

Thread: EGL contexts with SDL initialization

  1. #1
    Newbie
    Join Date
    May 2013
    Posts
    1

    EGL contexts with SDL initialization

    Hi.
    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_InitSubSystem(SDL_INIT_VIDEO);
      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 05: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
  •