m2b-ar-tp2/fish_painter.h

31 lines
621 B
C
Raw Permalink Normal View History

2021-10-06 19:49:42 +02:00
#ifndef FISH_VIEWER_H
#define FISH_VIEWER_H
#include "fish.h"
#include <QOpenGLVertexArrayObject>
#include <QOpenGLBuffer>
#include <QOpenGLShaderProgram>
#include <QOpenGLExtraFunctions>
#include <QMatrix4x4>
2021-10-06 23:41:17 +02:00
#include <QOpenGLTexture>
2021-10-06 19:49:42 +02:00
class FishPainter {
QOpenGLVertexArrayObject vao;
QOpenGLBuffer vbo;
QOpenGLShaderProgram program;
2021-10-06 23:41:17 +02:00
QOpenGLTexture *texture = nullptr;
size_t n_verts;
2021-10-06 19:49:42 +02:00
public:
2021-10-06 23:41:17 +02:00
~FishPainter();
2021-10-06 19:49:42 +02:00
void create(QOpenGLExtraFunctions *glf);
void paint(QOpenGLExtraFunctions *glf,
const QMatrix4x4 &projection,
const QMatrix4x4 &view,
const std::vector<Fish> fishes);
};
#endif