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

Function draw

source/examples/tessellation/main.cpp:83–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void draw()
84{
85 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
86
87 const auto t_elapsed = std::chrono::high_resolution_clock::now() - g_starttime;
88 const auto t = static_cast<float>(t_elapsed.count()) * 4e-10f;
89 glm::mat4 R = glm::rotate(t * 1.f, glm::vec3(sin(t * 0.321f), cos(t * 0.234f), sin(t * 0.123f)));
90
91 g_sphere->setUniform("transform", g_viewProjection);
92 g_sphere->setUniform("rotation", R);
93
94 const auto level = static_cast<int>((sin(t) * 0.5f + 0.5f) * 16) + 1;
95 g_sphere->setUniform("level", level);
96 g_sphere->use();
97
98 glViewport(0, 0, g_size.x, g_size.y);
99
100 glPatchParameteri(GL_PATCH_VERTICES, 3);
101 g_icosahedron->draw(GL_PATCHES);
102
103 g_sphere->release();
104}
105
106
107void error(int errnum, const char * errmsg)

Callers 2

drawMethod · 0.70
mainFunction · 0.70

Calls 4

countMethod · 0.45
useMethod · 0.45
drawMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected