I'm not sure why it was added but it rather makes things harder than helps. When creating CEGUI you must already know its properties, and you have to create this context when CEGUI is initialized, not when you need it. For the hypothetical case of using CEGUI for multiple windows (no doubt a pretty rare case but a revealing one) the logic will be like this:
- Init render system
Create swap chain (viewport)
Create CEGUI with default context sized as your viewport
Use this context for your first window
For each subsequent window create a new target and context
The worst thing here is that this code requires different handling for the first and subsequent windows. Also it requires to initialize CEGUI after the rendering system, but it is usually the case anyway.
I would propose to remove the entire concept of "default context" and create one when you need it. So the logic becomes:
- Init render system, create CEGUI system (in any order)
Load whatever resources and configs you want
Then for every window:
- Create viewport target (which just means an externally set render target) or a CEGUI-created texture target
- Create context from this target, setup defaults from config inside CEGUI or leave it to the application
So the system becomes more clean, more flexible and more well-designed for multi-context usage at once. I think this is The way to go but I don't want to make any major local changes which will not be the part of main CEGUI.