danielscherzer / Zenseless.OpenTK.GUI

ImGui for OpenTK
MIT License
2 stars 1 forks source link

Segmentation Fault when trying to use on macOS #1

Open Twometer opened 1 month ago

Twometer commented 1 month ago

When trying to use this package on macOS, I'm getting a segmentation fault since the CreateVertexArray calls used in the library are part of OpenGL 4.5, and the latest version on macOS is 4.1. Do you plan on supporting OpenGL versions lower than 4.5?

Btw, other than that, on Windows it works and is a really great and useful library :)

Installed product versions

Description

Creating a new instance of ImGuiFacade inside an OpenTK GameWindow like this:

_imGui = new ImGuiFacade(this);

Will cause a segmentation fault on macOS (Sonoma 14.5). I've traced it to the CreateVertexArray call inside the Zenseless.OpenTK.VertexArray constructor.

Steps to recreate

  1. Get macOS (or probably any OS or platform that has OpenGL < 4.5)
  2. Instantiate ImGuiFacade
  3. Segmentation Fault

Current behavior

It's segfaulting

Expected behavior

Not segfaulting :D

Twometer commented 1 month ago

I've fixed the problem on my fork, but it required some more "downgrading" in the Zenseless.OpenTK code... However, it now works all the way down to OpenGL v3.2

danielscherzer commented 1 month ago

Hi! Thanks for your work. Do want to make a pull request to reintegrate your changes into the main branch? I can check if my uses cases are still working with your changes....

Twometer commented 1 month ago

@danielscherzer I can make a pull request, but I've removed the dependency on Zenseless.OpenTK and re-implemented some of its classes, because I needed to change the OpenGL calls.

I assume you'd rather prefer a PR that keeps the dependency, but applies the changes in this repository: https://github.com/danielscherzer/Zenseless.OpenTK ?

danielscherzer commented 1 month ago

Your are right! Thanks anyway! I would close the issue because I cannot support MacOS... Is this ok with you?