Add wxGLContext::GetProcAddress() (PR #26209)

12 views
Skip to first unread message

VZ

unread,
Feb 19, 2026, 12:31:35 PM (yesterday) Feb 19
to wx-...@googlegroups.com, Subscribed

Implement this function as a trivial wrapper for wglGetProcAddress(), glXGetProcAddressARB() or eglGetProcAddress() depending on the platform (currently not implemented for macOS).

Account for the known bug in some Windows OpenGL drivers by checking for manifestly invalid return values and handling them as null.

Use the new function in wxGL code itself and in the pyramid sample.

Closes #9215.


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26209

Commit Summary

  • 633ca54 Add wxGLContext::GetProcAddress()

File Changes

(11 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26209@github.com>

VZ

unread,
Feb 19, 2026, 12:32:42 PM (yesterday) Feb 19
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26209)

@dsa-t I've finally done the simplest thing possible and just mentioned the Windows complications in the documentation because I'm not sure we should impose the extra burden of selecting the context first on all library users.

Please let me know if this minimal version is sufficient for your needs and, if not, what is missing. TIA!


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26209/c3928748760@github.com>

dsa-t

unread,
Feb 19, 2026, 12:50:23 PM (yesterday) Feb 19
to wx-...@googlegroups.com, Subscribed
dsa-t left a comment (wxWidgets/wxWidgets#26209)

Thanks, looks good for me!

On macOS, GLEW and libepoxy load "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"

https://github.com/nigels-com/glew/blob/ee5586bbd99c2976bafee5de97bbacc38c71a103/auto/src/glew_head.c#L85-L101

https://github.com/anholt/libepoxy/blob/1b6d7db184bb1a0d9af0e200e06a0331028eaaae/src/dispatch_common.c#L178

GLAD tries to load from:

    static const char *NAMES[] = {
        "../Frameworks/OpenGL.framework/OpenGL",
        "/Library/Frameworks/OpenGL.framework/OpenGL",
        "/System/Library/Frameworks/OpenGL.framework/OpenGL",
        "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"
    };

According to https://yairchu.github.io/posts/intercept-to-fix, "/System/Library/Frameworks/OpenGL.framework/OpenGL" is gone in macOS 11.0


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26209/c3928864965@github.com>

VZ

unread,
Feb 19, 2026, 1:02:22 PM (yesterday) Feb 19
to wx-...@googlegroups.com, Push

@vadz pushed 1 commit.

  • 8c10467 Add wxGLContext::GetProcAddress()


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26209/before/633ca54837075e6dbb368beac175a400391fd5b0/after/8c104672387e2c1d1f7bf2c64d656f07c640a582@github.com>

VZ

unread,
Feb 19, 2026, 1:07:23 PM (yesterday) Feb 19
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26209)

I still have /System/Library/Frameworks/OpenGL.framework/OpenGL (weirdly enough, it's a symlink pointing at non existing Versions/Current/OpenGL, but this doesn't prevent dlopen() from opening it) on my macOS 14.4.1 system, so we could probably use this. But I'm not sure if it's worth doing this without knowing if it actually works or not (although I checked that glGenBuffers I randomly used for my example can be loaded from it). It might, but I really don't like adding code without testing it at all so I'm tempted to merge this and then we can add macOS implementation when you or anybody else needs it, which will hopefully also allow us to test that it actually works.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26209/c3928960187@github.com>

VZ

unread,
9:29 AM (13 hours ago) 9:29 AM
to wx-...@googlegroups.com, Subscribed

Closed #26209 via b0d50ff.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26209/issue_event/22950347731@github.com>

VZ

unread,
10:07 AM (12 hours ago) 10:07 AM
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26209)

Merged, we can always add macOS support later.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26209/c3935483175@github.com>

Reply all
Reply to author
Forward
0 new messages