openglonmetal / MGL

OpenGL 4.6 on Metal
Apache License 2.0
781 stars 30 forks source link

CGLGetParameter #50

Closed r58Playz closed 2 years ago

r58Playz commented 2 years ago

Currently trying to get MC running using MGL.

1.17 and onwards are suprisingly very close to working, with the glUniform* set of functions remaining.

The OpenGL Profiler by apple seems to hang MC so the list of OpenGL commands (here) that I'm using might be inaccurate.

One of the functions I found while profiling MC is CGLGetParameter. What is this function and can it be implemented in MGL? It doesn't seem to be referenced anywhere in the MGL codebase.

darkaegisagain commented 2 years ago

Opengl profiler uses the CGL macro mechanisms to redirect the entry points for all opengl calls and exit points. I don’t think we’d ever be able to get that to work with MGL

CGL relies on the original Apple OpenGL framework.

I used the same dispatch mechanism for Open calls with a dispatch table you could probably do something similar and intercept the dispatch table. The reason I did that was you could allow for multiple versions of opengl to be used like having a 3.3 compliant and a 4.6 compliant set and use the dispatch table to define the entry points

Mike

Sent from my iPhone

On Aug 8, 2022, at 7:03 PM, r58Playz @.***> wrote:

 Currently trying to get MC running using MGL.

1.17 and onwards are suprisingly very close to working, with the glUniform* set of functions remaining.

The OpenGL Profiler by apple seems to hang MC so the list of OpenGL commands (here) that I'm using might be inaccurate.

One of the functions I found while profiling MC is CGLGetParameter. What is this function and can it be implemented in MGL? It doesn't seem to be referenced anywhere in the MGL codebase.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

r58Playz commented 2 years ago

I might be able to fiddle with the library minecraft uses for it's OpenGL (LWJGL) and redirect to an custom implementation.

Just need to find why MC needs it...

darkaegisagain commented 2 years ago

You could spoof the library, we did this to debug some games by replacing the OpenGL framework with a library… but I am not sure how that would work with signed frameworks.

Mike

On Aug 8, 2022, at 7:43 PM, r58Playz @.***> wrote:

I might be able to fiddle with the library minecraft uses for it's OpenGL (LWJGL) and redirect to an custom implementation.

Just need to find why MC needs it...

— Reply to this email directly, view it on GitHub https://github.com/openglonmetal/MGL/issues/50#issuecomment-1208848996, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOKD3YWBLGVWGQTTMTFLDTVYHAUZANCNFSM557CMVWQ. You are receiving this because you commented.