[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] PyGame and SVG



Hey Daniel.

OpenVG could be hardware accelerated through OpenGL if no
other hw is available. If you can select backend and make your OpenVG
implementation render on SDL surfaces you'd end up with a complete
drawing kit for almost all 2D needs. It could potentially replace existing
drawing libraries for SDL/PyGame. Using it in some sort of
retained mode could make it faster than drawing pixels, as is the case
already for most 2D operations done in OpenGL. (most notably blending,
transformations, even pixel based operations like bump mapping etc)

The only drawback so far is that there are very few (if any) complete
implementations at all and certainly no free. That is also true for
SVG. Both are good, yet fairly unknown/unpopular standards, sadly. :/

/Peter

On 2009-05-07 (Thu) 20:59, Daniel Jo wrote:
> The OpenVG one is very interesting and if development continues it could be
> very useful once desktop hardware acceleration becomes available.  At that
> point, I see it likely that SDL and PyGame will implement the creation of
> OpenVG surfaces in a similar way that they now allow the creation of OpenGL
> surfaces.  I do, however, wonder at the interoperability of OpenGL and
> OpenVG. . .
> In any case, right now I`m mosting interesting in the rendering of static
> SVG images.  Features like picking would be nice, though. . .
> -Daniel
> 
> On Wed, May 6, 2009 at 7:37 AM, RB[0] <roebros@xxxxxxxxx> wrote:
> 
> > There are pygame libraries on the pygame.org site for both SVG and OpenVG,
> > though both are limited, and I think the SVG one is only for opengl
> > rendering.
> >
> > http://www.pygame.org/project/962/ -- SVG lib
> > http://www.pygame.org/project/964/ -- OpenVG
> >
> > These might be useful to you, if only as a reference :)
> >
> > On Wed, May 6, 2009 at 7:21 AM, Peter Gebauer <
> > peter.gebauer@xxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> >> Hi!
> >>
> >> I'm not sure, but maybe something like OpenVG would be useful?
> >> http://www.khronos.org/openvg/
> >>
> >> Once you have a OpenVG implementation for SDL/PyGame you have a complete
> >> and free API to do vector graphics for games, UI's and what not with
> >> (potentially) hardware acceleration specifically for vector graphics.
> >>
> >> Just FYI. :)
> >>
> >> /Peter
> >>
> >> On 2009-05-05 (Tue) 18:47, Daniel Jo wrote:
> >> > I don't have very much time during the week, but I'll try to get it
> >> working
> >> > in Windows (XP) this weekend.  As for OS X, I don't own a system running
> >> OS
> >> > X, so unfortunately there's little that I can do there. . .
> >> > -Daniel
> >> >
> >> > On Tue, May 5, 2009 at 8:48 AM, Bo Jangeborg <bo@xxxxxxxxxxx> wrote:
> >> >
> >> > > Do you know if this will be made available for Windows and OS X too ?
> >> > >
> >> > > Bo)
> >> > >
> >> > > Daniel Jo skrev:
> >> > >
> >> > >> I was thinking about UIs today and recalled a post by Brad Wardel
> >> about
> >> > >> the UI in Galactic Civilizations. He mentioned how it would look
> >> pretty much
> >> > >> the same regardless of the resolution one runs the game at, due to
> >> the use
> >> > >> of SVG. Presumably, the UI is designed as vector drawings and at
> >> runtime
> >> > >> rendered to a texture whose size depends upon the current screen
> >> resolution.
> >> > >>
> >> > >> I thought that this would be a great idea for PyGame, but then I
> >> found
> >> > >> that the only implementation of SVG that exists for PyGame actually
> >> uses
> >> > >> Cairo. Personally, I think that using Cairo within PyGame is, at
> >> best,
> >> > >> suboptimum. What you end up with is a whole lot of redundant library
> >> that is
> >> > >> doing exactly nothing. It would be much better to have a
> >> implementation with
> >> > >> relatively atomic dependencies.
> >> > >>
> >> > >> Fortunately, after a bit of googling I discovered SDL_svg. It appears
> >> to
> >> > >> require only libxml-2.0 and libSDL. Perfect. It also has a very small
> >> API.
> >> > >> Perfect. After a bit more research I managed to create my own Python
> >> > >> bindings using Pyrex. Take a look:
> >> > >>
> >> > >> http://code.google.com/p/pygame-svg/
> >> > >>
> >> > >> -Daniel
> >> > >>
> >> > >>
> >> ------------------------------------------------------------------------
> >> > >>
> >> > >>
> >> > >> No virus found in this incoming message.
> >> > >> Checked by AVG - www.avg.com Version: 8.5.325 / Virus Database:
> >> > >> 270.12.15/2093 - Release Date: 05/02/09 14:23:00
> >> > >>
> >> > >>
> >> > >>
> >> > >
> >> > >
> >>
> >
> >