Skip to main content
Fixed a broken link
Source Link
pacmaninbw
  • 26.2k
  • 13
  • 47
  • 114

I ripped everything from these lovely people: https://austinmorlan.com/posts/entity_component_system/; C++ Event System - Game Engine

so give me little to no credit for the ideas used, but I did write every single line myself (using they're implementations as heavy motivation).

I ripped everything from these lovely people: https://austinmorlan.com/posts/entity_component_system/; C++ Event System - Game Engine so give me little to no credit for the ideas used, but I did write every single line myself (using they're implementations as heavy motivation).

I ripped everything from these lovely people:

so give me little to no credit for the ideas used, but I did write every single line myself (using they're implementations as heavy motivation).

added 28 characters in body
Source Link
G. Sliepen
  • 69.5k
  • 3
  • 75
  • 180

This should output:

downlevel: -1 downlevel consiquence: -1 method down level: -1 level: 0 level: 0 

Output

terminal output

Output

terminal output

This should output:

downlevel: -1 downlevel consiquence: -1 method down level: -1 level: 0 level: 0 
deleted 92 characters in body; edited title
Source Link
G. Sliepen
  • 69.5k
  • 3
  • 75
  • 180

please rip my event Event manager apart! its supposed to be fast and versitile for the game im makinggames written in c++C++17

I hope you've hadThis is a great day today! I'm here to ask y'all to help me review my single header event manager that I'm using in my game.

disclaimer:Disclaimer

I ripped everything from these lovely people: https://austinmorlan.com/posts/entity_component_system/ ;https://austinmorlan.com/posts/entity_component_system/; C++ Event System - Game Engine so give me little to no credit for the ideas used, but I did write every single line myself (using they're implementations as heavy motivation).

lookingLooking for:

  • if itsit's readable
  • if there are any hidden bugs (I'm an amateur c++C++ hobbiest programmer, ~1 year, little experience with static and used it anyway)
  • features iI should add (does this cover everything iI need to make a small scale game? iI have little experience and don't know if iI covered everything)
  • just an overall review would be nice (:

theThe goals of the event manager:

  • no base event class
  • events are just POD structs
  • as few virtual methods as possible
  • no explicit registering of events
  • fast contiguous execution of functions (I don'tdont really mind if subscribing takes longer to achieve this)
  • simple api (no std::bind, lambdas, etc...)
  • single header

API (Main.cpp)Example usage:

tldr if you don't wanna readSummary of the codefunctionality provided

  • you can subscribe with a podPOD struct type and a raw function pointer
  • you can unsubscribe by passing in the handle returned by the subscribe and the event type
  • you can publish blocking events with the event type and the same instance of that event type (has to be pod)
  • you can publish to the bus (same rules as publishing a blocking event)
  • you can poll bus events by calling poll events, this is blocking
  • unsubscribing does exactly what it says, needs event type and handle from subscribe.

implementationImplementation (EventManager.h):

requires c++ 17 btw

what it printedOutput

what I'm worried aboutQuestions

  • I'm worried the static s_Callbackss_Callbacks in the EventManagerEventManager class is bad
  • scaleability (in usage and with features)
  • features I should add (in the context of openglOpenGL and windows.h gamedev)
  • is there any way to get rid of the base CallbackContainerCallbackContainer class? do I even need too?

please rip my event manager apart! its supposed to be fast and versitile for the game im making in c++

I hope you've had a great day today! I'm here to ask y'all to help me review my single header event manager that I'm using in my game.

disclaimer:

I ripped everything from these lovely people: https://austinmorlan.com/posts/entity_component_system/ ; C++ Event System - Game Engine so give me little to no credit for the ideas used, but I did write every single line myself (using they're implementations as heavy motivation).

looking for:

  • if its readable
  • if there are any hidden bugs (I'm an amateur c++ hobbiest programmer, ~1 year, little experience with static and used it anyway)
  • features i should add (does this cover everything i need to make a small scale game? i have little experience and don't know if i covered everything)
  • just an overall review would be nice (:

the goals of the event manager:

  • no base event class
  • events are just POD structs
  • as few virtual methods as possible
  • no explicit registering of events
  • fast contiguous execution of functions (I don't really mind if subscribing takes longer to achieve this)
  • simple api (no std::bind, lambdas, etc...)
  • single header

API (Main.cpp):

tldr if you don't wanna read the code

  • you can subscribe with a pod struct type and a raw function pointer
  • you can unsubscribe by passing in the handle returned by the subscribe and the event type
  • you can publish blocking events with the event type and the same instance of that event type (has to be pod)
  • you can publish to the bus (same rules as publishing a blocking event)
  • you can poll bus events by calling poll events, this is blocking
  • unsubscribing does exactly what it says, needs event type and handle from subscribe.

implementation (EventManager.h):

requires c++ 17 btw

what it printed

what I'm worried about

  • I'm worried the static s_Callbacks in the EventManager class is bad
  • scaleability (in usage and with features)
  • features I should add (in the context of opengl and windows.h gamedev)
  • is there any way to get rid of the base CallbackContainer class? do I even need too?

Event manager for games written in C++17

This is a single header event manager that I'm using in my game.

Disclaimer

I ripped everything from these lovely people: https://austinmorlan.com/posts/entity_component_system/; C++ Event System - Game Engine so give me little to no credit for the ideas used, but I did write every single line myself (using they're implementations as heavy motivation).

Looking for

  • if it's readable
  • if there are any hidden bugs (I'm an amateur C++ hobbiest programmer, ~1 year, little experience with static and used it anyway)
  • features I should add (does this cover everything I need to make a small scale game? I have little experience and don't know if I covered everything)
  • just an overall review would be nice (:

The goals of the event manager

  • no base event class
  • events are just POD structs
  • as few virtual methods as possible
  • no explicit registering of events
  • fast contiguous execution of functions (I dont really mind if subscribing takes longer to achieve this)
  • simple api (no std::bind, lambdas, etc...)
  • single header

Example usage:

Summary of the functionality provided

  • you can subscribe with a POD struct type and a raw function pointer
  • you can unsubscribe by passing in the handle returned by the subscribe and the event type
  • you can publish blocking events with the event type and the same instance of that event type (has to be pod)
  • you can publish to the bus (same rules as publishing a blocking event)
  • you can poll bus events by calling poll events, this is blocking
  • unsubscribing does exactly what it says, needs event type and handle from subscribe.

Implementation (EventManager.h)

Output

Questions

  • I'm worried the static s_Callbacks in the EventManager class is bad
  • scaleability (in usage and with features)
  • features I should add (in the context of OpenGL and windows.h gamedev)
  • is there any way to get rid of the base CallbackContainer class? do I even need too?
capitalize pronouns, add punctuation
Source Link
Loading
Source Link
Loading