| 32 | |
| 33 | |
| 34 | void initialize() |
| 35 | { |
| 36 | // Initialize OpenGL objects |
| 37 | static const int w(256); |
| 38 | static const int h(256); |
| 39 | |
| 40 | unsigned char data[w * h * 4]; |
| 41 | |
| 42 | std::random_device rd; |
| 43 | std::mt19937 generator(rd()); |
| 44 | |
| 45 | std::poisson_distribution<> r(0.2); |
| 46 | |
| 47 | for (int i = 0; i < w * h * 4; ++i) |
| 48 | data[i] = static_cast<unsigned char>(255 - static_cast<unsigned char>(r(generator) * 255)); |
| 49 | |
| 50 | g_texture = globjects::Texture::createDefault(GL_TEXTURE_2D); |
| 51 | g_texture->ref(); |
| 52 | g_texture->image2D(0, GL_RGBA8, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); |
| 53 | |
| 54 | g_quad = new ScreenAlignedQuad(g_texture); |
| 55 | g_quad->ref(); |
| 56 | g_quad->setSamplerUniform(0); |
| 57 | } |
| 58 | |
| 59 | void deinitialize() |
| 60 | { |
no test coverage detected