5

EGL looks like the worst documented Khronos project ever, I literally can't find nothing specific about this project but it looks promising and finally there is a standardized alternative to GLUT/FreeGlut.

My point is, suppose that I want an EGL context for my application in a Window on a linux-desktop or without a window (without decorations), as programmer whom am I supposed to refer to for getting that EGL context? For example if I use QT, is it QT that is supposed to implement EGL? Xorg? Myself?

didierc
  • 14,572
  • 3
  • 32
  • 52
user1797612
  • 812
  • 6
  • 22
  • 3
    Right now EGL is primarily used with OpenGL ES on mobile devices, ex. Android and iPhone. There are projects out there to use OpenGL ES on desktop systems, and I think even projects to use full OpenGL with EGL... You might find this question interesting reading: http://stackoverflow.com/q/7017239/27130 – Nathan Monteleone Jan 08 '13 at 17:18

1 Answers1

3

Mesa's EGL implementation seems to work.

I've used it with SDL 1.2 on X11 and Win32 (at least up to and including Mesa 10.4.7) to get OpenGL ES 1.1 and 2.0 contexts:

SDL_Surface* display = SDL_SetVideoMode( ..., SDL_SWSURFACE );

SDL_SysWMinfo sysInfo;
SDL_VERSION( &sysInfo.version );
SDL_GetWMInfo( &sysInfo );

// use natDisplay with eglGetDisplay();
// use natWindow with eglCreateWindowSurface();

// X11
sysInfo.info.x11.lock_func();
NativeDisplayType natDisplay = sysInfo.info.x11.display;
NativeWindowType natWindow = sysInfo.info.x11.window;
// do EGL context init here
sysInfo.info.x11.unlock_func();

// Win32
NativeDisplayType natDisplay = GetDC(sysInfo.window);
NativeWindowType natWindow = sysInfo.window;
// do EGL context init here
genpfault
  • 51,148
  • 11
  • 85
  • 139