Python And Pygame


rockthekazzba said:
On a somewhat unrelated note. I really like using scalable vector graphics (SVG) for developing graphic elements for my programs. However, many of the packages and modules I develop with do not support SVG so I have to export to bmp or png. I have found very little information on SVG and Python (specifically for use in games, not data analysis), or for SDL (need an additional module to support).

I found this article at svg.org. Its a brief press release saying ARM is optimizing an SVG library for their processors. I was wondering if this is relevant to the Pandora. It seems that SVG could be a great graphics platform for developing games for the Pandora (smaller footprint?, better graphics?) but have seen relatively little references to SVG here in the forums.

FYI, Im a noob, and a self-taught programmer. Ive always been curious why SVG hasn't taken off in terms of popularity?



Take a look on OpenVG

but i think we must wait few months for use it : emulation of this lib needs a good processor really

it will be great than SDL, SFML use it

the support of these could be very great :
OpenVG for 2D and Vector 2D
OGLES 2.0 for 3D

;)

i don't know if somebody works on OpenVG in SDL or SFML :unsure:
me i can't my pc have not the power for that :rolleyes:
 
Last edited by a moderator:
I'd greatly appreciate it also, I wrote a little ebook reader for the gp2x that will just be a drop-in port to the pandora if pygame is ported already. <shameless plug>rsvp4gp2x</shameless plug>

I'd also highly recommend pygame for general development, I had a prototype of my reader running within an hour of sitting down to start on it, and it was the first thing I wrote in either python or SDL.
 
sindbad said:
I haven't worked with SDL much, so I don't know if Cairo is usable with it. Give it a try. If it's only twice as slow as Qt, it might do the job.
I know Bill Kendrick uses it for his TuxPaint app. He gave a presentation on it, and there's also a demo on their CVS repository.

I was interested in using SVG on the Pandora as well. It looks like Cairo may already work on the GP2X.
 
Last edited by a moderator:
Arialia said:
rockthekazzba said:
On a somewhat unrelated note. I really like using scalable vector graphics (SVG) for developing graphic elements for my programs. However, many of the packages and modules I develop with do not support SVG so I have to export to bmp or png. I have found very little information on SVG and Python (specifically for use in games, not data analysis), or for SDL (need an additional module to support).

I found this article at svg.org. Its a brief press release saying ARM is optimizing an SVG library for their processors. I was wondering if this is relevant to the Pandora. It seems that SVG could be a great graphics platform for developing games for the Pandora (smaller footprint?, better graphics?) but have seen relatively little references to SVG here in the forums.

FYI, Im a noob, and a self-taught programmer. Ive always been curious why SVG hasn't taken off in terms of popularity?



Take a look on OpenVG

but i think we must wait few months for use it : emulation of this lib needs a good processor really

it will be great than SDL, SFML use it

the support of these could be very great :
OpenVG for 2D and Vector 2D
OGLES 2.0 for 3D

;)

i don't know if somebody works on OpenVG in SDL or SFML :unsure:
me i can't my pc have not the power for that :rolleyes:


AmanithVG is a commercial OpenVG implementation that takes better advantage of shaders than the reference OpenVG code on the Khronos web site. Of course this power doesn't come for free.

I think rasterizing 2D vectors at load time is something to be encouraged but plotting them in realtime is a hassle. As for the SVG format, it's just a compressed XML document with a few commands containing lists of vertexes. It should be easy to work with except that most OpenGL and OpenGL-ES graphics processors don't have the hardware accelerated capacity to plot polygons with more than 4 vertexes.
 
Last edited by a moderator:
DasFool said:
rockthekazzba said:
On a somewhat unrelated note. I really like using scalable vector graphics (SVG) for developing graphic elements for my programs.
I ran into a problem regarding this just a few hours ago with pygame. I was scaling a graphic progressively and it started being pretty processor and memory intensive. Coming from a Flash background, this wasn't something I'm used to. I agree, a vector environment would be nice, Silverlight perhaps?


Silverlight, being Mono/.NET-based would take more RAM than the Pandora has. It would require the direct memory addressing of the flash memory cards or generate lots of swap files. The less we see of .NET or Mono, the better. It scales up from the desktops to servers but not down to handheld devices.

I don't know if OpenGL-ES has the same glOrtho commands for 2d graphics acceleration as standard OpenGL but that's what you should be using if you want to have scalable graphics. Most experienced SDL programmers bypass the main graphics functions in SDL in favor of an OpenGL context and do all of their graphics with that. Unfortunately I don't know if PyOpenGL will work in OpenGL-ES either. I do know that PyGame will work together with PyOpenGL on a desktop PC for using OpenGL graphics plotting.

SDL 1.3 is supposed to close the gap between SDL and OpenGL by converting the internal memory banging functions of SDL 1.2.x into their equivalent OpenGL functions. We'll see what that generates.

As for Cairo, I've heard it is a dependency of Firefox 3.0 so I'm confident it will get ported to the Pandora before release.
 
Last edited by a moderator:
Samurai_Crow said:
Unfortunately I don't know if PyOpenGL will work in OpenGL-ES either. I do know that PyGame will work together with PyOpenGL on a desktop PC for using OpenGL graphics plotting.
The latest version of PyOpenGL uses ctypes (instead of swig) for binding. This should make adapting it to ES much easier.
 
Last edited by a moderator:
I'm currently a big fan of Pyglet, since it's so lightweight & portable, and really hope that it can be made to run on the pandora.

I ran across a SVG library for it; it's here. Haven't given it a shot yet myself, but it seemed to work for the people who did try it :)
 
theoddbot said:
I've put this in my application for a developer unit, so if it's accepted it might even be part of the standard image. The only moderately tricky thing will be OpenGL-ES support, but it's no fun if there's not a challenge right :)
theoddbot, any luck with this?

Thanks,

Pete
 
Last edited by a moderator:
PAH said:
theoddbot, any luck with this?

Thanks,

Pete
I doubt I will see a unit before general release.

In the meantime I have gotten 1.1 ES support going on an iPhone, though not within pygame or SDL
 
Last edited by a moderator:
alright so i'm a former mac developer that is pretty comforatable with objective c, c++, and i have a strong foundation of python
i recently switched entirely to fedora for my computer, and i'm looking into linux programming (specifically game programming)
anyone have any suggestions?
i'd rather use c++ because i am most comfortable with it (i hardly remember classes in python but i remember them being pretty easy)
so what should i use to develop games?
like sdl or opengl es?
 
sindbad said:
Samurai_Crow said:
Unfortunately I don't know if PyOpenGL will work in OpenGL-ES either. I do know that PyGame will work together with PyOpenGL on a desktop PC for using OpenGL graphics plotting.
The latest version of PyOpenGL uses ctypes (instead of swig) for binding. This should make adapting it to ES much easier.

But we don't have ctypes on ARM yet, do we?
Or do you just mean the bindings would be more straightforward to translate to a different binding method on Pandora?
 
Last edited by a moderator:
rabidpoobear said:
sindbad said:
Samurai_Crow said:
Unfortunately I don't know if PyOpenGL will work in OpenGL-ES either. I do know that PyGame will work together with PyOpenGL on a desktop PC for using OpenGL graphics plotting.
The latest version of PyOpenGL uses ctypes (instead of swig) for binding. This should make adapting it to ES much easier.

But we don't have ctypes on ARM yet, do we?
Or do you just mean the bindings would be more straightforward to translate to a different binding method on Pandora?

Python's ctypes module should work just fine on ARM. It uses libffi, which is pretty portable.
 
Last edited by a moderator:
Will there be a possibility to create python standalones?
I didn't find any programms (like py2exe for windows) for ARM to convert python scripts to standalones.

the performance would be much better as standalone, wouldn't it?

(excuse me i am c++ programmer most of the time - doing my first steps with pygame :ph34r: )
 
@GabrielM

PyInstaller can make standalone executables for linux. However, the performance does not improve at all. Same thing.
 
If not for performance, for organization, a standalone is more acceptable instead of digging through scripts. Though there is always the need to edit code...
 
Back
Top