@CapehillBtw, for dbl-buffering, i see that minigl in os4sdl is playing dirty games with surfaces and dbl-buffering. At least i only checked on word "OPENGL" in video/amigaos4 directory and there few places which looks strange (with strange comments about using surfaces and dbl-buffering).

@CapehillBtw, did you know for what that video/SDL_glfuncs.h is need it at all ? I mean, didn't we use those gl fucntions we need , just taken includes and whatever from opengl itself, and use them in any SDL app ?

I didn't check all sources but they seem to be used for OpenGL-blitting. Something we can ignore. At least I don't have interest to study the topic in SDL1. Easier to use graphics.library for 2D and OpenGL for 3D.

Spent quite much time to debug Beret issue. After all, the issue was that SDL creates a "shadow surface" (SW) under certain conditions and accelerated blits are canceled. In practise it could happen when asked for SDL_HWSURFACE|SDL_DOUBLEBUF but without SDL_FULLSCREEN.

Whole surface creation is so complicated business due to all combinations. Now, if the backend would use the same flipping code for both window and fullscreen, this problem might be solved but at the moment my advice is to pass SDL_DOUBLEBUF only with FULLSCREEN|HWSURFACE combo.

So, for accelerated blitting, either use:

SDL_FULLSCREEN|SDL_HWSURFACE|SDL_DOUBLEBUF orSDL_HWSURFACE (window).

Or if your application needs to poke surfaces like many emulators do, maybe use just SWSURFACEs.

Found today some other issue (which can be again issues with game's code, but maybe not): i build some game via SDL1 / MiniGL which, when switch to/from fullscreen, or resize the gl window when in window mode, give a black window. Game logic works, but just black window.

If i start originally game in lets say fullscreen mode : it works. If i start originalluy game in window mode: it works.

But once i trying to swith to/from window/fullscreen, then black window. Same for resizing when in window mode.

/*
* Now, we want to setup our requested
* window attributes for our OpenGL window.
* We want *at least* 5 bits of red, green
* and blue. We also want at least a 16-bit
* depth buffer.
*
* The last thing we do is request a VMfloat
* buffered window. '1' turns on VMfloat
* buffering, '0' turns it off.
*
* Note that we do not use SDL_DOUBLEBUF in
* the flags to SDL_SetVideoMode. That does
* not affect the GL attribute state, only
* the standard 2D blitting setup.
*/

}
// Check new settings for better output the next line is a must for multisample
if(!samplingerror && options_fsaa_value){
glEnable(GL_MULTISAMPLE);
//glHint(GL_MULTISAMPLE_FILTER_HINT_NV,GL_NICEST); //be careful (Nvidia-specific), set over an option ?
}

SDL_WM_SetCaption("game","game");

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);
}

/**************************************************************************
* Set a fullscreen(1) or window(0) window *
* SDL_WM_ToggleFullScreen(screen) works only on X11 and there not stable *
**************************************************************************/

Everything start works as expected. I.e. just change screen->flags on SDL_OPENGL | SDL_RESIZABLE.

What is more interesting, that in the debug output, flags in both cases are same OPENGL RESIZABLE. But in first case , when screen->flags is used, i have that kind of output when trying to resize window: