jfcameron / gdk-graphics

3D Rendering using OpenGLES 2.0/WebGL1.0. Platforms: Linux, Windows, Mac, x86 64bit, arm64, wasm
MIT License
1 stars 1 forks source link

entity_owner interface #32

Closed jfcameron closed 3 years ago

jfcameron commented 3 years ago

currently user types that own entities are forced to have methods like owner::add_to_scene(pScene), etc. This is the opposite direction that entities follow, being pScene->add_to_scene(pEntity). An entirely optional interface for owners could allow for the same directionality, so pScene->add_to_scene(pOwner) instead of pOwner->add_to_scene(pScene). maybe other benefits from having a common type for collections in user code.

jfcameron commented 3 years ago

took a look at flappybit (game project) and text renderer (project that adds text rendering capabilities to gdk::graphics). Textrenderers have to be collected differently and provide different interfaces to any other entity used in flappybit. If a library-facing interface existed so I could set up rules on how the library consumes user-defined types (e.g: text renderers), then projects that extend gdk::graphics (like textrenderer) would be much more uniform to use

jfcameron commented 3 years ago

79c56810b1d3f645a6f4deba1e9b40590fcaa378