#ifndef MSP_VR_OPENVRSYSTEM_H_
#define MSP_VR_OPENVRSYSTEM_H_
+#include <msp/gl/material.h>
#include <msp/gl/matrix.h>
+#include <msp/gl/object.h>
+#include <msp/gl/technique.h>
#include <msp/vr/system.h>
#include "openvrcamera.h"
#include "openvrcombiner.h"
class OpenVRSystem: public System
{
private:
+ struct RenderModel;
+
unsigned n_tracked_devices;
std::vector<GL::Matrix> tracking_matrices;
std::vector<OpenVRController *> controllers;
std::vector<unsigned> unclaimed_controllers;
+ GL::Program render_shprog;
+ GL::Program render_shprog_textured;
+ GL::Material render_material;
+ std::map<std::string, RenderModel *> render_models;
+ std::map<unsigned, GL::Texture2D *> render_textures;
+ std::list<std::string> loading_render_models;
+ std::list<unsigned> loading_textures;
+
static unsigned n_instances;
public:
const GL::Matrix &get_hmd_matrix() const;
void add_controller(OpenVRController &);
void remove_controller(OpenVRController &);
+
+ const GL::Object *get_render_model(const std::string &);
+private:
+ bool check_loading_render_model(const std::string &);
+ const GL::Texture2D *get_texture(unsigned);
+ bool check_loading_texture(unsigned);
};
} // namespace VR