cginternals / cginternals/gloperate

Double initialization of render stage

Open
#400 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
43
Forks
24
PR merge metrics
No merged PRs in 30d

Description

This call order is fine:
```
m_canvas->setOpenGLContext();
m_canvas->setRenderStage(...);
```
However, if called the other way around (as a result of my solution to #393), the render stage is initialized twice: once during `setOpenGLContext()` and once during the first call to `render()` (without intermediate deinitialization).

Solution ideas:
- add m_contextInitialized flag to Canvas
- Stage stores a pointer to the context it has been initialized with that can be checked by the Canvas

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing Canvas::setOpenGLContext(), Canvas::setRenderStage(...), and the first render() call in the call order shown. Reproduce the reversed order and inspect when the render stage is initialized, then verify that it is initialized only once without intermediate deinitialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.