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.
22 lines
412 B
C++
22 lines
412 B
C++
#include "Drawable.hpp"
|
|
|
|
void fmri::Drawable::patchTransparancy()
|
|
{
|
|
if constexpr (std::tuple_size<Color>::value < 4) {
|
|
// Not compiling with alpha support
|
|
return;
|
|
}
|
|
|
|
const auto alpha = getAlpha();
|
|
const auto end = colorBuffer.end();
|
|
|
|
for (auto it = colorBuffer.begin(); it != end; ++it) {
|
|
(*it)[3] = alpha;
|
|
}
|
|
}
|
|
|
|
void fmri::Drawable::glLoad()
|
|
{
|
|
// Do nothing
|
|
}
|