very early prototype of a spaceshooter in SFML
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

background.hpp 710B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <SFML/Graphics.hpp>
  3. #include <SFML/System.hpp>
  4. #include <SFML/Window.hpp>
  5. #include "main.hpp"
  6. namespace Proto4 {
  7. class Background : public sf::Drawable {
  8. public:
  9. void init(sf::Texture bg0, sf::Texture bg1, sf::View &gameView);
  10. void update(sf::View &gameView, sf::RenderTarget &window);
  11. void resize(sf::Event& resizeEvent);
  12. private:
  13. sf::Sprite bg0Sprite;
  14. sf::Sprite bg1Sprite;
  15. sf::Texture bg0Tex;
  16. sf::Texture bg1Tex;
  17. uint8_t bg0Size;
  18. uint8_t bg1Size;
  19. sf::View bg0View;
  20. sf::View bg1View;
  21. virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
  22. };
  23. }