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

Function draw

source/examples/computeshader/main.cpp:79–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void draw()
80{
81 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
82
83 g_frame = (g_frame + 1) % static_cast<int>(200 * glm::pi<double>());
84
85 g_computeProgram->setUniform("roll", static_cast<float>(g_frame) * 0.01f);
86
87 g_texture->bindActive(0);
88
89 g_computeProgram->dispatchCompute(512 / 16, 512 / 16, 1); // 512^2 threads in blocks of 16^2
90 g_computeProgram->release();
91
92 glMemoryBarrier(GL_TEXTURE_UPDATE_BARRIER_BIT);
93
94 glViewport(0, 0, g_size.x, g_size.y);
95 g_quad->draw();
96}
97
98
99void error(int errnum, const char * errmsg)

Callers 1

mainFunction · 0.70

Calls 4

bindActiveMethod · 0.80
dispatchComputeMethod · 0.80
releaseMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected