I am playing around directx lately and I am learning from rasterek.com tutorials. He passes pointers to directx objects (like ID3D11Device, ID3D11DeviceContext etc.) for almost every class he creates. Wouldn't be a better approach to create some kind of singleton or event a simple struct that keeps all of the objects? I don't know too much about game engine designs and I don't understand his purpose, for me it's just more work to do.
Example: His code:
bool Class::initialize( ID3D11Device* device ) {
device->doSmth();
}
My idea:
struct DXObj {
static ID3D11Device* device;
}
bool Class::initialize() {
DXObj::device->doSmth();
}