25#include "EntityContainer.h"
27#include "GraphicsApi.h"
28#include "ModelContainer.h"
29#include "RenderWindow.h"
30#include "RenderStates.h"
32#include "ViewContainer.h"
37#ifndef DOXYGEN_SHOULD_SKIP_THIS
268 m_views.addView(view);
277 m_actions.addAction(action);
286 m_models.addModel(model);
295 m_worldEntities.addEntity(entity);
304 return m_worldEntities.removeEntity(entity);
313 m_hudEntities.addEntity(entity);
322 return m_hudEntities.removeEntity(entity);
381 return m_worldEntities;
388 return m_hudEntities;
457 enum class Visibility {
462 Visibility m_visibility;
464 ActionContainer m_actions;
465 Action m_closeWindowAction;
467 ModelContainer m_models;
469 ExtendView m_worldView;
470 ScreenView m_hudView;
471 ViewContainer m_views;
473 EntityContainer m_worldEntities;
474 EntityContainer m_hudEntities;
479#ifndef DOXYGEN_SHOULD_SKIP_THIS
An action that can be triggered by different controls.
Definition: Action.h:53
Adaptative view.
Definition: View.h:390
A collection of entities.
Definition: EntityContainer.h:60
A game entity.
Definition: Entity.h:53
A game object that can be updated.
Definition: Model.h:46
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:102
A scene in the game.
Definition: Scene.h:66
virtual void doHandleActions(Window &window)
Customization point for handleActions()
void hide()
Hide the scene.
void processEvent(Event &event)
Process an event.
void addAction(Action &action)
Add an action to the scene.
Definition: Scene.h:276
virtual void doHide()
Customization point for hide()
void render(RenderTarget &target, const RenderStates &states=RenderStates())
Render the scene.
virtual void doProcessEvent(Event &event)
Customization point for processEvent()
View & getWorldView()
Get the world view.
Definition: Scene.h:366
EntityContainer & getWorldEntities()
Get the world entities.
Definition: Scene.h:380
virtual void doUpdate(Time time)
Customization point for update()
void setWorldViewSize(Vector2f size)
Set the size of the world view.
void setFramebufferSize(gf::Vector2i size)
Update the framebuffer size.
virtual ~Scene()
Destructor.
void setClearColor(gf::Color4f color)
Set the new clear color.
Definition: Scene.h:162
void addWorldEntity(Entity &entity)
Add a world entity to the scene.
Definition: Scene.h:294
void setActive(bool active=true)
Change the active state of the scene.
Entity * removeHudEntity(Entity *entity)
Remove a HUD entity from the scene.
Definition: Scene.h:321
bool isHidden() const
Check if the scene is hidden.
Entity * removeWorldEntity(Entity *entity)
Remove a world entity from the scene.
Definition: Scene.h:303
void show()
Show the scene.
void addModel(Model &model)
Add a model to the scene.
Definition: Scene.h:285
void addHudEntity(Entity &entity)
Add a HUD entity to the scene.
Definition: Scene.h:312
void resume()
Resume the scene.
void pause()
Pause the scene.
virtual void doResume()
Customization point for resume()
virtual void onActivityChange(bool active)
Callback when the scene becomes active or inactive.
virtual void doRender(RenderTarget &target, const RenderStates &states)
Customization point for render()
bool isActive() const
Check if the scene is active.
void addView(AdaptativeView &view)
Add a view to the scene.
Definition: Scene.h:267
gf::Color4f getClearColor() const
Get the current clear color.
Definition: Scene.h:172
void handleActions(Window &window)
Handle actions.
EntityContainer & getHudEntities()
Get the HUD entities.
Definition: Scene.h:387
virtual void doShow()
Customization point for show()
View & getHudView()
Get the HUD view.
Definition: Scene.h:373
virtual void doPause()
Customization point for pause()
void setWorldViewCenter(Vector2f center)
Set the center of the world view.
bool isPaused() const
Check if the scene is paused.
void renderWorldEntities(RenderTarget &target, const RenderStates &states)
Render the world entities.
void renderHudEntities(RenderTarget &target, const RenderStates &states)
Render the HUD entities.
Scene(Vector2i initialSize)
Constructor.
void update(Time time)
Update the scene.
virtual bool doEarlyProcessEvent(Event &event)
Customization point for processEvent()
A scene manager.
Definition: SceneManager.h:61
Represents a time value.
Definition: Time.h:65
2D camera that defines what region is shown on framebuffer
Definition: View.h:94
An OS window.
Definition: Window.h:97
Color4< float > Color4f
A float color vector with 4 components.
Definition: Vector.h:1287
@ Hidden
The window is hidden (data in event.window)
@ Shown
The window is shown (data in event.window)
The namespace for gf classes.
Defines a system event and its parameters.
Definition: Event.h:224
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:82
A 4D vector.
Definition: Vector.h:852