Re: Using PyopenGL with GLArea

Oly <[email protected]> Sun, 05 Mar 2017 17:29:48 +0000
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAPZowhygUPokN=tXVhKoEtoC-CaX5Vp22RVMpS056P-S=5GBFw@mail.gmail.com>
--===============6435622954220291115==
Content-Type: multipart/alternative; boundary=001a114b321ec904c40549ff20cd

--001a114b321ec904c40549ff20cd
Content-Type: text/plain; charset=UTF-8

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...> - 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
>
>

--001a114b321ec904c40549ff20cd
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Also because it maybe useful, i have this being repor=
ted by gtk / opengl.<br><br>Intel_Open_Source_Technology_Center_4.5_(Core_P=
rofile)_Mesa_17.0.0_-_padoka_PPA_Mesa_DRI_Intel(R)_Kabylake_GT2__4.50<br>Op=
enGL Version 4.5_(Core_Profile)_Mesa_17.0.0_-_padoka_PPA<br>OpenGL Renderer=
 Mesa_DRI_Intel(R)_Kabylake_GT2_<br>Shader Language version 4.50<br><br></d=
iv>so it looks like things should be new enough to support that feature und=
er wayland.<br><div><br></div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr">On Sun, 5 Mar 2017 at 17:28 Oly &lt;<a href=3D"mailto:olymk2@gmail=
.com">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_q=
uote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1e=
x"><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 cl=
ass=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 nvidi=
a graphics (optimus card) on x11 but if i am using wayland then i get the e=
rror above.<br class=3D"gmail_msg"><br class=3D"gmail_msg"></div>Not sure w=
hy 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 c=
ard related.<br class=3D"gmail_msg"><br class=3D"gmail_msg"></div>I did not=
 know about this trick PYOPENGL_PLATFORM=3D&quot;osmesa&quot; so thats usef=
ul 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_msg"></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 &lt;<a h=
ref=3D"mailto:[email protected]" class=3D"gmail_msg" target=3D"_bla=
nk">[email protected]</a>&gt; wrote:<br class=3D"gmail_msg"></div><=
blockquote class=3D"gmail_quote gmail_msg" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">I tried to have a look at your code=
, but I don&#39;t have the `gi&#39; package<br class=3D"gmail_msg">
on my machine, and `pip install gi&#39; can&#39;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&#39; , 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://mesamatri=
x.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"g=
mail_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 cl=
ass=3D"gmail_msg">
running this under Linux. You may want to look into running PyOpenGL<br cla=
ss=3D"gmail_msg">
under mesa, using one of their software renderers if for whatever<br class=
=3D"gmail_msg">
reason you don&#39;t have OpenGL3.0 support.<br class=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/Headless%20Rendered%20OpenGL%=
20Scenes.html" rel=3D"noreferrer" class=3D"gmail_msg" target=3D"_blank">htt=
p://www.mattikariluoma.com/blog/Headless%20Rendered%20OpenGL%20Scenes.html<=
/a><br class=3D"gmail_msg">
<br class=3D"gmail_msg">
&gt;From: Oliver Marks &lt;oly@di...&gt; - 2017-02-11 22:40:09<br class=3D"=
gmail_msg">
&gt;<br class=3D"gmail_msg">
&gt;Thought i would have a stab at trying to make this work, I cant find an=
y<br class=3D"gmail_msg">
&gt;existing working examples.<br class=3D"gmail_msg">
&gt;<br class=3D"gmail_msg">
&gt;I have linked a gist if any one want to try.<br class=3D"gmail_msg">
&gt;<br class=3D"gmail_msg">
&gt;currently I am getting this error.<br class=3D"gmail_msg">
&gt;<br class=3D"gmail_msg">
&gt;OpenGL.error.NullFunctionError: Attempt to call an undefined function<b=
r class=3D"gmail_msg">
&gt;glGenVertexArrays, check for bool(glGenVertexArrays) before calling<br =
class=3D"gmail_msg">
&gt;<br class=3D"gmail_msg">
&gt;Which to me sounds like its not available to the context, GLArea is<br =
class=3D"gmail_msg">
&gt;supplying the context so i am unsure why this would be ?<br class=3D"gm=
ail_msg">
&gt;<br class=3D"gmail_msg">
&gt;Any ideas or can anyone give me some pointers ?<br class=3D"gmail_msg">
&gt;<br class=3D"gmail_msg">
&gt;<a href=3D"https://gist.github.com/olymk2/5b3e49ac83130e580bd9983f2e5d4=
9c3" rel=3D"noreferrer" class=3D"gmail_msg" target=3D"_blank">https://gist.=
github.com/olymk2/5b3e49ac83130e580bd9983f2e5d49c3</a><br class=3D"gmail_ms=
g">
&gt;<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&#39;s most<br clas=
s=3D"gmail_msg">
engaging tech sites, SlashDot.org! <a href=3D"http://sdm.link/slashdot" rel=
=3D"noreferrer" class=3D"gmail_msg" target=3D"_blank">http://sdm.link/slash=
dot</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"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></blockquote></div>

--001a114b321ec904c40549ff20cd--


--===============6435622954220291115==
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
--===============6435622954220291115==
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

--===============6435622954220291115==--