private void Initialize() { //var backgroundColorStandard = new Color4(0.7f, 0.7f, 0.7f, 1.0f); var backgroundColorStandard = new Color4(0.157f, 0.157f, 0.157f, 1.0f); _backgroundManager = new BackgroundManager(backgroundColorStandard); _screenBufferManager = new ScreenBufferManager(_backgroundManager); _viewportManager = new ViewportManager(_control); _textureProvider = new TextureProvider(); _shaderProvider = new ShaderProvider(); _sceneManager = new SceneManager(new Scene("Main")); WorldAxes.AddAxesToNode(_shaderProvider, _sceneManager.CurrentScene); _camera = new Camera(_viewportManager); _camMovement = new CameraMovement(_camera, _control); _renderLoop = new RenderLoop(_control, _screenBufferManager, _sceneManager, _camera, _shaderProvider); _grid = new Grid(_camera, _renderLoop, new LineRenderer(_shaderProvider.DefaultShader)); _simulation = new JellySimulation(_sceneManager, _shaderProvider); _jellyInput = new JellyInput(_simulation.Jelly, _simulation.ControlFrame, _control, _camera); _window.tessellationParametersView.DataContext = Registry.TessellationLevels; _window.meshSelector.Initialize(_simulation); _window.polygonFillView.Initialize(); }
public ScreenBufferManager(BackgroundManager backgroundManager) { _backgroundManager = backgroundManager; GL.Enable(EnableCap.Blend); GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line); GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha); GL.Enable(EnableCap.DepthTest); }