-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprojectmrendernode.h
More file actions
executable file
·34 lines (27 loc) · 1003 Bytes
/
projectmrendernode.h
File metadata and controls
executable file
·34 lines (27 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef PROJECTMRENDERNODE_H
#define PROJECTMRENDERNODE_H
#include <QSGRenderNode>
#include <QQuickWindow>
#include <QOpenGLFunctions>
#include <QQuickOpenGLUtils>
#include <projectM-4/projectM.h>
#include <projectM-4/audio.h>
class ProjectMRenderNode : public QSGRenderNode, protected QOpenGLFunctions {
public:
explicit ProjectMRenderNode(int x, int y, int width, int height);
~ProjectMRenderNode() override;
void render(const RenderState* state) override;
StateFlags changedStates() const override { return DepthState; }
RenderingFlags flags() const override { return BoundedRectRendering; }
void setSize(int width, int height);
void setPosition(int x, int y);
void setAudioData(const float* pcm, int samples) const;
private:
std::unique_ptr<projectm_handle> m_projectM;
QOpenGLContext* m_projectMRenderContext;
QQuickWindow* m_window;
int m_width, m_height;
int m_x, m_y;
bool shouldUpdateSize = true;
};
#endif // PROJECTMRENDERNODE_H