I tried to compile SDL2 itself, never mind why. I got:
/ahihi/sdl2-amigaos4-master/src/video/amigaos4/SDL_os4video.c: In function 'OS4_FindApplicationName':
/ahihi/sdl2-amigaos4-master/src/video/amigaos4/SDL_os4video.c:146:21: error: 'MAX_DOS_PATH' undeclared (first use in this function); did you mean 'MAXFLOAT'?
char pathBuffer[MAX_DOS_PATH];
^~~~~~~~~~~~
MAXFLOAT
/ahihi/sdl2-amigaos4-master/src/video/amigaos4/SDL_os4video.c:146:21: note: each undeclared identifier is reported only once for each function it appears in
/ahihi/sdl2-amigaos4-master/src/video/amigaos4/SDL_os4video.c:147:21: error: 'MAX_DOS_FILENAME' undeclared (first use in this function); did you mean 'EAD_IS_FILE'?
char nameBuffer[MAX_DOS_FILENAME];
^~~~~~~~~~~~~~~~
EAD_IS_FILE
/ahihi/sdl2-amigaos4-master/src/video/amigaos4/SDL_os4video.c:149:15: error: 'struct DOSIFace' has no member named 'GetCliProgramName'; did you mean 'GetProgramName'?
if (IDOS->GetCliProgramName(pathBuffer, MAX_DOS_PATH - 1)) {
^~~~~~~~~~~~~~~~~
GetProgramName
/ahihi/sdl2-amigaos4-master/src/video/amigaos4/SDL_os4video.c:147:10: warning: unused variable 'nameBuffer' [-Wunused-variable]
char nameBuffer[MAX_DOS_FILENAME];
^~~~~~~~~~
/ahihi/sdl2-amigaos4-master/src/video/amigaos4/SDL_os4video.c:146:10: warning: unused variable 'pathBuffer' [-Wunused-variable]
char pathBuffer[MAX_DOS_PATH];
^~~~~~~~~~
gmake: *** [build/SDL_os4video.lo] Error 1
@Capehil Retested now all your latest commits : yeah, all works fine. Both iconification bugs gone, ogles2 are added as it was (but being reworked for more clean way), so all fine, thanks.
@Bszili Btw, i see you made a pull request with new makefile, and notice there that you have "CFLAGS = -Wall -fPIC -I./include -maltivec". So question is: is it ok to have -fPIC also for static builds, and, if it ok to have -maltivec for both builds for those platforms which didn't have altivec ? Also config file have "#define SDL_ALTIVEC_BLITTERS 1" too , is it ok to have it enabled for non-altivec cpus ?
I already took out the AltiVec, it was an oversight from copying things over from the libtools generated Makefile / config header. PIC is harmless for static libraries, and this way same object files can be linked into a shared object without recompiling the whole thing.
This is just like television, only you can see much further.
@Capehill Noticed another issue , this time with SDL_SetWindowFullScreen().
Issue is: we have let's say workbench in 1920x1080. Now we run programm, which runs in fullscreen, in that 1920x1080. Then we press alt+enter to switch to the window mode , which will be those 1920x1080, and it is, but without calculating of window's borders size , and because of that, at the bottom and at the right, we have some mess until we not resize the window to fits into the screen together with borders.
But all refreshes fine only when i resize window a bit.
Probabaly solution are to check inside of SDL__SetWindowFullScreen() (or so), if we switch to window mode, and if yes, then check if the window equal or more than current workbench resolution, and if so, then create a window of full-screen size minus size of the bottom and rigth borders of created window (and so actuall app data will blits to normal window which fits into workench size fine).
PS. Seems that bug happens also when just switch between different window modes too. For example when i swtitch between 1280x720 and 1024x768
Issue with fs/window toggling sounds a little bit strange because window mode uses WA_InnerWidth and WA_InnerHeight so it should match, right? Well, have to investigate some day.
I seem to remember there used to be some issues with window resize where the final window size (on LMB release) wasn't taken into use but I haven't checked this recently. Intuition programming is so fun...ky.
Because WA_AutoAdjust is TRUE by default, window is forced inside the WB boundaries. By adding "WA_AutoAdjust, FALSE" in window creation routine, window can keep its original inner dimensions (but it goes partially outside, of course).
But, using a simple test case I couldn't reproduce window corruption issue. When OpenGL buffer is blitted onto window, window inner dimensions are queried.
Another thing: if you have started the program in fullscreen mode, how come window has the resize gadget on the bottom right corner? How exactly the window was created?
@Capehill Tested your gles2-window branch, and sadly to say it didn't work. I.e. when i run testcase (testgles2) in window mode (as default) then i can easyly switch via alt+enter many times. But if i just run it as "testgles2 --fullscreen", then it now immediately crashes inside of OS4_GLES_UpdateWindowPointer().
Rechecked few times to be sure
The last thing i see on serial before crash happens are "Updating GLES2 window pointer 0x666132a8"
But as i say when i run it in window mode by default , all works fine, i can do alt+enter for swith to/from window/fullscreen many times, and that "updting gles2 window pointer" works for sure, just when i run it by default in fullscreen mode it crashes.
@Capehill Strange, as we have in updatewindowpointer() that:
if (IOGLES2) {...}
so it should't be there if no IOGLES2 ?
edit: we probabaly can extend "if (window->flags & SDL_WINDOW_OPENGL)" , to something like "if (IOGLES2 !=NULL & window->flags & SDL_WINDOW_OPENGL)" so aglSetParam will only calls when IOGLES2 is initialized, etc ?
@Capehill Yeah, checked latest commit, all works now, thanks :) At least i tested for about 5 minutes that testgles2 running it in all conditions and switching it like a madman all the time to/from window/fullscreen : all works now.
As for issue of overbound windowses, will check now as well
Lib and interface was OK based on the logs but I missed the context pointer check. SDL_GL_CreateContext requires a window parameter: window must be created first, then context.
Now our code tried to do modify non-existing context with SetParam.
I don't know whether there should be a sanity check inside OGLES2 but this was "an invalid user" type error more likely.
Another thing: if you have started the program in fullscreen mode, how come window has the resize gadget on the bottom right corner? How exactly the window was created?
You mean that middle gadget ? Dunno why it there. It just when i run in fullscreen and alt+enter, its already here. Or , if i run in window mode it also already there. And yeah, resizing of window, and then pressing on that gadget also produce overflow of borders.
glPolygonMode(GL_FRONT,GL_FILL); // fill the front of the polygons
glPolygonMode(GL_BACK,GL_LINE); // only lines for back (better seeing on zooming)
glCullFace(GL_BACK); // Standards for rendering only front of textures
glEnable(GL_CULL_FACE);
Or you mean that resize gadget at bottom ? That it just not fullscreen, its i switch to window (which is size of my workbnehc screen), and then just tick via mouse on the place where resize gadget should be, and it just draws once i tick it.