# Fixes to GL context sharing in editor

**URL:** https://forum.castle-engine.io/t/fixes-to-gl-context-sharing-in-editor/593
**Category:** News
**Created:** [June 12, 2022, 2:01am UTC](https://forum.castle-engine.io/t/fixes-to-gl-context-sharing-in-editor/593 "2022-06-12T02:01:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [June 12, 2022, 2:01am UTC](https://forum.castle-engine.io/t/fixes-to-gl-context-sharing-in-editor/593/1 "2022-06-12T02:01:36Z")

</div>

| [![CGE editor with preview](https://castle-engine.io/wp/wp-content/uploads/2022/06/Zrzut-ekranu-z-2022-06-12-03-59-04-200x113.png)](https://castle-engine.io/wp/wp-content/uploads/2022/06/Zrzut-ekranu-z-2022-06-12-03-59-04.png "CGE editor with preview") |

Our [editor](https://castle-engine.io/manual_editor.php) relies on the fact that multiple [TCastleControl](https://castle-engine.io/control_on_form) instances work OK. This is turn requires that Lazarus `TOpenGLControl` (ancestor of our `TCastleControl`) supports sharing OpenGL resources (CGE caches assume that OpenGL data is shared across contexts). I submitted Lazarus pull requests to fix this:

- for Qt5 (so you can use it now for CGE editor, as a reliable alternative to Gtk2 on Linux/FreeBSD platforms) – [qt5: Allow sharing OpenGL context data between instances of TOpenGLControl (!95) · Merge requests · FPC / Lazarus / Lazarus · GitLab](https://gitlab.com/freepascal.org/lazarus/lazarus/-/merge_requests/95).

- for Cocoa (for CGE editor on macOS) – [Cocoa: Allow sharing OpenGL context data between instances of TOpenGLControl (!96) · Merge requests · FPC / Lazarus / Lazarus · GitLab](https://gitlab.com/freepascal.org/lazarus/lazarus/-/merge_requests/96). This patch is already applied for the Lazarus version used by our [Jenkins](https://castle-engine.io/cloud_builds_jenkins) to build CGE editor for macOS for our [main downloads](https://castle-engine.io/).
