In this new implementation, everything is loaded on a separate thread, but the textures are initialized on the main OpenGL thread. This is all to work around the fact that you cannot create a separate GL context in GLUT.
36 lines
838 B
C++
36 lines
838 B
C++
#pragma once
|
|
|
|
#include <map>
|
|
#include <memory>
|
|
#include "LayerVisualisation.hpp"
|
|
#include "LayerData.hpp"
|
|
#include "Texture.hpp"
|
|
|
|
namespace fmri
|
|
{
|
|
class MultiImageVisualisation : public LayerVisualisation
|
|
{
|
|
public:
|
|
constexpr const static std::array<float, 12> BASE_VERTICES = {
|
|
0, -1, -1,
|
|
0, 1, -1,
|
|
0, 1, 1,
|
|
0, -1, 1,
|
|
};
|
|
|
|
explicit MultiImageVisualisation(const LayerData&);
|
|
|
|
void draw(float time) override;
|
|
|
|
void glLoad() override;
|
|
|
|
static vector<float> getVertices(const std::vector<float> &nodePositions, float scaling = 1);
|
|
static std::vector<float> getTexCoords(int n);
|
|
|
|
private:
|
|
Texture texture;
|
|
std::vector<float> vertexBuffer;
|
|
std::vector<float> texCoordBuffer;
|
|
};
|
|
}
|