shiva
last version
last version
  • Shiva Documentation
  • Shiva
    • Changelog
    • FAQ
    • Gallery
    • Installation
    • Modules
      • shiva::box2d
      • shiva::dll
      • shiva::ecs
      • shiva::entt
      • shiva::enums
      • shiva::error
      • shiva::event
      • shiva::filesystem
      • shiva::input
      • shiva::json
      • shiva::lua
      • shiva::meta
      • shiva::pp
      • shiva::pyscripting
      • shiva::range
      • shiva::reflection
      • shiva::scenes
      • shiva::sfml
        • shiva::system-sfml-animation
        • shiva::system-sfml-graphics
        • shiva::system-sfml-inputs
        • shiva::system-sfml-resources
      • shiva::spdlog
      • shiva::stacktrace
      • shiva::timer
      • shiva::world
    • Roadmap
    • Scripting
      • Lua
      • Python
    • Tutorial
      • Quick'start
      • How to create/build/install a system plugin
      • How to create a scripted system
      • How to create a project through the CLI tools and build it
Powered by GitBook
On this page
  • Purpose
  • Events
  • add_base_system
  • after_load_systems_plugins
  • after_load_resources
  • fatal_error_occured
  • quit_game
  • start_game
  • key_pressed
  • key_released
  • change_scene
  1. Shiva
  2. Modules

shiva::event

On this page you will find information about the different events that can be sent and received in shiva

Purpose

The purpose of this module is to give users the opportunity to interact through events in their program, whether in C++ or in a scripting language.

Events

Event Name

Description

trigger an event that add a system in the system manager

triggers an event after the complete loading of plugged systems

triggers an event after the complete loading resource of a scene or program

triggers an event that indicates that an uncorrectable error has occurred

triggers an event that indicates the end of the program

triggers an event that indicates the beginning of the program

triggers an event if the user presses a key on his keyboard

triggers an event if the user release a key on his keyboard

triggers an event that indicates the change from one scene to another

All events are default constructible.

add_base_system

add_base_system(std::unique_ptr<shiva::ecs::base_system> system_ptr_ = nullptr) noexcept
#include <memory>
#include <shiva/event/add_base_system.hpp>
#include "conrete_system.hpp"

shiva::entt::dispatcher dispatcher;

dispatcher.trigger<shiva::event::add_base_system>(
std::make_unique<concrete_system>(...));

after_load_systems_plugins

This event has no constructor

#include <memory>
#include <shiva/event/after_load_systems_plugins.hpp>

shiva::entt::dispatcher dispatcher;

dispatcher.trigger<shiva::event::after_load_systems_plugins>();

We recommend that you do not trigger this event unless you use your own system manager.

after_load_resources

This event has no constructor

#include <memory>
#include <shiva/event/after_load_resources.hpp>

shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::after_load_resources>();

fatal_error_occured

fatal_error_occured(std::error_code ec) noexcept;
#include <memory>
#include <system_error>
#include <shiva/event/fatal_error_occured.hpp>

shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::fatal_error_occured>(std::make_error_code(std::errc::result_out_of_range));

quit_game

quit_game(int return_value) noexcept;
#include <memory>
#include <system_error>
#include <shiva/event/quit_game.hpp>

shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::quit_game>(0);

start_game

This event has no constructor

#include <memory>
#include <system_error>
#include <shiva/event/start_game.hpp>

shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::start_game>();

key_pressed

key_pressed(shiva::input::keyboard::TKey key) noexcept;
#include <memory>
#include <system_error>
#include <shiva/event/key_pressed.hpp>

shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::key_pressed>(shiva::input::keyboard::TKey::A);

key_released

key_released(shiva::input::keyboard::TKey key) noexcept;
#include <memory>
#include <system_error>
#include <shiva/event/key_released.hpp>

shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::key_released>(shiva::input::keyboard::TKey::A);

change_scene

change_scene(const char* scene_name_ = nullptr) noexcept;
#include <memory>
#include <system_error>
#include <shiva/event/change_scene.hpp>

shiva::entt::dispatcher dispatcher;
dispatcher.trigger<shiva::event::change_scene>("game_scene");
Previousshiva::errorNextshiva::filesystem

Last updated 6 years ago

This event is already triggered by the in the function ().

You can find a more concrete example in the source code

You can find a more concrete example in the source code

You can find a more concrete example in the source code

You can find a more concrete example in the source code

You can find more information about input

You can find a more concrete example in the source code

here
here
here
here
here
here
add_base_system
after_load_systems_plugins
after_load_resources
fatal_error_occured
quit_game
start_game
key_pressed
key_released
change_scene
system_manager
load_plugins