public ParticleManager(ShaderManager shaderManager) { this.shaderManager = shaderManager; shader = new ParticleShader(); shaderManager.Add(shader); // Add shader to the manager so it updates the projectionMatrix & viewMatrix + clean-up. particleRenderer = new ParticleRenderer(shader); }
public Game() { state = new BootState(this); window = new GameWindow(960, 540); window.Load += Window_Load; window.RenderFrame += Window_RenderFrame; window.UpdateFrame += Window_UpdateFrame; window.Closing += Window_Closing; window.Closed += Window_Closed; window.Resize += Window_Resize; window.FocusedChanged += Window_FocusedChanged; Console.WriteLine("OpenGL: {0}", GL.GetString(StringName.Version)); keyHandler = new KeyHandler(window); Canvas = new SceneCanvas(keyHandler); shaderManager = new ShaderManager(); shader = new StaticShader(); shaderManager.Add(shader); fontShader = new FontShader(); fontManager = new FontManager(fontShader); fontShader.Compile(); font = FontParser.ParseFNT(@"Fonts/Verdana.fnt"); fontManager.Add(font); lastMousePosition = new Vector2(Mouse.GetState().X, Mouse.GetState().Y); }