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

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
kas1e
Posts: 212
Joined: Sun Jan 21, 2018 8:39 am

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

Post 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 !
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

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

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply