public CRenderScene CreateRenderScene(IRenderSurface surface) { foreach (CRenderScene scene in m_renderScenes) { if (scene.SceneRenderer.Hwnd == surface.GetHWND()) { return(null); } } CRenderScene newScene = new CRenderScene(); newScene.InitScene(m_d3dRenderer.D3DDevice, m_d3dRenderer.D3DDeviceContext, surface); newScene.DebugRenderer.Init(m_d3dRenderer.D3DDevice, m_d3dRenderer.UIRenderer.FontProvider); newScene.SceneRenderer.UIContext = m_d3dRenderer.UIRenderer.CreateAdditionalContext(); m_renderScenes.Add(newScene); return(newScene); }