Skip to content
Snippets Groups Projects
Commit 5daa759e authored by jwendt's avatar jwendt
Browse files

updated naming to Google Styleguide Conventions

parent 0572b7d2
No related branches found
No related tags found
1 merge request!156Feature/#463 mouse keyboard device
...@@ -76,7 +76,7 @@ void DisplaySystemWindow::CreateRenderTarget(Scene* scene, float field_of_view, ...@@ -76,7 +76,7 @@ void DisplaySystemWindow::CreateRenderTarget(Scene* scene, float field_of_view,
boost::signals2::connection DisplaySystemWindow::AddQuitCallback( boost::signals2::connection DisplaySystemWindow::AddQuitCallback(
const std::function<void()>& callback) { const std::function<void()>& callback) {
return sdl_event_receiver.quit_signal_.connect(callback); return sdl_event_receiver_.quit_signal_.connect(callback);
} }
void DisplaySystemWindow::SDLEventReceiver::OnSDLEvent(const SDL_Event& event) { void DisplaySystemWindow::SDLEventReceiver::OnSDLEvent(const SDL_Event& event) {
if (event.type == SDL_QUIT) quit_signal_(); if (event.type == SDL_QUIT) quit_signal_();
......
...@@ -74,7 +74,7 @@ class PHOENIX_EXPORT DisplaySystemWindow : public DisplaySystem { ...@@ -74,7 +74,7 @@ class PHOENIX_EXPORT DisplaySystemWindow : public DisplaySystem {
// other SDLDevice like Mouse or Keyboard is present the quit signal is never // other SDLDevice like Mouse or Keyboard is present the quit signal is never
// fired. The rational behind that is that the SDL Events are only polled from // fired. The rational behind that is that the SDL Events are only polled from
// within the DeviceSystem // within the DeviceSystem
SDLEventReceiver sdl_event_receiver; SDLEventReceiver sdl_event_receiver_;
}; };
template <typename... Arguments> template <typename... Arguments>
......
...@@ -28,14 +28,14 @@ namespace phx { ...@@ -28,14 +28,14 @@ namespace phx {
int SDLDevice::reference_counter_ = 0; int SDLDevice::reference_counter_ = 0;
std::mutex SDLDevice::SDL_event_init_mutex_; std::mutex SDLDevice::SDL_event_init_mutex_;
SDLDevice::SDLEventDistributer SDLDevice::SDL_event_distributer; SDLDevice::SDLEventDistributer SDLDevice::SDL_event_distributer_;
SDLDevice::SDLDevice() { SDLDevice::SDLDevice() {
SDL_event_init_mutex_.lock(); SDL_event_init_mutex_.lock();
if (reference_counter_ == 0) { if (reference_counter_ == 0) {
SDL_Init(SDL_INIT_EVENTS); SDL_Init(SDL_INIT_EVENTS);
} }
SDL_event_distributer.AddDevice(this); SDL_event_distributer_.AddDevice(this);
reference_counter_++; reference_counter_++;
SDL_event_init_mutex_.unlock(); SDL_event_init_mutex_.unlock();
} }
...@@ -46,11 +46,11 @@ SDLDevice::~SDLDevice() { ...@@ -46,11 +46,11 @@ SDLDevice::~SDLDevice() {
if (reference_counter_ == 0) { if (reference_counter_ == 0) {
SDL_QuitSubSystem(SDL_INIT_EVENTS); SDL_QuitSubSystem(SDL_INIT_EVENTS);
} }
SDL_event_distributer.RemoveDevice(this); SDL_event_distributer_.RemoveDevice(this);
SDL_event_init_mutex_.unlock(); SDL_event_init_mutex_.unlock();
} }
void SDLDevice::Update() { SDL_event_distributer.Update(); } void SDLDevice::Update() { SDL_event_distributer_.Update(); }
void SDLDevice::SDLEventDistributer::Update() { void SDLDevice::SDLEventDistributer::Update() {
SDL_Event event; SDL_Event event;
......
...@@ -52,7 +52,7 @@ class PHOENIX_EXPORT SDLDevice : public Device { ...@@ -52,7 +52,7 @@ class PHOENIX_EXPORT SDLDevice : public Device {
virtual ~SDLEventDistributer() = default; virtual ~SDLEventDistributer() = default;
void Update() override; void Update() override;
}; };
static SDLEventDistributer SDL_event_distributer; static SDLEventDistributer SDL_event_distributer_;
private: private:
static int reference_counter_; static int reference_counter_;
......
...@@ -32,7 +32,7 @@ namespace phx { ...@@ -32,7 +32,7 @@ namespace phx {
vr::IVRSystem* TrackedDevice::vr_system_ = nullptr; vr::IVRSystem* TrackedDevice::vr_system_ = nullptr;
int TrackedDevice::reference_counter_ = 0; int TrackedDevice::reference_counter_ = 0;
std::mutex TrackedDevice::openVR_init_mutex_; std::mutex TrackedDevice::openVR_init_mutex_;
TrackedDevice::OpenVREventDistributer TrackedDevice::vr_event_distributer; TrackedDevice::OpenVREventDistributer TrackedDevice::vr_event_distributer_;
std::vector<vr::TrackedDevicePose_t> TrackedDevice::last_wait_get_poses_; std::vector<vr::TrackedDevicePose_t> TrackedDevice::last_wait_get_poses_;
TrackedDevice::TrackedDevice() { TrackedDevice::TrackedDevice() {
...@@ -45,7 +45,7 @@ TrackedDevice::TrackedDevice() { ...@@ -45,7 +45,7 @@ TrackedDevice::TrackedDevice() {
throw std::runtime_error("OpenVR cannot be initialized!"); throw std::runtime_error("OpenVR cannot be initialized!");
} }
} }
vr_event_distributer.AddDevice(this); vr_event_distributer_.AddDevice(this);
reference_counter_++; reference_counter_++;
openVR_init_mutex_.unlock(); openVR_init_mutex_.unlock();
} }
...@@ -57,7 +57,7 @@ TrackedDevice::~TrackedDevice() { ...@@ -57,7 +57,7 @@ TrackedDevice::~TrackedDevice() {
vr::VR_Shutdown(); vr::VR_Shutdown();
vr_system_ = nullptr; vr_system_ = nullptr;
} }
vr_event_distributer.RemoveDevice(this); vr_event_distributer_.RemoveDevice(this);
openVR_init_mutex_.unlock(); openVR_init_mutex_.unlock();
} }
...@@ -85,7 +85,7 @@ void TrackedDevice::Update() { ...@@ -85,7 +85,7 @@ void TrackedDevice::Update() {
id_ = vr::k_unTrackedDeviceIndexInvalid; id_ = vr::k_unTrackedDeviceIndexInvalid;
} }
vr_event_distributer.Update(); vr_event_distributer_.Update();
} }
glm::mat4 TrackedDevice::GetPose() const { return pose_; } glm::mat4 TrackedDevice::GetPose() const { return pose_; }
......
...@@ -59,7 +59,7 @@ class PHOENIX_EXPORT TrackedDevice : public Device { ...@@ -59,7 +59,7 @@ class PHOENIX_EXPORT TrackedDevice : public Device {
virtual ~OpenVREventDistributer() = default; virtual ~OpenVREventDistributer() = default;
void Update() override; void Update() override;
}; };
static OpenVREventDistributer vr_event_distributer; static OpenVREventDistributer vr_event_distributer_;
static vr::IVRSystem* vr_system_; static vr::IVRSystem* vr_system_;
static std::vector<vr::TrackedDevicePose_t> last_wait_get_poses_; static std::vector<vr::TrackedDevicePose_t> last_wait_get_poses_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment