Hi to give some news.
Just to give some update about my progress. I've made
a patch against rev4126 (on windows "svn diff > mypatch" ) to show it's not all talk. Nevertheless I wouldn't recommand to apply it since it's WIP:
-it will break software driver on linux. ogl and burning's ok
-breaks d3d8 on windows (started modifications on those 2 drivers without finishing). d3d9,ogl, burning and software ok
-not thoroughly tested (only with example 1)
-currently breaks the use of SExposedVideoData in beginScene. Could be fixed.
I just wanted to explain a bit how this first version -
which does not change the external API- differs from current irrlicht:
-Creation of a class IRenderWindow with specializations ( CRenderWindowLinux & CRenderWindowWin32) to which I've moved all window-specific functions such as
minimizeWindow(),maximizeWindow() etc... To keep the API intact, IrrlichtDevice keeps those functions but redirects the call towards the current IRenderWindow, for example.
void IrrlichtDevie::maximizeWindow() { getActiveWindow()->maximizeWindow() }
-the aim is to dissociate window creation from IrrlichtDevice initialization so that one can create a device, asks the device for available video modes and then create a window. For that purpose I've added a function: IRenderWindow* IrrlichtDevice::createWindow(SRenderWindowConfig& config). Still with that idea of not breaking the API in mind, SRenderWindowConfig is generated from SIrrlichtCreationParameters.
-removed all driver-related code from different devices (CirrDeviceStub/CIrrDeviceWin32/CIrrDeviceLinux). The idea behind that is that you shouldn't modify a device to add a custom driver. As we have dissociated window creation from device creation, we could possibly have one device handle several windows (not implemented yet since it would require API changes). But with this idea in mind, I thought we could have a driver creating several contexts. That's why I've added a function IVideoContext* IVideoDriver::createContext(SVideoContextConfig& config, IRenderWindow*).
SVideoContextConfig is generated from SIrrlichtCreationParameters. Basically this new class "IVideoContext" is the equivalent of SExposedVideoData. There are specializations like COpenGLContextWin32,COpenGLContextLinux,CD3D8Context etc... which are meant to replace SExposedVideoData in beginScene (well it depends on the API you want to draw to multiple windows, is the window responsible for its own drawing calls or not etc...).
I happen to have a lot of free time right now and it's likely to last for a few months. Before further commiting myself into this, I wanted to know if there was interest (for irr 1.9 or 2.0 for example) and if that's the case, if a mac developer would be interested to join me to have a more comprehensive patch. To sum up, my current modifications aim at separating window creation from device creation and/or from driver/videocontext creation. Without any external API changes, these modifications *just* makes creation of drivers easier.
But once those modifications are done, it's very little work to add new features:
-handling of several windows (wich might use different drivers)
-I've never tried but I read one could use several contexts, display one while the other loads meshes and than contexts could share these meshes.
-could add a function IrrlichtDevice::addAvailableDriver( driverId, (IVideoDriver* (*)(IrrlichtDevice*) driverCreationFunc) which would add to a core::map<> a pointer to a function that , if called, would initialize a video driver.