Skip to content

OpenGL.framework #365

Description

@bugaevc

Right now, we are using Cocotron's implementation of OpenGL.framework (aka Core OpenGL aka CGL), which is (Win32- and) X11-specific. It is implemented as a wrapper around GLX, and AppKit (X11Window) uses both CGL and GLX calls. Furthermore, CGL itself knows about X11Windows and links to AppKit, creating a circular dependency between the two.

While this is good enough for now, it's not very future-proof, which is why we would like to implement our own version of CGL.

  • It should implement the complete CGL API, as documented here
  • It should wrap host's EGL, because we want it to work on X11, Wayland, and maybe even on Android
  • It should not depend on AppKit
    • Linking to OpenGL.framework should not bring in AppKit
    • It should be possible to do offscreen rendering without any X11/Wayland connection whatsoever
  • It should reexport all the gl* symbols from the native libGL
  • AppKit should only use CGL* and gl* APIs
    • And only link to OpenGL.framework, not native libGL/GLX
  • CGL should provide private API extensions to let AppKit register its windowing system connection and create CGL contexts for windows/surfaces
    • Think eglGetDisplay and eglCreateWindowSurface
    • Except we would also need to e.g. use eglGetConfigAttrib() to choose the visual for X11 and pass it back to AppKit
  • Should AppKit or CGL call wl_egl_* stuff?

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementA way Darling can be improvedFrameworksIssues relating to public and private frameworksGUIFor libraries and frameworks relating to graphics and user interface

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions