sinpin-vr/src/panel.h

51 lines
757 B
C
Raw Normal View History

2023-04-11 19:26:26 +02:00
#pragma once
2023-04-13 21:45:21 +02:00
#include "overlay.h"
2023-04-07 19:13:52 +02:00
#define GL_GLEXT_PROTOTYPES
2023-04-11 19:26:26 +02:00
#include "util.h"
#include <GLFW/glfw3.h>
2023-04-13 23:01:26 +02:00
const VRMat DEFAULT_POSE = {{{1, 0, 0, 0}, {0, 1, 0, 1}, {0, 0, 1, 0}}};
2023-04-07 13:26:42 +02:00
class App;
2023-04-13 21:45:21 +02:00
class Overlay;
class Panel
{
public:
2023-04-13 23:01:26 +02:00
Panel(App *app, int index, int xmin, int xmax, int ymin, int ymax);
void Update();
void SetHidden(bool state);
2023-04-24 20:22:09 +02:00
void ResetTransform();
2023-04-29 16:44:25 +02:00
int Width()
{
return _width;
}
int Height()
{
return _height;
}
void SetCursor(int x, int y);
Ray IntersectRay(glm::vec3 origin, glm::vec3 direction, float max_len);
2023-04-13 21:45:21 +02:00
Overlay *GetOverlay();
private:
void Render();
void UpdateCursor();
App *_app;
int _index;
int _x, _y;
int _width, _height;
2023-04-13 21:45:21 +02:00
Overlay _overlay;
2023-04-11 19:26:26 +02:00
vr::Texture_t _texture;
GLuint _gl_texture;
};