protected:
Graphics::Display display;
Graphics::Window window;
- std::unique_ptr<VR::System> vr_system;
+ std::unique_ptr<VR::System> vr_init;
GL::Device gl_device;
ResourcesType resources;
+ std::unique_ptr<VR::System> vr_system;
Game::Director director;
GL::WindowView gl_view;
Presenter presenter;
Application(Features = NO_FEATURES);
protected:
- GL::DeviceOptions create_gl_device_options();
+ static GL::DeviceOptions create_gl_device_options(VR::System * = nullptr);
int main() override;
protected:
template<typename T, typename R>
Application<T, R>::Application(Features features):
window(display, 1920, 1080),
- vr_system(features==VIRTUAL_REALITY ? VR::System::create_autodetect() : nullptr),
- gl_device(window, create_gl_device_options()),
+ vr_init(features==VIRTUAL_REALITY ? VR::System::create_autodetect() : nullptr),
+ gl_device(window, create_gl_device_options(vr_init.get())),
+ vr_system(move(vr_init)),
director(resources),
gl_view(window),
presenter(director, gl_view),
}
template<typename T, typename R>
-GL::DeviceOptions Application<T, R>::create_gl_device_options()
+GL::DeviceOptions Application<T, R>::create_gl_device_options(VR::System *vr_sys)
{
GL::DeviceOptions opts = GL::Device::create_default_options();
- if(vr_system)
- vr_system->fill_gl_device_options(opts);
+ if(vr_sys)
+ vr_sys->fill_gl_device_options(opts);
return opts;
}