Extension functions in Python3 on Win32
Rob Reilink <[email protected]> Fri, 27 Apr 2012 13:06:44 +0200
| Newsgroups | gmane.comp.python.opengl.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============1568256772780322970== Content-Type: multipart/alternative; boundary=Apple-Mail-5-735318812 --Apple-Mail-5-735318812 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, We noted that extension functions do not work properly in Py3 on Win32. = The problem is that the function name is passed as a (unicode) str to = Win32Platform.getExtensionProcedure (which is a static method referring = to OpenGL.wglGetProcAddress), which is called from = BasePlatform.constructFunction The solution is of course to encode the the name, the question is where = to do this? I expect that all platforms that use getExtensionProcedure (those that = have self.EXTENSIONS_USE_BASE_FUNCTIONS=3D=3DFalse, i.e. Win32, GLX, = OSMESA) have a function that expects bytes, not str. So I would propose = to put pointer =3D self.getExtensionProcedure( as_8_bit(functionName) ) in BasePlatform.constructFunction. Should I go ahead and implement this and create a pull request, or = should this be implemented somewhere else? Rob --------------------------------------------- Rob Reilink, M.Sc Science Applied phone: +31 6 187 26562 e-mail: [email protected] --------------------------------------------- --Apple-Mail-5-735318812 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; = ">Hi,<div><br></div><div>We noted that extension functions do not work = properly in Py3 on Win32. The problem is that the function name is = passed as a (unicode) str to Win32Platform.getExtensionProcedure = (which is a static method referring to OpenGL.wglGetProcAddress), = which is called from = BasePlatform.constructFunction</div><div><br></div><div>The solution is = of course to encode the the name, the question is where to do = this?</div><div><br></div><div>I expect that all platforms that use = getExtensionProcedure (those that = have self.EXTENSIONS_USE_BASE_FUNCTIONS=3D=3DFalse, = i.e. Win32, GLX, OSMESA) have a function that expects bytes, not = str. So I would propose to put</div><div> pointer =3D = self.getExtensionProcedure( as_8_bit(functionName) )</div><div>in = BasePlatform.constructFunction.</div><div><br></div><div>Should I go = ahead and implement this and create a pull request, or should this be = implemented somewhere = else?</div><div><br></div><div>Rob</div><div><br><div><div> <div style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; = -webkit-line-break: after-white-space; = "><div>---------------------------------------------<br>Rob Reilink, = M.Sc<br>Science Applied</div><div><br>phone: +31 6 187 = 26562<br>e-mail: <a = href=3D"mailto:[email protected]">[email protected]<= /a><br>---------------------------------------------</div><div><br></div><= /div><br class=3D"Apple-interchange-newline"><br = class=3D"Apple-interchange-newline"> </div> <br></div></div></body></html>= --Apple-Mail-5-735318812-- --===============1568256772780322970== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ --===============1568256772780322970== 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-Devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyopengl-devel --===============1568256772780322970==--