Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL.framework #365

Open
bugaevc opened this Issue Jan 1, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@bugaevc
Copy link
Member

bugaevc commented Jan 1, 2018

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?

@bugaevc bugaevc added the GUI label Jan 11, 2018

bugaevc added a commit to darlinghq/darling-cocotron that referenced this issue May 27, 2018

Port Cocotron to the new EGL-based OpenGL.framework
See darlinghq/darling#365

TODO:
* Get rid of the few remaining glX calls
* Port CALayerContext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.