@Capehill
Sorry if it will be not related to SDL2, but at least i have an issue found when tried to check one of SDL2's examples.
The example I talked about is that one :
https://github.com/AmigaPorts/SDL-2.0/blob/main/test/testshader.cThat a test case that uses ARB shaders. I do not know if they work with MiniGL, but probably not?
So i tested with GL4ES, and find out the strange issue, which i remember to have in some other, bigger, SDL-related projects). And it wasn't with ARB exactly, it was something different.
Now problem is, if i compile that test case, it didn't work as it. Function "static SDL_bool InitShaders()" fails with saying "unable to compile shaders!" (while i tested those shaders, they of course compiles/executes fine by ogles2/warp3dnova). Error come exactly from the InitShaders() function, from that part:
/* Compile all the shaders */
for (i = 0; i < NUM_SHADERS; ++i) {
if (!CompileShaderProgram(&shaders[i])) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to compile shader!\n");
return SDL_FALSE;
}
}
Now, what is interesting, is that i enough to add printf("asdfasdf") or IDOS->Delay(1) to any place before that code block to make everything works as expected.
And I do not understand what it that. I tried to compile it without optimization at all as BSzili suggests: the same problem. All that i understand, for now, is that when we build with and without _any_ stub call, we have: 1) code block a bit differs by size in .text segment 2) we add some ms of "time wait" difference when with have/didn't have call to any function, and adding one, add some "delay", which by some reason help us.
ptitSeb suggests that maybe the way the function pointer is gathered is the issue?
Maybe it's something about SDL_GL_GetProcAddress() being not too fast / not checking something?