IngameState.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * Triangles
  3. * Copyright (C) 2016 POSITIVE MENTAL ATTITUDE
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, version 3 of the License.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #pragma once
  18. #include "State.hpp"
  19. #include "Player.hpp"
  20. #include "Foreground.hpp"
  21. #include "Camera.hpp"
  22. #include "ltbl/lighting/LightSystem.h"
  23. class IngameState: public State
  24. {
  25. public:
  26. IngameState();
  27. void init() final;
  28. /**
  29. * @brief Method casted whenever the game's resolution changes.
  30. */
  31. void refresh() final;
  32. void coreThink(const sf::Event& event) final;
  33. void coreInput() final;
  34. void coreUpdate(sf::Time delta) final;
  35. void coreRender(const bool shaders) final;
  36. private:
  37. Player _player;
  38. Foreground _foreground;
  39. Camera _camera;
  40. sf::Sprite _background;
  41. sf::Shader _unshadowShader;
  42. sf::Shader _lightOverShapeShader;
  43. sf::Shader _normalsShader;
  44. sf::Texture _penumbraTexture;
  45. ltbl::LightSystem _lightSystem;
  46. std::shared_ptr<ltbl::LightPointEmission> _light;
  47. bool _cameraMode;
  48. bool _paused;
  49. sf::RectangleShape _pauseFrame;
  50. sf::Sprite _wasted;
  51. sf::Shader _blurV;
  52. sf::Shader _blurH;
  53. float _blurSize;
  54. float _frameAlpha;
  55. sf::Sound _marioSound;
  56. sf::RenderTexture _backgroundH;
  57. sf::RenderTexture _backgroundV;
  58. };