MCPcopy Create free account
hub / github.com/VCVRack/Rack / drawFramebuffer

Method drawFramebuffer

src/widget/OpenGlWidget.cpp:16–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14
15
16void OpenGlWidget::drawFramebuffer() {
17 math::Vec fbSize = getFramebufferSize();
18 glViewport(0.0, 0.0, fbSize.x, fbSize.y);
19 glClearColor(0.0, 0.0, 0.0, 1.0);
20 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
21
22 glMatrixMode(GL_PROJECTION);
23 glLoadIdentity();
24 glOrtho(0.0, fbSize.x, 0.0, fbSize.y, -1.0, 1.0);
25
26 glBegin(GL_TRIANGLES);
27 glColor3f(1, 0, 0);
28 glVertex3f(0, 0, 0);
29 glColor3f(0, 1, 0);
30 glVertex3f(fbSize.x, 0, 0);
31 glColor3f(0, 0, 1);
32 glVertex3f(0, fbSize.y, 0);
33 glEnd();
34}
35
36
37} // namespace widget

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected