gl4es icon indicating copy to clipboard operation
gl4es copied to clipboard

Is it possible to build build SDL2 with desktop-GL support using GL4ES?

Open vanfanel opened this issue 6 years ago • 1 comments

Hi there,

I have this question. Is it possible to build current stable SDL2 with native GLES and GLES2 support and "faked" disktop-GL support using GL4ES, on a platform without Xorg server running? I know it's possible to build programs directly using desktop-GL so they use GL4ES instead (that's what GL4ES does), but what about the programs that use desktop-GL though SDL2 initialization routines? Are they supposed to work?

There's a mention to SDL2 on the main README of GL4ES, but it's not specific.

The idea would be: -Build and install GL4ES -Build SDL2 with native GLES and GLES2 support, making it belive we DO have desktop-GL support as it will find GL4ES "fake" disktop-GL libs and includes -Build SDL2 programs that use desktop-GL by the means of SDL2 (Like Edku32 or GZDoom)

vanfanel avatar Jan 16 '19 10:01 vanfanel

You can build SDL with GL support and let it use GL4ES (that will work automatically in fact). The issue, if you don't use X11, is how you create a GL context. Without X11, GL4ES cannot use EGL function to create an EGL context. Without X11, SDL2 cannot use glX functions to create the GL context (that GL4ES can emulate, but using EGL functions). So, basically, you can use SDL2+GL4ES without X11, but you need to create the GLES(2) context yourself. On Android, it's easy because the GLES context is already created. On other platform, you need some specific SDL2 source to create the context. That source may already exist, but probably only for GLES, so extending this to DesktopGL is also probably needed.

I hope that explains things a bit better?

ptitSeb avatar Jan 16 '19 10:01 ptitSeb