| 39 | |
| 40 | |
| 41 | void initialize() |
| 42 | { |
| 43 | const auto dataPath = common::retrieveDataPath("globjects", "dataPath"); |
| 44 | g_quad = new ScreenAlignedQuad(globjects::Shader::fromFile(GL_FRAGMENT_SHADER, dataPath + "ssbo/ssbo.frag")); |
| 45 | g_quad->ref(); |
| 46 | |
| 47 | g_quad->program()->setUniform("maximum", 10); |
| 48 | g_quad->program()->setUniform("rowCount", 10); |
| 49 | g_quad->program()->setUniform("columnCount", 10); |
| 50 | |
| 51 | static const auto data = std::array<int, 100> { |
| 52 | 1,2,3,4,5,6,7,8,9,10, |
| 53 | 10,1,2,3,4,5,6,7,8,9, |
| 54 | 9,10,1,2,3,4,5,6,7,8, |
| 55 | 8,9,10,1,2,3,4,5,6,7, |
| 56 | 7,8,9,10,1,2,3,4,5,6, |
| 57 | 6,7,8,9,10,1,2,3,4,5, |
| 58 | 5,6,7,8,9,10,1,2,3,4, |
| 59 | 4,5,6,7,8,9,10,1,2,3, |
| 60 | 3,4,5,6,7,8,9,10,1,2, |
| 61 | 2,3,4,5,6,7,8,9,10,1 }; |
| 62 | |
| 63 | g_buffer = new globjects::Buffer(); |
| 64 | g_buffer->ref(); |
| 65 | g_buffer->setData(sizeof(data), data.data(), GL_STATIC_DRAW); |
| 66 | |
| 67 | g_buffer->bindBase(GL_SHADER_STORAGE_BUFFER, 1); |
| 68 | } |
| 69 | |
| 70 | void deinitialize() |
| 71 | { |
no test coverage detected