MCPcopy Create free account
hub / github.com/cginternals/globjects / initialize

Function initialize

source/examples/ssbo/main.cpp:41–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40
41void 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
70void deinitialize()
71{

Callers 6

ScreenAlignedQuadMethod · 0.70
mainFunction · 0.70
hasExtensionMethod · 0.50
resizeMethod · 0.50
paintMethod · 0.50

Calls 5

refMethod · 0.80
dataMethod · 0.80
bindBaseMethod · 0.80
programMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected