[cairo] Re: SVG Spacewar

Steve Chaplin stevech1097 at yahoo.com.au
Fri Apr 1 05:21:14 PST 2005


On Thu, 2005-03-31 at 11:13 -0800, cairo-request at cairographics.org
wrote:
> Hello all.  I've been playing around with Cairo lately, and have made a
> little re-make of the classic Spacewar game, but with SVG-like graphics.
> It's more of a proof-of-concept at this stage than a full-fledged game,
> but I think that it's quite playable.
> 
> I put up a home page at the only publicly available web space that I
> currently have (under the sourceforge page of another project of mine):
> http://browserbookapp.sourceforge.net/svgspacewar/
> but I would love to see this live in the cairo-demo module in CVS, if
> the powers that be are happy with that (it's pretty small, just 1100
> lines of C and a Makefile).  Otherwise, I'll get around to setting up a
> new SF project.
> 
> Feedback most welcome.  This is my first venture with Cairo, and I am
> not 100% confident with C either, so I might be making simple mistakes.

You could put the gtkcairo widget inside a gtk_aspect_frame
and then remove scale_for_aspect_ratio()
- let gtk maintain the gtkcairo widget with the correct aspect ratio,
and just scale to fit the widget width and height, without needing
to use cairo_translate() to offset into the gtkcairo window, patch
attached.

(I'm not sure how this would interact with ']' scale-by-x1.25, and do
not understand why you would want to define a key to do this when you
can manually resize the window anyway)

Steve

-------------- next part --------------
A non-text attachment was scrubbed...
Name: svgspacewar.patch
Type: text/x-patch
Size: 2638 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050401/42e5043a/svgspacewar.bin


More information about the cairo mailing list