Merge lp:~mcfletch/python-examples/fixes into lp:~oly/python-examples/trunk

Proposed by Mike C. Fletcher
Status: Merged
Approved by: Oliver Marks
Approved revision: 4
Merge reported by: Oliver Marks
Merged at revision: not available
Proposed branch: lp:~mcfletch/python-examples/fixes
Merge into: lp:~oly/python-examples/trunk
Diff against target: 14 lines (+4/-1)
1 file modified
python-examples/gtk3/tut15/tut15-opengl-touch-app-01.py (+4/-1)
To merge this branch: bzr merge lp:~mcfletch/python-examples/fixes
Reviewer Review Type Date Requested Status
Oliver Marks Approve
Review via email: mp+222326@code.launchpad.net

Commit message

Trivial fix to allow import of the GLX structure on 3.1.

Description of the change

Trivial fix to allow import of the GLX structure on 3.1. Can't test beyond that as the glade GUI doesn't run on my Kubuntu machine.

To post a comment you must log in.
Revision history for this message
Oliver Marks (oly) wrote :

Thanks for the suggestion i will have a look later and change it to use the
none raw struct maybe that will fix it.
I have got it working now but i dont understand the why exactly.

Basically turning on double buffering in the glx context makes the zbuffer
work so its like single buffered displays dont have a z buffer for the
depth.

Thanks for taking a look though :)

On Fri, Jun 6, 2014 at 3:05 PM, Mike C. Fletcher <email address hidden>
wrote:

> Mike C. Fletcher has proposed merging lp:~mcfletch/python-examples/fixes
> into lp:~oly/python-examples/trunk.
>
> Requested reviews:
> Oliver Marks (oly)
>
> For more details, see:
> https://code.launchpad.net/~mcfletch/python-examples/fixes/+merge/222326
>
> Trivial fix to allow import of the GLX structure on 3.1. Can't test beyond
> that as the glade GUI doesn't run on my Kubuntu machine.
> --
> https://code.launchpad.net/~mcfletch/python-examples/fixes/+merge/222326
> You are requested to review the proposed merge of
> lp:~mcfletch/python-examples/fixes into lp:~oly/python-examples/trunk.
>
> === modified file 'python-examples/gtk3/tut15/tut15-opengl-touch-app-01.py'
> --- python-examples/gtk3/tut15/tut15-opengl-touch-app-01.py 2014-06-06
> 08:09:32 +0000
> +++ python-examples/gtk3/tut15/tut15-opengl-touch-app-01.py 2014-06-06
> 14:04:31 +0000
> @@ -15,7 +15,10 @@
> from OpenGL.GLU import gluPerspective, gluLookAt
> from OpenGL.arrays import vbo
> from OpenGL import GLX
> -from OpenGL.raw._GLX import struct__XDisplay
> +try:
> + from OpenGL.GLX import struct__XDisplay
> +except ImportError as err:
> + from OpenGL.raw._GLX import struct__XDisplay
> from OpenGL.GL import GL_VERTEX_SHADER, GL_FRAGMENT_SHADER
> from OpenGL.GL import shaders, glGetUniformLocation
>
>
>
>

Revision history for this message
Mike C. Fletcher (mcfletch) wrote :

On 06/06/2014 10:15 AM, Oliver Marks wrote:
> Thanks for the suggestion i will have a look later and change it to use the
> none raw struct maybe that will fix it.
The merge won't fix anything other than allowing you to import the
module on PyOpenGL 3.1.

> I have got it working now but i dont understand the why exactly.
>
> Basically turning on double buffering in the glx context makes the zbuffer
> work so its like single buffered displays dont have a z buffer for the
> depth.
Single-buffered contexts are pretty rarely used (essentially never), so
I wouldn't be too surprised to find them not working particularly well.

Good luck,
Mike

> On Fri, Jun 6, 2014 at 3:05 PM, Mike C. Fletcher <email address hidden>
> wrote:
>
>> Mike C. Fletcher has proposed merging lp:~mcfletch/python-examples/fixes
>> into lp:~oly/python-examples/trunk.
>>
>> Requested reviews:
>> Oliver Marks (oly)
>>
>> For more details, see:
>> https://code.launchpad.net/~mcfletch/python-examples/fixes/+merge/222326
>>
>> Trivial fix to allow import of the GLX structure on 3.1. Can't test beyond
>> that as the glade GUI doesn't run on my Kubuntu machine.
>> --
>> https://code.launchpad.net/~mcfletch/python-examples/fixes/+merge/222326
>> You are requested to review the proposed merge of
>> lp:~mcfletch/python-examples/fixes into lp:~oly/python-examples/trunk.
>>
>> === modified file 'python-examples/gtk3/tut15/tut15-opengl-touch-app-01.py'
>> --- python-examples/gtk3/tut15/tut15-opengl-touch-app-01.py 2014-06-06
>> 08:09:32 +0000
>> +++ python-examples/gtk3/tut15/tut15-opengl-touch-app-01.py 2014-06-06
>> 14:04:31 +0000
>> @@ -15,7 +15,10 @@
>> from OpenGL.GLU import gluPerspective, gluLookAt
>> from OpenGL.arrays import vbo
>> from OpenGL import GLX
>> -from OpenGL.raw._GLX import struct__XDisplay
>> +try:
>> + from OpenGL.GLX import struct__XDisplay
>> +except ImportError as err:
>> + from OpenGL.raw._GLX import struct__XDisplay
>> from OpenGL.GL import GL_VERTEX_SHADER, GL_FRAGMENT_SHADER
>> from OpenGL.GL import shaders, glGetUniformLocation
>>
>>
>>
>>

--
________________________________________________
   Mike C. Fletcher
   Designer, VR Plumber, Coder
   http://www.vrplumber.com
   http://blog.vrplumber.com

Revision history for this message
Oliver Marks (oly) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'python-examples/gtk3/tut15/tut15-opengl-touch-app-01.py'
2--- python-examples/gtk3/tut15/tut15-opengl-touch-app-01.py 2014-06-06 08:09:32 +0000
3+++ python-examples/gtk3/tut15/tut15-opengl-touch-app-01.py 2014-06-06 14:04:31 +0000
4@@ -15,7 +15,10 @@
5 from OpenGL.GLU import gluPerspective, gluLookAt
6 from OpenGL.arrays import vbo
7 from OpenGL import GLX
8-from OpenGL.raw._GLX import struct__XDisplay
9+try:
10+ from OpenGL.GLX import struct__XDisplay
11+except ImportError as err:
12+ from OpenGL.raw._GLX import struct__XDisplay
13 from OpenGL.GL import GL_VERTEX_SHADER, GL_FRAGMENT_SHADER
14 from OpenGL.GL import shaders, glGetUniformLocation
15

Subscribers

People subscribed via source and target branches

to all changes: