This repository has been archived on 2019-09-17. You can view files and clone it, but cannot push or open issues or pull requests.
Files
research-project/src/fmri/MultiImageVisualisation.hpp
Bert Peters 265bc61b98 Large refactor of texture loading.
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.
2018-04-12 16:52:09 +02:00

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;
};
}