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.
28 lines
518 B
C++
28 lines
518 B
C++
#pragma once
|
|
|
|
#include "LayerData.hpp"
|
|
#include "LayerVisualisation.hpp"
|
|
#include "Texture.hpp"
|
|
|
|
namespace fmri
|
|
{
|
|
class InputLayerVisualisation : public LayerVisualisation
|
|
{
|
|
public:
|
|
explicit InputLayerVisualisation(const LayerData &data);
|
|
|
|
void draw(float time) override;
|
|
|
|
void glLoad() override;
|
|
|
|
private:
|
|
float targetWidth;
|
|
float targetHeight;
|
|
int width;
|
|
int height;
|
|
Texture texture;
|
|
std::vector<float> textureBuffer;
|
|
|
|
};
|
|
}
|