Page 1 of 1
Changing from windowed to full-screen
Posted: Sun Mar 26, 2006 2:53 pm
by aegidian
Because the OpenGL contexts on the Mac can do something clever called context-sharing the Mac version can switch from Windowed mode to full-screen without a hitch.
Attempting the same thing without a shared context (on the PC) leads to blocky graphics where the texture references no longer work correctly.
Could we change the way windowed/full-screen selection works on the PC(/Linux) so that the change applies the next time Oolite is run rather than immediately. This would get around the problem without too much work trying to research how to share OpenGL contexts on the non-Mac platforms.
Posted: Sun Mar 26, 2006 3:34 pm
by winston
It only has to be changed on the Windows version - it works perfectly on Linux (so please #ifdef WIN32 the change).
Posted: Sun Mar 26, 2006 8:08 pm
by JensAyton
When my new texture code works, some time in the 22nd century, and the model code is updated to use it effectively, around 2257, it should be possible to fix this by invalidating all textures. For now, the ol’ “This change will take effect when you restart Oolite” seems a moderately sensible solution.
Posted: Sat Apr 08, 2006 3:31 pm
by JensAyton
Mesh code change wasn’t necessary; in the new-texture-model branch, it is now possible to invalidate and reload all textures… although I still haven’t adapted SDL texture loading.
The invalidation effectively requires all textures that have ever been used to be reloaded immediately. This is a limitation of how Oolite uses textures; with the new mesh code, greater efficiency will be possible. On Macs with the GL_UNPACK_CLIENT_STORAGE_APPLE extension, the invalidation is effectively instantaneous as the object retains ownership of the pixel data used by OpenGL. The code is set up so that adding support for equivalent extensions is trivial.
The textures are invalidated by calling [OOTexture invalidateAllTextureBindings]. This must be done when the new GL context is active (again, due to backwards-compatibility with the way Oolite does stuff).
For testing purposes, in the new-texture-model branch textures can be reloaded with a context switch by pressing @. (specifically, any shift-key combination producing @; other combinations don’t work. Us second-class citizens with non-British keyboard layouts made to suffer again. ;-) )
I’ll take a poke at SDL texture loading now.