jds17 has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I am writing a soccer program as a fun project. I don't need any fancy graphics, hardware acceleration, ... I am more interested in the gameplay / algorithms / strategy.

I finally managed to get OpenGL working under Win XP and have created some parts of my program. Then, some weeks ago, I bought an Asus Eee PC and the same fiddling around with OpenGL support happened once more (Xandros & Mandriva are installed on the Eee), without success.

What would be your suggestion for a portable and easy to use graphics solution with good Perl integration?

I already had some crazy ideas about using some browser plugin or some kind of ajax grid talking to a little perl http server, maybe if performance is not the main factor, using the browser as GUI could be the best solution. Any suggestions are welcome!

Update: Guys, thank you all very much for your input over the last days. I think I'll go the SDL route and try to get it running on windows, too. I am sure there is something to learn on the way.

  • Comment on WANTED: Simple & portable graphics to use with Perl

Replies are listed 'Best First'.
Re: WANTED: Simple & portable graphics to use with Perl
by pc88mxer (Vicar) on Jun 02, 2008 at 20:57 UTC
      Hi pc88mxer, thanks for the info. In fact, a few minutes ago I did an
      apt-get install libsdl-perl
      (for Xandros), downloaded the Perl Hacks book code and got the sdl_animation.pl program running. So I guess this counts as a partial success.

      In any case I would be very interested in alternatives. Are there any simpler solutions if I just need to draw some primitives using a few colors and have a decent animation?

      I tried to get SDL to work on Win XP and did not succeed. I would rather not use the OpenGL module on Windows XP and SDL on Xandros for the same project.

      Therefore, dear monks, I would appreciate any alternative idea. By the way, I already did some searches on CPAN without finding an appropriate module, but maybe I overlooked a gem or two :-)

        Why doesn't the SDL work in XP? How didn't you succeed? Is it impossible or did you just give up?

        -Paul

Re: WANTED: Simple & portable graphics to use with Perl
by zentara (Cardinal) on Jun 03, 2008 at 11:27 UTC
      Hi, thanks for pointing me to Zinc, looks quite impressive, but I did not manage to install it under Strawberry Perl 5.10.0.1 via cpan. I get a whole lot of errors, ending in
      Tabular.c:702: warning: excess elements in scalar initializer Tabular.c:702: warning: (near initialization for `TABULAR_ITEM_CLASS') Tabular.c:704: warning: excess elements in scalar initializer Tabular.c:704: warning: (near initialization for `TABULAR_ITEM_CLASS') Tabular.c:704: warning: data definition has no type or storage class dmake.EXE: Error code 129, while making 'Tabular.o' ZINCDEV/tk-zinc-3.303.tar.gz C:\strawberry\c\bin\dmake.EXE -- NOT OK
      Did you manage to install Tk::Zinc on Windows / Strawberry?
        You might ask on the Zinc Maillist or post another top level node here, asking if anyone has compiled it under Strawberry.

        I rarely use Windows, but I did install the precompiled package available for win32 from the Download Page IIRC, you need at least WindowsXP for it to work.


        I'm not really a human, but I play one on earth CandyGram for Mongo
Re: WANTED: Simple & portable graphics to use with Perl
by Anonymous Monk on Jun 03, 2008 at 14:37 UTC
Re: WANTED: Simple & portable graphics to use with Perl
by Anonymous Monk on Jun 03, 2008 at 23:22 UTC
    If you need some UI for your program (and not just draw some scenes), you should look at wxPerl (or also on CPAN).