scene.hpp 836 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // scene.hpp
  3. // engine
  4. //
  5. // Created by Sam Jaffe on 9/2/16.
  6. //
  7. #pragma once
  8. #include <memory>
  9. #include "engine_fwd.hpp"
  10. #include "math/math_fwd.hpp"
  11. #include "math/vector.hpp"
  12. #include "util/identity.hpp"
  13. namespace engine {
  14. class scene : public identity<scene, std::string> {
  15. public:
  16. using identity<scene, std::string>::identity;
  17. virtual ~scene( );
  18. virtual void update( tick );
  19. virtual void render( );
  20. virtual void handle_key_event( event::key_event evt );
  21. virtual void handle_mouse_event( event::mouse_event evt );
  22. math::vec2 get_size( ) const;
  23. key_binding const & get_binding( ) const;
  24. protected:
  25. void change_scene( std::string const & scene_id );
  26. private:
  27. math::vec2 local_scene_dimension;
  28. key_binding keys;
  29. std::weak_ptr<game_dispatch> dispatch;
  30. };
  31. }