]> git.tdb.fi Git - libs/vr.git/blobdiff - source/openvr/openvrsystem.h
Provide objects for visualizing controllers
[libs/vr.git] / source / openvr / openvrsystem.h
index 7799ad298405914f198d41c7ddd676eae902b59b..0e787eb8d465c947d8d6f53283be5c5a6bfb5f1d 100644 (file)
@@ -1,7 +1,10 @@
 #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"
@@ -13,11 +16,21 @@ namespace VR {
 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:
@@ -42,6 +55,12 @@ 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