While debugging a problem with my code I realized that the whole engine state is not shared across contexts: In the primary window backface culling is active, in the secondary it's disabled.
Quote:
Every window in pyglet has its own OpenGL context. Each context has its own OpenGL state, including the matrix stacks and current flags. However, contexts can optionally share their objects with one or more other contexts. Shareable objects include:
Textures
Display lists
Shader programs
Vertex and pixel buffer objects
Framebuffer objects
(this is not pyglet specific)
More infosThis means that a part of the initialization of the renderer has to be done per Context instead of once per application to get the state right. I'd suggest adding a function "Horde3D::initContext" which initializes the current context and is called automatically by "Horde3D::init" to initialize the initial context.
Affected code:
egRenderer.cpp, init: only "Init Opengl states"
egRendererBase.cpp, init
more?
I'm not sure in which way the EngineOptions are affected by this bug.