Re: [PyOpenGL-Users] Using PyopenGL with GLArea
Brought to you by:
mcfletch
From: Stuart A. <st...@ya...> - 2017-03-08 15:58:32
|
Hi, Just a note on 'gi'. These are the 'Gobject' (Gtk) bindings for python, and give you access to all the different 'GLib/GObject/Gtk' APIs. https://wiki.gnome.org/Projects/PyGObject How you install it, depends on your platform. If you are on Linux, then your system python will already have it, if you have installed something like python-gi or python3-gi. If you are on a mac then, homebrew and other methods work, Windows is the most difficult to get working, but is possible. If you want to use pytho-gi from within a virtualenv you can install 'vext.gi'* from pypi. Vext lets the python in the virtualenv access these modules in the system python. *Disclaimer - I am the author of vext + made it to make using virtualenv + Gtk easier. https://pypi.python.org/pypi/vext.gi S++ On Wednesday, March 8, 2017 3:25 PM, Matti Kariluoma <mat...@gm...> 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 <ol...@gm...> 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 <ol...@gm...> 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 <mat...@gm...> 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...> - 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 PyO...@li... 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 PyO...@li... https://lists.sourceforge.net/lists/listinfo/pyopengl-users |