python3 bytes vs str in getExtensionProcedure

Rob McMullen - NOAA Affiliate via PyOpenGL-Users <[email protected]> Tue, 26 Jun 2018 15:00:50 -0700
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAG6S91B3c+mJUcppP=xn-Tzywt1uBMTBrABnZzkU1C2VaTP-5A@mail.gmail.com>
--===============1761035107684142698==
Content-Type: multipart/alternative; boundary="0000000000009e3a5c056f92a1b9"

--0000000000009e3a5c056f92a1b9
Content-Type: text/plain; charset="UTF-8"

In python 3 (and pyopengl 3.1.1a1), this works:

    gl.platform.PLATFORM.getExtensionProcedure(b"glGenBuffers")

but this fails, returning None:

    gl.platform.PLATFORM.getExtensionProcedure("glGenBuffers")

on any platform. The difference being the bytes vs str in the argument.

This is a corner case to be sure because I'm trying to support some very
old legacy OpenGL implementations (OpenGL 2.1 because wxPython on Windows),
but maybe this will save someone else, oh, I don't know, like 8 or 10 hours
debugging... :)

Rob

--0000000000009e3a5c056f92a1b9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>In python 3 (and pyopengl 3.1.1a1), this works:<br></=
div><div><br></div>=C2=A0 =C2=A0 gl.platform.PLATFORM.getExtensionProcedure=
(b&quot;glGenBuffers&quot;)<br><div><br></div><div>but this fails, returnin=
g None:</div><div><br></div><div><div>=C2=A0 =C2=A0 gl.platform.PLATFORM.ge=
tExtensionProcedure(&quot;glGenBuffers&quot;)</div></div><div><br></div><di=
v>on any platform. The difference being the bytes vs str in the argument.</=
div><div><br></div><div>This is a corner case to be sure because I&#39;m tr=
ying to support some very old legacy OpenGL implementations (OpenGL 2.1 bec=
ause wxPython on Windows), but maybe this will save someone else, oh, I don=
&#39;t know, like 8 or 10 hours debugging... :)</div><div><br></div><div>Ro=
b</div><div><br></div></div>

--0000000000009e3a5c056f92a1b9--


--===============1761035107684142698==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--===============1761035107684142698==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users

--===============1761035107684142698==--