aconstlink / motor

Software Framework for Audio/Visual/Interactive Real-Time Applications
MIT License
3 stars 0 forks source link

Single Window Optimization #24

Open aconstlink opened 11 months ago

aconstlink commented 11 months ago

If only one window is used, a bid (backend id) is not required anymore and could be replaced. In the graphics object class, the bid management can be removed and replaced by a single size_t field for the oid to be stored.

class object
{
private:
#if MOTOR_SINGLE_WINDOW_OPTIMIZATION
size_t _oid ;
#else
//.. the usual code
motor::vector< id_t > _ids ;
#endif
}

The bid/oid pair is required when a single graphics object is used in multiple windows. Each window has a backend for its own so in the backend a single graphics object is mapped to the internal data struct which is identified by the oid in the object class.

The MOTOR_SINGLE_WINDOW_OPTIMIZATION flag need to be opt-in via CMake.