options->get('bloom', false); } public function available(Engine $engine): bool { return $engine->gl()->isAvailable(); } /** Puts the shader on or off as the option says (call from enter()). */ public function apply(Engine $engine): void { $want = $this->isOn($engine) && $this->available($engine); if ($this->on === $want) { return; } $this->on = $want; $engine->gl()->setPostShader($want ? self::BLOOM : null); } public function toggle(Engine $engine): void { $engine->options->set('bloom', !$this->isOn($engine)); $this->apply($engine); } }