Re: Using PyopenGL with GLArea
Oliver Marks <[email protected]> Tue, 14 Mar 2017 18:15:30 +0000
| Newsgroups | gmane.comp.python.opengl.user |
|---|---|
| Message-ID | <CACvA_Fc6TmeR7Q3PPBM_48ZmG5ucqc0fSwUJSv31yRgyt8YeUQ@mail.gmail.com> |
--===============3127275147455505194== Content-Type: multipart/alternative; boundary=001a113ca050ce3c89054ab4d0ca --001a113ca050ce3c89054ab4d0ca Content-Type: text/plain; charset=UTF-8 fantastic thanks for spending the time on that Matti, it works perfectly on my system I will play around and adapt it to my own program and try out your suggestions and see what i come up with :) On Sat, Mar 11, 2017 at 5:15 PM Matti Kariluoma <[email protected]> wrote: > I forked your gist: > https://gist.github.com/matti-kariluoma/7786a620abe87deb54c6012b07ded884 > > I added error-checking to work around the errors I encountered, and placed > a print-statement to show how to check which PyOpenGL Platform is loaded at > runtime. > > When I tried to run either gist on my Nvidia+Debian laptop (pyopengl > 3.0.2), the program crashed immediately with an error similar to: > http://askubuntu.com/questions/175744/x-error-of-failed-request-badrequest-invalid-request-code-or-no-such-operation > When I tried to run your gist on my Intel+Ubuntu 16.10 machine, your gist > gives the errors you described. After making my changes, my gist displayed > a red triangle with platforms "linux2" and "posix". > > == > > > > I just dont 100% get why i need to prefix I would not want to tell a > user they need todo that > > PYOPENGL_PLATFORM allows one codebase to support osx, windows, and various > linux flavors. A platform is selected at runtime to simplify the > distribution of PyOpenGL. Some platforms implement things differently- > there will always be bugs or missing functionality when running on > different platforms. Avoid the use of `from X import *' to make your code > more likely to run on a different platform. Instead of: > from OpenGL.GLUT import * > glutInit([]) > ...try: > from OpenGL import GLUT as glut > glut.glutInit([]) > ... you'd be surprised how much this helps platform portability. > > Each of the platforms has various dependencies that are not installed when > you get pyopengl from source or pip, however the system package manager > (apt) will download the dependencies automatically (e.g. freeglut3, etc.) > for your system's recommended platform. Some of the "optional" platforms > (osmesa, egl) do not have packages in apt, so you'll need to install the > dependencies yourself. This becomes very complicated when you use external > PPAs, or build your own drivers and libraries! > > Hint: Use strace to see which drivers/libraries are being used by your > process, to ensure you are using the drivers/libraries you intend: > $ strace python glutexample.py 2>&1 | grep open > == > > > >is there a way i can detect the profiles and select the best on startup ? > > You can choose between PyOpenGL platforms at runtime by setting > `os.environ' in your code: > import os > os.environ['PYOPENGL_PLATFORM'] = 'posix' > import OpenGL > > ...you /should/ be able to use the `reload' function ( > http://stackoverflow.com/questions/437589/how-do-i-unload-reload-a-python-module) > to choose a different platform at runtime: > import os > os.environ['PYOPENGL_PLATFORM'] = 'posix' > import OpenGL > # check if we have the features we want, if not... > if reload_opengl_platform: > os.environ['PYOPENGL_PLATFORM'] = 'osmesa' > reload(OpenGL) > > I did not test the`reload' code above, your results may vary. > > > On 3/9/17 1:57 PM, Oliver Marks wrote: > > I am not sure if this is an issue now there are a few things I have > noticed it occurs when using osmesa on x11 and wayland. > > I can now run it on both with x11 it just works in wayland if i prefix > PYOPENGL_PLATFORM = "EGL" then it works. > > I am using ubuntu 16.10 and python-gobject 3.22.0-1 from the repository. > > > PYOPENGL_PLATFORM = "EGL" > > I have a gi gtkglarea example on stack overflow > http://stackoverflow.com/questions/42185728/why-is-glgenvertexarrays-undefined-in-pyopengl-when-using-gtkglarea > . > > > Tried to use Glut which i have never used before but that seems to be a > world of pain and brings up new errors :/ > > - using EGL NotImplementedError: Platform does not define a GLUT font > retrieval function > - using osmesa gives me TypeError: unhashable type contextdata.py", line > 106, in getValue > - using glx gives me glGenVertexArrays(1) this function takes at least 2 > arguments (1 given) > > This is where i got to with the code but it could be completely wrong as > you don't seem to manage context in the same way but i did not find many > glut examples most see to use pygame. > > https://gist.github.com/olymk2/b156f7490e3f5662e2fa0cf42b8c7c63 > > > Anyway my code kind of works I just dont 100% get why i need to prefix I > would not want to tell a user they need todo that, so is there a way i can > detect the profiles and select the best on startup > > > > > > > > > On Wed, Mar 8, 2017 at 3:25 PM Matti Kariluoma <[email protected]> > wrote: > > I will take a look on Saturday. > > 1) In the meantime, could you create a minimal example that demonstrates > the problem? > > Its always very interesting to see simple-looking code that works on some > platforms but doesn't work on others; we just had an example of such two > weeks ago from another user. > > Ideally your minimal example would not involve the use of the `gi' module, > or at the very least, include instructions to bring a fresh installation up > with that package installed, i.e. "sudo apt-get install ..." > > 2) Does your problem require `gi' for this error to show? > > 3) Is the error reproducible under GLUT or GLFW? > > 4) If (2), what steps are needed to install `gi', and what version of `gi'? > On 3/5/17 12:49 PM, Oly wrote: > > Just another thing of note, > > using PYOPENGL_PLATFORM = "osmesa" with x11 causes the same issue, so it > would appear related to the mesa drivers. > > What other options can that take, can i enforce nvidia or intel instead of > osmesa ? > > perhaps wayland is defaulting to mesa and x11 is using something else. > > feels like i am getting nearer to a solution, or at least a work around. > > > > On Sun, 5 Mar 2017 at 17:29 Oly <[email protected]> wrote: > > Also because it maybe useful, i have this being reported by gtk / opengl. > > > Intel_Open_Source_Technology_Center_4.5_(Core_Profile)_Mesa_17.0.0_-_padoka_PPA_Mesa_DRI_Intel(R)_Kabylake_GT2__4.50 > OpenGL Version 4.5_(Core_Profile)_Mesa_17.0.0_-_padoka_PPA > OpenGL Renderer Mesa_DRI_Intel(R)_Kabylake_GT2_ > Shader Language version 4.50 > > so it looks like things should be new enough to support that feature under > wayland. > > > On Sun, 5 Mar 2017 at 17:28 Oly <[email protected]> wrote: > > Thanks for the offer not sure how i missed your reply. > > Anyway i made some progress, yes my issue is with linux and gtk > specifically I have also found out it has something todo with wayland. > > Running the example i can get it to work with my intel and nvidia graphics > (optimus card) on x11 but if i am using wayland then i get the error above. > > Not sure why wayland would effect what available to me anyone seen > anything similar ? > > Seems it i graphics card related. > > I did not know about this trick PYOPENGL_PLATFORM="osmesa" so thats useful > to know but it does not help unfortunately. > > > On Sun, 12 Feb 2017 at 20:20 Matti Kariluoma <[email protected]> > wrote: > > I tried to have a look at your code, but I don't have the `gi' package > on my machine, and `pip install gi' can't find it either. > > 1) Would you accept help in the form of a program that starts with > `from OpenGL import GLUT' , or does your problem require gi? > > As for the error you posted, looking at https://mesamatrix.net/ I see > that glGenVertexArrays is a part of OpenGL 3.0, extension > GL_ARB_vertex_array_object which seems to have broad support. > > 2) Maybe your graphics device (or its driver) is ancient? > > Since your gist seems to indicate you are using GTK, I assume you are > running this under Linux. You may want to look into running PyOpenGL > under mesa, using one of their software renderers if for whatever > reason you don't have OpenGL3.0 support. > > Using the mesa CPU renderer under Linux: > > http://www.mattikariluoma.com/blog/Headless%20Rendered%20OpenGL%20Scenes.html > > >From: Oliver Marks <oly@di...> <oly@di...> - 2017-02-11 22:40:09 > > > >Thought i would have a stab at trying to make this work, I cant find any > >existing working examples. > > > >I have linked a gist if any one want to try. > > > >currently I am getting this error. > > > >OpenGL.error.NullFunctionError: Attempt to call an undefined function > >glGenVertexArrays, check for bool(glGenVertexArrays) before calling > > > >Which to me sounds like its not available to the context, GLArea is > >supplying the context so i am unsure why this would be ? > > > >Any ideas or can anyone give me some pointers ? > > > >https://gist.github.com/olymk2/5b3e49ac83130e580bd9983f2e5d49c3 > > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > ------------------------------------------------------------------------------ > Announcing the Oxford Dictionaries API! The API offers world-renowned > dictionary content that is easy and intuitive to access. Sign up for an > account today to start using our lexical data to power your apps and > projects. Get started today and enter our developer competition. > http://sdm.link/oxford_______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > ------------------------------------------------------------------------------ > Announcing the Oxford Dictionaries API! The API offers world-renowned > dictionary content that is easy and intuitive to access. Sign up for an > account today to start using our lexical data to power your apps and > projects. Get started today and enter our developer competition. > http://sdm.link/oxford_______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > --001a113ca050ce3c89054ab4d0ca Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>fantastic thanks for spending the time on that Matti,= it works perfectly on my system I will play around and adapt it to my own = program and try out your suggestions and see what i come up with :)<br></di= v></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Sat, Mar 11, 201= 7 at 5:15 PM Matti Kariluoma <<a href=3D"mailto:[email protected]= m">[email protected]</a>> wrote:<br></div><blockquote class=3D"g= mail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-l= eft:1ex"> =20 =20 =20 <div bgcolor=3D"#FFFFFF" text=3D"#000000" class=3D"gmail_msg"> <p class=3D"gmail_msg">I forked your gist: <a class=3D"m_8809690260484801899moz-txt-link-freetext gmail_msg" hre= f=3D"https://gist.github.com/matti-kariluoma/7786a620abe87deb54c6012b07ded8= 84" target=3D"_blank">https://gist.github.com/matti-kariluoma/7786a620abe87= deb54c6012b07ded884</a></p> <p class=3D"gmail_msg">I added error-checking to work around the errors= I encountered, and placed a print-statement to show how to check which PyOpenGL Platform is loaded at runtime.<br class=3D"gmail_msg"> </p> <p class=3D"gmail_msg">When I tried to run either gist on my Nvidia+Deb= ian laptop (pyopengl 3.0.2), the program crashed immediately with an error similar to: <a class=3D"m_8809690260484801899moz-txt-link-freetext gmail_msg" href=3D"h= ttp://askubuntu.com/questions/175744/x-error-of-failed-request-badrequest-i= nvalid-request-code-or-no-such-operation" target=3D"_blank">http://askubunt= u.com/questions/175744/x-error-of-failed-request-badrequest-invalid-request= -code-or-no-such-operation</a><br class=3D"gmail_msg"> </p> <div class=3D"m_8809690260484801899moz-cite-prefix gmail_msg">When I tr= ied to run your gist on my Intel+Ubuntu 16.10 machine, your gist gives the errors you described. After making my changes, my gist displayed a red triangle with platforms "linux2" and "posix".<br = class=3D"gmail_msg"> <br class=3D"gmail_msg"> =3D=3D</div></div><div bgcolor=3D"#FFFFFF" text=3D"#000000" class=3D"= gmail_msg"><div class=3D"m_8809690260484801899moz-cite-prefix gmail_msg"><b= r class=3D"gmail_msg"> <br class=3D"gmail_msg"> > I just dont 100% get why i need to prefix I would not want to tell a user they need todo that<br class=3D"gmail_msg"> <br class=3D"gmail_msg"></div></div><div bgcolor=3D"#FFFFFF" text=3D"= #000000" class=3D"gmail_msg"><div class=3D"m_8809690260484801899moz-cite-pr= efix gmail_msg"> PYOPENGL_PLATFORM allows one codebase to support osx, windows, and various linux flavors. A platform is selected at runtime to simplify the distribution of PyOpenGL. Some platforms implement things differently- there will always be bugs or missing functionality when running on different platforms. Avoid the use of `from X import *' to make your code more likely to run on a different platform. Instead of:<br class=3D"gmail_msg"> =C2=A0 from OpenGL.GLUT import *<br class=3D"gmail_msg"> =C2=A0 glutInit([])<br class=3D"gmail_msg"> ...try:<br class=3D"gmail_msg"> =C2=A0 from OpenGL import GLUT as glut<br class=3D"gmail_msg"> =C2=A0 glut.glutInit([])<br class=3D"gmail_msg"> ... you'd be surprised how much this helps platform portability.<= br class=3D"gmail_msg"> <br class=3D"gmail_msg"> Each of the platforms has various dependencies that are not installed when you get pyopengl from source or pip, however the system package manager (apt) will download the dependencies automatically (e.g. freeglut3, etc.) for your system's recommende= d platform. Some of the "optional" platforms (osmesa, egl) do= not have packages in apt, so you'll need to install the dependencies yourself. This becomes very complicated when you use external PPAs, or build your own drivers and libraries!<br class=3D"gmail_msg"= > <br class=3D"gmail_msg"> Hint: Use strace to see which drivers/libraries are being used by your process, to ensure you are using the drivers/libraries you intend:<br class=3D"gmail_msg"> =C2=A0 $ strace python glutexample.py 2>&1 | grep open<br clas= s=3D"gmail_msg"> =3D=3D</div></div><div bgcolor=3D"#FFFFFF" text=3D"#000000" class=3D"= gmail_msg"><div class=3D"m_8809690260484801899moz-cite-prefix gmail_msg"><b= r class=3D"gmail_msg"> <br class=3D"gmail_msg"> >is there a way i can detect the profiles and select the best on startup ?<br class=3D"gmail_msg"> <br class=3D"gmail_msg"></div></div><div bgcolor=3D"#FFFFFF" text=3D"= #000000" class=3D"gmail_msg"><div class=3D"m_8809690260484801899moz-cite-pr= efix gmail_msg"> You can choose between PyOpenGL platforms at runtime by setting `os.environ' in your code:<br class=3D"gmail_msg"> =C2=A0 import os<br class=3D"gmail_msg"> =C2=A0 os.environ['PYOPENGL_PLATFORM'] =3D 'posix'<br= class=3D"gmail_msg"> =C2=A0 import OpenGL<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> ...you /should/ be able to use the `reload' function (<a class=3D"m_8809690260484801899moz-txt-link-freetext gmail_msg" href=3D"= http://stackoverflow.com/questions/437589/how-do-i-unload-reload-a-python-m= odule" target=3D"_blank">http://stackoverflow.com/questions/437589/how-do-i= -unload-reload-a-python-module</a>) to choose a different platform at runtime:<br class=3D"gmail_msg"> =C2=A0 import os<br class=3D"gmail_msg"> =C2=A0 os.environ['PYOPENGL_PLATFORM'] =3D 'posix'<br= class=3D"gmail_msg"> =C2=A0 import OpenGL<br class=3D"gmail_msg"> =C2=A0 # check if we have the features we want, if not...<br class=3D= "gmail_msg"> =C2=A0 if reload_opengl_platform:<br class=3D"gmail_msg"> =C2=A0=C2=A0=C2=A0 os.environ['PYOPENGL_PLATFORM'] =3D 'o= smesa'<br class=3D"gmail_msg"> =C2=A0=C2=A0=C2=A0 reload(OpenGL)<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> I did not test the`reload' code above, your results may vary.</di= v></div><div bgcolor=3D"#FFFFFF" text=3D"#000000" class=3D"gmail_msg"><div = class=3D"m_8809690260484801899moz-cite-prefix gmail_msg"><br class=3D"gmail= _msg"> <br class=3D"gmail_msg"> On 3/9/17 1:57 PM, Oliver Marks wrote:<br class=3D"gmail_msg"> </div></div><div bgcolor=3D"#FFFFFF" text=3D"#000000" class=3D"gmail_ms= g"><blockquote type=3D"cite" class=3D"gmail_msg"> <div dir=3D"ltr" class=3D"gmail_msg"> <div class=3D"gmail_msg"> <div class=3D"gmail_msg"> <div class=3D"gmail_msg">I am not sure if this is an issue now = there are a few things I have noticed it occurs when using osmesa on x11 and wayland.<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> </div> I can now run it on both with x11 it just works in wayland if i prefix PYOPENGL_PLATFORM =3D "EGL" then it works= .<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> </div> I am using ubuntu 16.10 and python-gobject 3.22.0-1 from the repository.<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> <br class=3D"gmail_msg"> PYOPENGL_PLATFORM =3D "EGL"<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> </div> I have a gi gtkglarea example on stack overflow <a href=3D"http://s= tackoverflow.com/questions/42185728/why-is-glgenvertexarrays-undefined-in-p= yopengl-when-using-gtkglarea" class=3D"gmail_msg" target=3D"_blank">http://= stackoverflow.com/questions/42185728/why-is-glgenvertexarrays-undefined-in-= pyopengl-when-using-gtkglarea</a>.<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> <br class=3D"gmail_msg"> <div class=3D"gmail_msg">Tried to use Glut which i have never used = before but that seems to be a world of pain and brings up new errors :/<br class= =3D"gmail_msg"> <br class=3D"gmail_msg"> </div> <div class=3D"gmail_msg">- using EGL NotImplementedError: Platform = does not define a GLUT font retrieval function<br class=3D"gmail_msg"> </div> <div class=3D"gmail_msg">- using osmesa gives me TypeError: unhasha= ble type contextdata.py", line 106, in getValue<br class=3D"gmail_msg= "> </div> <div class=3D"gmail_msg">- using glx gives me glGenVertexArrays(1) = this function takes at least 2 arguments (1 given)<br class=3D"gmail_msg"> </div> <div class=3D"gmail_msg"><br class=3D"gmail_msg"> This is where i got to with the code but it could be completely wrong as you don't seem to manage context in the same way but i did not find many glut examples most see to use pygame.<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> <a href=3D"https://gist.github.com/olymk2/b156f7490e3f5662e2fa0cf= 42b8c7c63" class=3D"gmail_msg" target=3D"_blank">https://gist.github.com/ol= ymk2/b156f7490e3f5662e2fa0cf42b8c7c63</a><br class=3D"gmail_msg"> </div> <div class=3D"gmail_msg"><br class=3D"gmail_msg"> <br class=3D"gmail_msg"> </div> <div class=3D"gmail_msg">Anyway my code kind of works I just dont 1= 00% get why i need to prefix I would not want to tell a user they need todo that, so is there a way i can detect the profiles and select the best on startup=C2=A0 =20 </div> <div class=3D"gmail_msg"><br class=3D"gmail_msg"> <br class=3D"gmail_msg"> <br class=3D"gmail_msg"> <br class=3D"gmail_msg"> <br class=3D"gmail_msg"> <div class=3D"gmail_msg"><br class=3D"gmail_msg"> <div class=3D"gmail_msg"><br class=3D"gmail_msg"> </div> </div> </div> </div> <br class=3D"gmail_msg"> </blockquote></div><div bgcolor=3D"#FFFFFF" text=3D"#000000" class=3D= "gmail_msg"><blockquote type=3D"cite" class=3D"gmail_msg"><div class=3D"gma= il_quote gmail_msg"> <div dir=3D"ltr" class=3D"gmail_msg">On Wed, Mar 8, 2017 at 3:25 PM= Matti Kariluoma <<a href=3D"mailto:[email protected]" class=3D"gmail_m= sg" target=3D"_blank">[email protected]</a>> wrote:<br class=3D"gmail_msg"> </div> <blockquote class=3D"gmail_quote gmail_msg" style=3D"margin:0 0 0 .= 8ex;border-left:1px #ccc solid;padding-left:1ex"> <div bgcolor=3D"#FFFFFF" text=3D"#000000" class=3D"gmail_msg"> <p class=3D"gmail_msg">I will take a look on Saturday.</p> <p class=3D"gmail_msg">1) In the meantime, could you create a minimal example that demonstrates the problem? <br class=3D"g= mail_msg"> </p> <p class=3D"gmail_msg">Its always very interesting to see simple-looking code that works on some platforms but doesn't work on others; we just had an example of such tw= o weeks ago from another user.<br class=3D"gmail_msg"> </p> <p class=3D"gmail_msg">Ideally your minimal example would not involve the use of the `gi' module, or at the very least, include instructions to bring a fresh installation up with that package installed, i.e. "sudo apt-get install ...&q= uot; <br class=3D"gmail_msg"> </p> <p class=3D"gmail_msg">2) Does your problem require `gi' fo= r this error to show? <br class=3D"gmail_msg"> </p> <p class=3D"gmail_msg">3) Is the error reproducible under GLUT or GLFW?<br class=3D"gmail_msg"> </p> <p class=3D"gmail_msg">4) If (2), what steps are needed to install `gi', and what version of `gi'?<br class=3D"g= mail_msg"> </p> </div> <div bgcolor=3D"#FFFFFF" text=3D"#000000" class=3D"gmail_msg"> <div class=3D"m_8809690260484801899m_-5089312650406477093moz-ci= te-prefix gmail_msg">On 3/5/17 12:49 PM, Oly wrote:<br class=3D"gmail_msg"> </div> <blockquote type=3D"cite" class=3D"gmail_msg"> <div dir=3D"ltr" class=3D"gmail_msg">Just another thing of note,<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> using PYOPENGL_PLATFORM =3D "osmesa" with x11 cau= ses the same issue, so it would appear related to the mesa drivers.<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> What other options can that take, can i enforce nvidia or intel instead of osmesa ? <br class=3D"gmail_msg"> <br class=3D"gmail_msg"> perhaps wayland is defaulting to mesa and x11 is using something else.<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> feels like i am getting nearer to a solution, or at least a work around.<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> <br class=3D"gmail_msg"> </div> <br class=3D"gmail_msg"> <div class=3D"gmail_quote gmail_msg"> <div dir=3D"ltr" class=3D"gmail_msg">On Sun, 5 Mar 2017 at 17:29 Oly <<a href=3D"mailto:[email protected]" class= =3D"gmail_msg" target=3D"_blank">[email protected]</a>> wrote:<br class= =3D"gmail_msg"> </div> <blockquote class=3D"gmail_quote gmail_msg" style=3D"margin= :0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div dir=3D"ltr" class=3D"gmail_msg"> <div class=3D"gmail_msg">Also because it maybe useful, i have this being reported by gtk / opengl.<br class= =3D"gmail_msg"> <br class=3D"gmail_msg"> Intel_Open_Source_Technology_Center_4.5_(Core_Profile)_Mesa_17.0.0_-_padoka= _PPA_Mesa_DRI_Intel(R)_Kabylake_GT2__4.50<br class=3D"gmail_msg"> OpenGL Version 4.5_(Core_Profile)_Mesa_17.0.0_-_padoka_PPA<br class= =3D"gmail_msg"> OpenGL Renderer Mesa_DRI_Intel(R)_Kabylake_GT2_<br cl= ass=3D"gmail_msg"> Shader Language version 4.50<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> </div> so it looks like things should be new enough to support that feature under wayland.<br class=3D"gmail_m= sg"> <div class=3D"gmail_msg"><br class=3D"gmail_msg"> </div> </div> <br class=3D"gmail_msg"> <div class=3D"gmail_quote gmail_msg"> <div dir=3D"ltr" class=3D"gmail_msg">On Sun, 5 Mar 2017 at 17:28 Oly <<a href=3D"mailto:[email protected]" = class=3D"gmail_msg" target=3D"_blank">[email protected]</a>> wrote:<br cl= ass=3D"gmail_msg"> </div> <blockquote class=3D"gmail_quote gmail_msg" style=3D"ma= rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div dir=3D"ltr" class=3D"gmail_msg"> <div class=3D"gmail_msg"> <div class=3D"gmail_msg"> <div class=3D"gmail_msg"> <div class=3D"gmail_msg"> <div class=3D"gmail_msg">Thanks for the offer not sure how i missed your reply.<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> </div> Anyway i made some progress, yes my issue is with linux and gtk specifically I have also found out it has something todo with wayland.<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> </div> Running the example i can get it to work with my intel and nvidia graphics (optimus card) on x11 but if i am using wayland then i get the error above.<br class=3D"gmail= _msg"> <br class=3D"gmail_msg"> </div> Not sure why wayland would effect what available to me anyone seen anything similar ?<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> </div> Seems it i graphics card related.<br class=3D"gma= il_msg"> <br class=3D"gmail_msg"> </div> I did not know about this trick PYOPENGL_PLATFORM=3D"osmesa" so thats use= ful to know but it does not help unfortunately.<br class= =3D"gmail_msg"> <div class=3D"gmail_msg"> <div class=3D"gmail_msg"> <div class=3D"gmail_msg"> <div class=3D"gmail_msg"><br class=3D"gmail_m= sg"> </div> </div> </div> </div> </div> <br class=3D"gmail_msg"> <div class=3D"gmail_quote gmail_msg"> <div dir=3D"ltr" class=3D"gmail_msg">On Sun, 12 Feb 2017 at 20:20 Matti Kariluoma <<a href=3D"mail= to:[email protected]" class=3D"gmail_msg" target=3D"_blank">matti.k= [email protected]</a>> wrote:<br class=3D"gmail_msg"> </div> <blockquote class=3D"gmail_quote gmail_msg" style= =3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I tried = to have a look at your code, but I don't have the `gi' package<br class=3D"gmail_msg"> on my machine, and `pip install gi' can't= find it either.<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> 1) Would you accept help in the form of a program that starts with<br class=3D"gmail_msg"> `from OpenGL import GLUT' , or does your problem require gi?<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> As for the error you posted, looking at <a href= =3D"https://mesamatrix.net/" rel=3D"noreferrer" class=3D"gmail_msg" target= =3D"_blank">https://mesamatrix.net/</a> I see<br class=3D"gmail_msg"> that glGenVertexArrays is a part of OpenGL 3.0, extension<br class=3D"gmail_msg"> GL_ARB_vertex_array_object which seems to have broad support.<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> 2) Maybe your graphics device (or its driver) is ancient?<br class=3D"gmail_msg"> <br class=3D"gmail_msg"> Since your gist seems to indicate you are using GTK, I assume you are<br class=3D"gmail_msg= "> running this under Linux. You may want to look into running PyOpenGL<br class=3D"gmail_msg"> under mesa, using one of their software renderers if for whatever<br class=3D"gmail_msg"> reason you don't have OpenGL3.0 support.<br c= lass=3D"gmail_msg"> <br class=3D"gmail_msg"> Using the mesa CPU renderer under Linux:<br class= =3D"gmail_msg"> <a href=3D"http://www.mattikariluoma.com/blog/Hea= dless%20Rendered%20OpenGL%20Scenes.html" rel=3D"noreferrer" class=3D"gmail_= msg" target=3D"_blank">http://www.mattikariluoma.com/blog/Headless%20Render= ed%20OpenGL%20Scenes.html</a><br class=3D"gmail_msg"> <br class=3D"gmail_msg"> >From: Oliver Marks <a class=3D"m_880969026048= 4801899m_-5089312650406477093moz-txt-link-rfc2396E gmail_msg" href=3D"mailt= o:oly@di..." target=3D"_blank"><oly@di...></a> - 2017-02-11 22:40:09<br class=3D"gmail_msg"> ><br class=3D"gmail_msg"> >Thought i would have a stab at trying to make this work, I cant find any<br class=3D"gmail= _msg"> >existing working examples.<br class=3D"gmail_= msg"> ><br class=3D"gmail_msg"> >I have linked a gist if any one want to try.<br class=3D"gmail_msg"> ><br class=3D"gmail_msg"> >currently I am getting this error.<br class= =3D"gmail_msg"> ><br class=3D"gmail_msg"> >OpenGL.error.NullFunctionError: Attempt to call an undefined function<br class=3D"gmail_msg"= > >glGenVertexArrays, check for bool(glGenVertexArrays) before calling<br class= =3D"gmail_msg"> ><br class=3D"gmail_msg"> >Which to me sounds like its not available to the context, GLArea is<br class=3D"gmail_msg"> >supplying the context so i am unsure why this would be ?<br class=3D"gmail_msg"> ><br class=3D"gmail_msg"> >Any ideas or can anyone give me some pointers ?<br class=3D"gmail_msg"> ><br class=3D"gmail_msg"> ><a href=3D"https://gist.github.com/olymk2/5b3= e49ac83130e580bd9983f2e5d49c3" rel=3D"noreferrer" class=3D"gmail_msg" targe= t=3D"_blank">https://gist.github.com/olymk2/5b3e49ac83130e580bd9983f2e5d49c= 3</a><br class=3D"gmail_msg"> ><br class=3D"gmail_msg"> <br class=3D"gmail_msg"> ---------------------------------------------------------------------------= ---<br class=3D"gmail_msg"> Check out the vibrant tech community on one of the world's most<br class=3D"gmail_msg"> engaging tech sites, SlashDot.org! <a href=3D"htt= p://sdm.link/slashdot" rel=3D"noreferrer" class=3D"gmail_msg" target=3D"_bl= ank">http://sdm.link/slashdot</a><br class=3D"gmail_msg"> _______________________________________________<br class=3D"gmail_msg"> PyOpenGL Homepage<br class=3D"gmail_msg"> <a href=3D"http://pyopengl.sourceforge.net" rel= =3D"noreferrer" class=3D"gmail_msg" target=3D"_blank">http://pyopengl.sourc= eforge.net</a><br class=3D"gmail_msg"> _______________________________________________<br class=3D"gmail_msg"> PyOpenGL-Users mailing list<br class=3D"gmail_msg= "> <a href=3D"mailto:[email protected]= e.net" class=3D"gmail_msg" target=3D"_blank">[email protected]= ge.net</a><br class=3D"gmail_msg"> <a href=3D"https://lists.sourceforge.net/lists/li= stinfo/pyopengl-users" rel=3D"noreferrer" class=3D"gmail_msg" target=3D"_bl= ank">https://lists.sourceforge.net/lists/listinfo/pyopengl-users</a><br cla= ss=3D"gmail_msg"> </blockquote> </div> </blockquote> </div> </blockquote> </div> </blockquote> <br class=3D"gmail_msg"> </div> ---------------------------------------------------------------------------= ---<br class=3D"gmail_msg"> Announcing the Oxford Dictionaries API! The API offers world-renowned<br class=3D"gmail_msg"> dictionary content that is easy and intuitive to access. Sign up for an<br class=3D"gmail_msg"> account today to start using our lexical data to power your apps and<br class=3D"gmail_msg"> projects. Get started today and enter our developer competition.<br class=3D"gmail_msg"> <a href=3D"http://sdm.link/oxford" rel=3D"noreferrer" class=3D"gm= ail_msg" target=3D"_blank">http://sdm.link/oxford</a>______________________= _________________________<br class=3D"gmail_msg"> PyOpenGL Homepage<br class=3D"gmail_msg"> <a href=3D"http://pyopengl.sourceforge.net" rel=3D"noreferrer" cl= ass=3D"gmail_msg" target=3D"_blank">http://pyopengl.sourceforge.net</a><br = class=3D"gmail_msg"> _______________________________________________<br class=3D"gmail= _msg"> PyOpenGL-Users mailing list<br class=3D"gmail_msg"> <a href=3D"mailto:[email protected]" class=3D"= gmail_msg" target=3D"_blank">[email protected]</a><br cl= ass=3D"gmail_msg"> <a href=3D"https://lists.sourceforge.net/lists/listinfo/pyopengl-= users" rel=3D"noreferrer" class=3D"gmail_msg" target=3D"_blank">https://lis= ts.sourceforge.net/lists/listinfo/pyopengl-users</a><br class=3D"gmail_msg"= > </blockquote> </div> </blockquote></div> ---------------------------------------------------------------------------= ---<br class=3D"gmail_msg"> Announcing the Oxford Dictionaries API! The API offers world-renowned<br cl= ass=3D"gmail_msg"> dictionary content that is easy and intuitive to access. Sign up for an<br = class=3D"gmail_msg"> account today to start using our lexical data to power your apps and<br cla= ss=3D"gmail_msg"> projects. Get started today and enter our developer competition.<br class= =3D"gmail_msg"> <a href=3D"http://sdm.link/oxford" rel=3D"noreferrer" class=3D"gmail_msg" t= arget=3D"_blank">http://sdm.link/oxford</a>________________________________= _______________<br class=3D"gmail_msg"> PyOpenGL Homepage<br class=3D"gmail_msg"> <a href=3D"http://pyopengl.sourceforge.net" rel=3D"noreferrer" class=3D"gma= il_msg" target=3D"_blank">http://pyopengl.sourceforge.net</a><br class=3D"g= mail_msg"> _______________________________________________<br class=3D"gmail_msg"> PyOpenGL-Users mailing list<br class=3D"gmail_msg"> <a href=3D"mailto:[email protected]" class=3D"gmail_msg"= target=3D"_blank">[email protected]</a><br class=3D"gma= il_msg"> <a href=3D"https://lists.sourceforge.net/lists/listinfo/pyopengl-users" rel= =3D"noreferrer" class=3D"gmail_msg" target=3D"_blank">https://lists.sourcef= orge.net/lists/listinfo/pyopengl-users</a><br class=3D"gmail_msg"> </blockquote></div> --001a113ca050ce3c89054ab4d0ca-- --===============3127275147455505194== 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 --===============3127275147455505194== 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 --===============3127275147455505194==--