I do have OS which do not have EGL, but do have OGLES2 and SDL1/2 , so to use OGLES2 driver i had to remove EGL support and use SDL1 one instead.
So far, that what i do :
1). in the CirrDeviceSDL.cpp and in COGLES2Driver.cpp all parts with "IContextManager* contextManager" on just "CIrrDeviceSDL* device
So like:
So for COGLES2Driver.cpp:
Code: Select all
//COGLES2Driver::COGLES2Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager) :
COGLES2Driver::COGLES2Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, CIrrDeviceSDL* device) :
...
ColorFormat(ECF_R8G8B8), ContextManager(0) //ContextManager(contextManager)
Code: Select all
//IVideoDriver* createOGLES2Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager)
IVideoDriver* createOGLES2Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io,CIrrDeviceSDL* device)
and for CirrDeviceSDL.cpp:
Code: Select all
#if defined(_IRR_COMPILE_WITH_OGLES2_) //&& defined(_IRR_EMSCRIPTEN_PLATFORM_)
//IVideoDriver* createOGLES2Driver(const irr::SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager);
IVideoDriver* createOGLES2Driver(const irr::SIrrlichtCreationParameters& params, io::IFileSystem* io, CIrrDeviceSDL* device);
#endif
Code: Select all
case video::EDT_OGLES2:
#if defined(_IRR_COMPILE_WITH_OGLES2_) //&& defined(_IRR_EMSCRIPTEN_PLATFORM_)
{
#ifndef __amigaos4__
video::SExposedVideoData data;
ContextManager = new video::CEGLManager();
ContextManager->initialize(CreationParams, data);
#endif
//VideoDriver = video::createOGLES2Driver(CreationParams, FileSystem, ContextManager);
VideoDriver = video::createOGLES2Driver(CreationParams, FileSystem, this);
}
#else
2). In open window add creating of ogles2 context so it will works in SDL window:
Code: Select all
ULONG errCode = 0;
SDL_SysWMinfo wmi = { 0 };
SDL_GetWMInfo(&wmi);
struct TagItem contextparams[] =
{
{OGLES2_CCT_WINDOW,(ULONG)wmi.window},
{OGLES2_CCT_DEPTH,16},
{OGLES2_CCT_STENCIL,8},
{OGLES2_CCT_VSYNC,0},
{OGLES2_CCT_SINGLE_GET_ERROR_MODE,1},
{OGLES2_CCT_RESIZE_VIEWPORT, TRUE},
{TAG_DONE,0}
};
void *ogles_context = IOGLES2->aglCreateContext2(&errCode,contextparams);
if (ogles_context)
{
IOGLES2->aglMakeCurrent(ogles_context);
}
So, no questions : when i compile Helloword example to use OGLES2 driver, everything is black (while all working, etc) i just can't see anything rendered.
All i can see in the console output is few strings of this kind:
GLSL shader programm failed to link
GLSL shader programm failed to link
GLSL shader programm failed to link
GLSL shader programm failed to link
GLSL shader programm failed to link
GLSL shader programm failed to link
GL_INVALID_OPERATION: 176
Load mesh: ../../media/sydney.md2
Loaded texture: /Work/irrlicht-1.8.4/media/sydney.bmp
So cleary it tried to use ogles2 driver (as tried to load up shaders) , but something goes wrong.
Is there any way how i can check if driver works, in easy terms ? Like maybe, comment out everything inside of the "shaders" in the media ?
Ie just to see if Irrliht with ogles2 works for me, to draw something simple, which need no shaders , etc.
Any help/ideas very welcome , thanks !