Page 1 of 1

How to make OGL-ES branch for SDL be only SDL and not EGL ?

Posted: Thu Feb 08, 2018 8:10 pm
by kas1e
@All (and probably CuteAlien as one of active devs :) )

Fidding around with OGLES branch , found that i can't build OGLES2/SDL without EGL being involved. I.e. in the CirrDeviceSDL.cpp we have:

Code: Select all

 
    case video::EDT_OGLES2:
#if defined(_IRR_COMPILE_WITH_OGLES2_) && defined(_IRR_EMSCRIPTEN_PLATFORM_)
        {
            video::SExposedVideoData data;
 
            ContextManager = new video::CEGLManager();
            ContextManager->initialize(CreationParams, data);
 
            VideoDriver = video::createOGLES2Driver(CreationParams, FileSystem, ContextManager);
        }
#else
        os::Printer::log("No OpenGL-ES2 support compiled in.", ELL_ERROR);
#endif
        break;
 
None of the other switches, like OpenGL, or BurningVideo, or Software, or DirectX, do have that "EGL" related strings, so it used pure SDL for.

Qestion is: what reassons to add to pure SDL managment also EGL parts for GLES2 , and how to get rid of them so to be able to use SDL only, without EGL ?

I see that ogles2 code was added for EMSCRIPTEN , but it will also work for other platforms as well , if only remove from CirrDeviceSDL.cpp that code about ContextnManager as EGLManager. In the CirrDeviceLinux, it also used with EGL, but that ok, as it non SDL, but for "pure" OGLES2-SDL compile , EGL should't be used, imho.

I also see that for OpenGL, BurningsVideo, Software and DirectX, just pure "VideoDriver = video::createOpenGLDriver(CreationParams, FileSystem, this);" is used. Why not use that "this" thing for OGLES2 as well without needs for EGL manager ?

All in all, maybe can anyone explain logic of it, so it can be somehow removed and replaced on SDL only ?

Thanks a bunch for answers !

Re: How to make OGL-ES branch for SDL be only SDL and not EG

Posted: Fri Feb 09, 2018 12:55 pm
by CuteAlien
Basically - I got the patch like that and it worked (aka I got Irrlicht in the browser). There's not much reason beyond that. I wondered as well if EGL is really needed in this case or if I can get the context from SDL directly, but never found the time to experiment with that.