@Raziel
Will check, but that for later.
@Capehill
Ok, done ! Tested and on cross-compiler and on native builds, so it all should work as it.
Firstly download that archive:
http://kas1e.mikendezign.com/aos4/gl4es/gl4es.zipThen:
a). in SDK rename GL directory to GL_minigl_save and made a GL be with gl4es includes from archive
b). put in SDK/local/newlib/lib/ those 3 libs from archive: libSDL_gl4es.a , libSDL2_gl4es.a and libgl4es.a
c). in SDK/local/newlib/include/SDL/SDL_opengl.h comment out include of <mgl/gl.h> (so to avoid name conflicts and co)
Now download irrlicht from my repo:
https://github.com/kas1e/IrrlichtThen, go to source/Irrlicht , and type "make -f Makefile.amigaos4 NDEBUG=1". After about 15-20 minutes (on x5k, instead of 1 minute on my x86 cross-compiler) you will have in lib/AmigaOS4/ , libirrlicht.a.
Then go to any example in example directory and type "make -f Makefile.amigaos4". It will build example and put binary to bin/AmigaOS4/ directory, from which you will need to run them
(as they will take "media" directory which is placed in root).
So after you experiment with it and see how it all works (working renderer are OpenGL, Software Renderer and Burning Video (software one too, just more accurate)), you then can enable SDL2 instead of SDL1.
But its only for software mode currently, to make it short, before we can find why it didn't works on aos4 , but works on win32.
So to enable SDL2 mode, you just go to include/IrrCompileConfig.h, and there in amigaos4 ifdefs (almost at end of file) add that:
//#define _IRR_COMPILE_WITH_SDL_DEVICE_
#undef _IRR_COMPILE_WITH_SDL_DEVICE_
#define _IRR_COMPILE_WITH_SDL2_DEVICE_
Then rebuild by going to source/Irrlicht and running "make -f makefile.amigaos4 NDEBUG=1", and you will be able to build examples with SDL2, just now when you build example you compile it like "make -f Makefile.amigaos4 SDL2=1".
But good news now, that you can change SDL2_gl4es.a in example's makefiles on your pure SDL2 , just didn't try to run opengl mode after, as it will crashes of course. But you can check software mode ones.
I.e. you will be able yourself to build your own SDL2 as you do usually, and use it for normal tests (just remember to only choice "software renderer" when will run examples).
As testcase we can take 02.Quake3Map example. You can firstly compare how it works with SDL1 in software mode (yeah, not accurate, and not as it works over opengl, but that expected how it renders in software renderer. I.e. its ok as it, and in SDL1 version you can move camera, etc). And then, with SDL2 you can see how it didn't works in software mode: everything stops, give 1-2 fps, etc.
But to note: on win32 exactly the same code works as expected, same speed as with SDL1. I.e. i just download that branch from my repo with latest commits, and just build it for win32 with SDL2 instead of amigaos4, and there everything works in software mode with 1:1 same CirrDeviceSDL2.cpp/.h
ps. Oh, and i use everywhere gcc 8.3.0 and on cross compiler, and native on x5k. Hope you too :)
ps2. And the only difference i see between aos4 and win32, that on aos4 we use 2.0.8 sdl2, and on win32 i have 2.0.9. But not sure that that can cause such an effect