MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / render

Method render

src/host/stage_view.cpp:101–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101GLuint StageView::render(Stage& stage) const {
102 if (fbo_ == 0) {
103 return 0;
104 }
105
106 canvas_.glBindFramebuffer(GL_FRAMEBUFFER, fbo_);
107 canvas_.glViewport(0, 0, width_, height_);
108 canvas_.glClearColor(0.1f, 0.1f, 0.1f, 1.0f);
109 canvas_.glClear(GL_COLOR_BUFFER_BIT);
110
111 // A VAO must be bound for the viz layer's glDrawArrays calls to produce
112 // output in a core-profile context; bind ours each frame since ImGui's
113 // backend rebinds/clears the VAO binding when it renders.
114 // Enable alpha blending for this pass so the pixel-value text overlay
115 // (glyph coverage lives in the fragment alpha) composites over the buffer
116 // instead of painting opaque glyph-quad boxes. Set every frame: ImGui's GL
117 // backend saves/restores blend state around its own render and leaves it
118 // disabled between our passes (same reason the VAO is rebound above).
119 canvas_.glEnable(GL_BLEND);
120 canvas_.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
121
122 canvas_.glBindVertexArray(vao_);
123 stage.update();
124 stage.draw();
125 canvas_.glBindVertexArray(0);
126
127 canvas_.glBindFramebuffer(GL_FRAMEBUFFER, 0);
128 return texture_;
129}
130
131} // namespace oid::host

Callers 2

draw_canvas_paneFunction · 0.45
mainFunction · 0.45

Calls 9

glBindFramebufferMethod · 0.80
glViewportMethod · 0.80
glClearColorMethod · 0.80
glClearMethod · 0.80
glEnableMethod · 0.80
glBlendFuncMethod · 0.80
glBindVertexArrayMethod · 0.80
updateMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected