OpenClonk Bugtracker - OpenClonk
View Issue Details
0002065OpenClonkEngine - Graphicspublic2019-04-28 10:572019-04-29 22:00
Assigned ToClonkonaut 
PlatformOSWindows / LinuxOS Version
Product Version 
Target VersionFixed in Versiongit master 
Summary0002065: Wrong OpenGL context set, some of the time.
DescriptionLatest Snapshot. 6593d9b6216d44fdf9182a111493e3a6ee1cb93c

Some of the time, the wrong OpenGL context is set, which can lead to crashes with some drivers (e. g. Windows 64 bit).
On my Linux machine, it results in invisible objects and generally glitching graphics.
Only observed so far in the Editor.

It both causes OpenGL errors.
Apitrace reports that some of the time no valid context is set.
Additionally, objects (VAOs) from the wrong context appear to be used some of the time.
Steps To ReproduceRun a scenario in the editor.

Add a torch via script and attach it to the wall.

Wait for the player viewport to close. (Player elimination)

Open a new viewport.

Add a torch via script and attach it to the wall.
Additional InformationIn C4FoW::~C4FoW(), the "main context" is selected, which is the wrong context sometimes.

However, that had been introduced to fix some other bug.
I'm not sure what the correct context to set here would be.

Also, fixes only part of the problem: VAOs are not used by the wrong context anymore, but still GL errors and glitches occur.

I assume that in some place a context switch is missing.
TagsNo tags attached.
Attached Files

2019-04-29 19:01   
A fix has been merged.
Please close this.

Issue History
2019-04-28 10:57FoalyNew Issue
2019-04-29 19:01FoalyNote Added: 0006234
2019-04-29 22:00ClonkonautAssigned To => Clonkonaut
2019-04-29 22:00ClonkonautStatusnew => resolved
2019-04-29 22:00ClonkonautResolutionopen => fixed
2019-04-29 22:00ClonkonautFixed in Version => git master