Re: [Tutor] Best tool for programming interactive games in Python

2016-03-31 Thread Alan Gauld
On 31/03/16 20:27, Oscar Benjamin wrote:

>>> OpenGL plays nicely with Windows and Linux as well.
>>
>> mix n' match the OSX graphics libraries. You can't do that as easily
>> in X or Windows is an add-on library, not a native part of the OS.
> 
> That's interesting. I've used OpenGL on Windows and Linux but not on
> OSX so I'm not sure exactly what you mean. 

I can't speak for Linux because, although it's my main platform
I've not done much graphics on it. But on Windows the core OS APIs
all use a device context or GDI object to do their painting. To
use OpenGL you need to bridge between the GDI of native windows
and the OpenGL libraries. If you want to draw a moving string for
instance you need to either use the Windows graphics system
or the OpenGL system. In MacOS X the ODS system is OpenGL so
you can use the native API interleaved with your OpenGL code.

> (Unity, Gnome3, KDE4, etc.) use OpenGL-based compositing just like OSX
> does and I'm fairly sure Android does as well. Does it just work out
> better on OSX?

That's news to me, I thought they(Linux) all worked through the
X layers (Xlib, Xt etc).

> I know that work is under way to replace X itself with Wayland and
> reimplement the core toolkits (Gtk, Qt, etc) on top of Wayland with
> OpenGL as the core

Yes, and at that point I'd expect Linux to be as seamless as MacOS.
But for now it seems to me that you still have to initialise libraries
and explicitly link your OpenGL objects to your OS (X)windows etc.
In short you have to tell the OS GUI that you are choosing to render
on OpenGL and/or use the OpenGL library routines to do any drawing.
It's a one or the other approach.

In MacOS it's (almost) a mix n match approach, you can use whichever
API call is easier for you, OS or OpenGL native and interleave them.
There are some issues that arise but I don't do enough graphics
work to fully understand them! For my simple needs it all pretty
much just worked.

PS.
When I write MacOS above I suspect I should really be saying
Cocoa, but I'm, not even expert enough in MacOSX to be sure of
that! :-)

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-31 Thread Oscar Benjamin
On 30 March 2016 at 00:26, Alan Gauld  wrote:
> On 29/03/16 22:17, Oscar Benjamin wrote:
>>
>> On 29 Mar 2016 22:20, "Alan Gauld" > > wrote:
>>
>> > investigate. And of course there is OpenGL which plays very
>> > well with MacOSX.
>>
>> OpenGL plays nicely with Windows and Linux as well.
>>
>
> But not so well as MacOS X because the OS itself (or the GUI part) is
> written in/for OpenGL. So in addition to raw OpenGL you also get to
> mix n' match the OSX graphics libraries. You can't do that as easily
> in X or Windows is an add-on library, not a native part of the OS.

That's interesting. I've used OpenGL on Windows and Linux but not on
OSX so I'm not sure exactly what you mean. Modern Linux desktops
(Unity, Gnome3, KDE4, etc.) use OpenGL-based compositing just like OSX
does and I'm fairly sure Android does as well. Does it just work out
better on OSX?

I know that work is under way to replace X itself with Wayland and
reimplement the core toolkits (Gtk, Qt, etc) on top of Wayland with
OpenGL as the core and without the vagaries of the X protocol and
without needing the DRI2 extension. Perhaps that would lead to the
sort of situation that there is on OSX...

--
Oscar
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-30 Thread wolfrage8...@gmail.com
On Wed, Mar 30, 2016 at 10:36 AM, john  wrote:
> On 03/30/2016 04:27 AM, wolfrage8...@gmail.com wrote:
>>>
>>> I have a few students who are interested in creating interactive games in
>>> Python. We have learned how to use tkinter but we are looking for
>>> something more robust. I tried using pygame 
>>
>> I recommend Kivy; because then it is easy to take the app from
>> computer to Phone; which opens the world of touch devices!
>> Though not specifically made for games it works very well for my
>> purposes which are a game.
>>
> I believe Kivy requires pygame so he would get the same error.

Since Kivy 1.9 the requirement for pygame has been dropped and they
are now using OpenGL instead.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-30 Thread john

On 03/30/2016 04:27 AM, wolfrage8...@gmail.com wrote:

I have a few students who are interested in creating interactive games in
Python. We have learned how to use tkinter but we are looking for
something more robust. I tried using pygame 

I recommend Kivy; because then it is easy to take the app from
computer to Phone; which opens the world of touch devices!
Though not specifically made for games it works very well for my
purposes which are a game.


I believe Kivy requires pygame so he would get the same error.

Johnf
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-30 Thread wolfrage8...@gmail.com
>I have a few students who are interested in creating interactive games in
>Python. We have learned how to use tkinter but we are looking for
> something more robust. I tried using pygame 

I recommend Kivy; because then it is easy to take the app from
computer to Phone; which opens the world of touch devices!
Though not specifically made for games it works very well for my
purposes which are a game.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-29 Thread Alan Gauld
On 29/03/16 22:17, Oscar Benjamin wrote:
>
>
> On 29 Mar 2016 22:20, "Alan Gauld"  > wrote:
>
> > investigate. And of course there is OpenGL which plays very
> > well with MacOSX.
>
> OpenGL plays nicely with Windows and Linux as well.
>

But not so well as MacOS X because the OS itself (or the GUI part) is
written in/for OpenGL. So in addition to raw OpenGL you also get to
mix n' match the OSX graphics libraries. You can't do that as easily
in X or Windows is an add-on library, not a native part of the OS.

But I agree raw OpenGL would be too low level for most games
development (unless you really want high performance, but then
you probably wouldn't use python...). But if you wanted high
performance within the context of a single window then OpenGL
might be worth exploring.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-29 Thread Oscar Benjamin
On 29 Mar 2016 22:20, "Alan Gauld"  wrote:
>
> PyGin and Albow are other games based frameworks you could
> investigate. And of course there is OpenGL which plays very
> well with MacOSX.

OpenGL plays nicely with Windows and Linux as well. I think that pygame
actually uses pyglet which is an OpenGL wrapper behind the scenes. I'm not
sure what kind of class this setup is for but I doubt that using raw OpenGL
is appropriate here. Some kind of higher level wrapper (e.g. pygame) is
what you'd want.

I'm not sure how well maintained pygame is any more though. Does anyone
know?

--
Oscar
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-29 Thread Lisa Hasler Waters
Wonderful! Thanks Alan and Oscar. I will proceed with the various
suggestions and hopefully will be successful.

Thanks again so very much for all your support and help!

Lisa

On Tue, Mar 29, 2016 at 3:19 PM, Alan Gauld 
wrote:

> On 29/03/16 19:03, Lisa Hasler Waters wrote:
>
> > I have a few students who are interested in creating interactive games in
> > Python. We have learned how to use tkinter but we are looking for
> something
> > more robust.
>
> I'm not sure what you mean by robust. Tkinter is fine for
> low speed/non-graphics intensive type games but probably
> a bit clunky for graphics. But it should be robust in
> the sense of reliable...
>
>
> > I tried using pygame but cannot seem to get it initialized. I
> > continually get this error:
>
> >
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so:
> > no matching architecture in universal wrapper
>
> Sounds like you installed the wrong version of pygame for your Mac.
> The pygame support forum are probably the best folks to ask for specific
> issues like this.
>
> PyGin and Albow are other games based frameworks you could
> investigate. And of course there is OpenGL which plays very
> well with MacOSX.
>
> Try this link for more:
>
> https://wiki.python.org/moin/PythonGameLibraries
>
> HTH
> --
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> http://www.amazon.com/author/alan_gauld
> Follow my photo-blog on Flickr at:
> http://www.flickr.com/photos/alangauldphotos
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>



-- 
Lisa Waters, PhD
Technology Integration
Flint Hill School
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-29 Thread Alan Gauld
On 29/03/16 19:03, Lisa Hasler Waters wrote:

> I have a few students who are interested in creating interactive games in
> Python. We have learned how to use tkinter but we are looking for something
> more robust. 

I'm not sure what you mean by robust. Tkinter is fine for
low speed/non-graphics intensive type games but probably
a bit clunky for graphics. But it should be robust in
the sense of reliable...


> I tried using pygame but cannot seem to get it initialized. I
> continually get this error:

> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so:
> no matching architecture in universal wrapper

Sounds like you installed the wrong version of pygame for your Mac.
The pygame support forum are probably the best folks to ask for specific
issues like this.

PyGin and Albow are other games based frameworks you could
investigate. And of course there is OpenGL which plays very
well with MacOSX.

Try this link for more:

https://wiki.python.org/moin/PythonGameLibraries

HTH
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-29 Thread Oscar Benjamin
On 29 Mar 2016 21:19, "Bob Gailer"  wrote:
>
> On Mar 29, 2016 2:03 PM, "Lisa Hasler Waters" 
wrote:
> >
> > I continually get this error:
> >
> >
> > Traceback (most recent call last):
> >   File "/Users/lwaters/Desktop/pygameTest.py", line 1, in 
> > import pygame, sys
> >   File
> >
>
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/__init__.py",
> > line 95, in 
> > from pygame.base import *
> > ImportError:
> >
>
dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so,
> > 2): no suitable image found.  Did find:
> >
>
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so:
> > no matching architecture in universal wrapper
> I assume you are running python 2.7 . true?
> What operating system?
> How did you install pygame?
> First guess uninstall and reinstall a game.
> Any other information you can give us may help

Just guessing here but the error suggests a mismatch between 32 and 64 bit
binaries. Is it possible that you have installed 32 bit Python and 64 bit
pygame or vice-versa?

(I'm not an OSX user but I think that's what the error can mean.)

--
Oscar
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-29 Thread Lisa Hasler Waters
Thanks Bob.

Using Mac, OS 10.11 El Cap
Yes running Python 2.7
Installed the Pygame from: http://www.pygame.org/download.shtml 1.9.1

I could try to uninstall/re -- but I'll wait to see if anyone has other
suggestions based on the new info I've provided.

Thx

On Tue, Mar 29, 2016 at 2:18 PM, Bob Gailer  wrote:

>
> On Mar 29, 2016 2:03 PM, "Lisa Hasler Waters" 
> wrote:
> >
> > I continually get this error:
> >
> >
> > Traceback (most recent call last):
> >   File "/Users/lwaters/Desktop/pygameTest.py", line 1, in 
> > import pygame, sys
> >   File
> >
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/__init__.py",
> > line 95, in 
> > from pygame.base import *
> > ImportError:
> >
> dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so,
> > 2): no suitable image found.  Did find:
> >
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so:
> > no matching architecture in universal wrapper
> I assume you are running python 2.7 . true?
> What operating system?
> How did you install pygame?
> First guess uninstall and reinstall a game.
> Any other information you can give us may help.
>



-- 
Lisa Waters, PhD
Technology Integration
Flint Hill School
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-29 Thread Bob Gailer
On Mar 29, 2016 2:03 PM, "Lisa Hasler Waters"  wrote:
>
> I continually get this error:
>
>
> Traceback (most recent call last):
>   File "/Users/lwaters/Desktop/pygameTest.py", line 1, in 
> import pygame, sys
>   File
>
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/__init__.py",
> line 95, in 
> from pygame.base import *
> ImportError:
>
dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so,
> 2): no suitable image found.  Did find:
>
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so:
> no matching architecture in universal wrapper
I assume you are running python 2.7 . true?
What operating system?
How did you install pygame?
First guess uninstall and reinstall a game.
Any other information you can give us may help.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor