sinpin-vr/src/panel.h

40 lines
701 B
C
Raw Normal View History

2023-04-07 19:13:52 +02:00
#define GL_GLEXT_PROTOTYPES
#include "util.h"
#include <GLFW/glfw3.h>
#include <string>
const vr::HmdMatrix34_t DEFAULT_POSE = {{{1, 0, 0, 0}, {0, 1, 0, 1}, {0, 0, 1, 0}}};
2023-04-07 13:26:42 +02:00
class App;
class Panel
{
public:
Panel(App *app, vr::HmdMatrix34_t start_pose, int index, int xmin, int xmax, int ymin, int ymax);
void Update();
void SetHidden(bool state);
private:
void Render();
void UpdateCursor();
void ControllerGrab(TrackerID);
void ControllerRelease();
App *_app;
OverlayID _id;
int _index;
std::string _name;
TrackerID _active_hand;
bool _is_held;
int _x, _y;
int _width, _height;
float _meters;
float _alpha;
bool _hidden;
vr::Texture_t _texture;
GLuint _gl_texture;
};