You are not logged in.

#1 2010-07-08 13:05:43

e1in9
Member
Registered: 2010-06-23
Posts: 6

Simple graphical program, which language/library?

Hi all,

I need to visualize (moving) squares in a grid. (The program will be made in OO approach.)
There also could be a timer functionality to pause the movement or view it slower/faster.

However I have no experience with graphical output except using Java, and I'd peferably not use Java.
Also I only know C++, Java and Scheme so far, but could learn another language.

Would it be a good idea to use C++ with the Allegro library, or e.g. something different like Python with TkInter? What would you recommend?

Offline

#2 2010-07-08 14:43:59

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: Simple graphical program, which language/library?

I'd go with Javascript, depending on the complexity of course.
Libraries like jQuery and script.aculo.us have simplified web-based animation quite a lot, allow you to control animation speed easily, and it will work on all platforms.

A quick search turned up these examples:
http://www.authenticsociety.com/gShuffle-1/
http://www.bennadel.com/blog/1009-jQuer … lug-In.htm

JS:
http://jquery.com/
http://script.aculo.us/

Offline

#3 2010-07-08 14:53:06

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Simple graphical program, which language/library?

If you already know C++, using C++ and Allegro would allow you to quickly create the squares moving around the screen. (I'm a big fan of Allegro) big_smile

If you need something, like, menus and buttons, then Allegro might not be the best choice.

Offline

#4 2010-07-08 15:57:29

e1in9
Member
Registered: 2010-06-23
Posts: 6

Re: Simple graphical program, which language/library?

Thanks for your tips;
I don't really need buttons etc. so Allegro will do.
I will check Javascript too; didn't think of that.

Offline

#5 2010-07-08 19:26:20

shetland_breeder
Member
From: England
Registered: 2010-05-17
Posts: 67
Website

Re: Simple graphical program, which language/library?

Python? Does everything the other's mentioned do but in a cleaner easier to use way.

After a bit other languages seem like something out of the ark - and I'm not sure I'd dignify javascript with 'language' anyway - it's an evil horrible kluge. If it didn't exist no-one would want to invent it.

Pete
(Pythonista)

Offline

#6 2010-07-09 14:00:21

xenobrain
Member
From: Lodi, CA
Registered: 2006-05-31
Posts: 91

Re: Simple graphical program, which language/library?

Why, of course I recommend Qt, with use of a QGraphicsView.  ;-)

I don't know much of Allegro having chosen to learn SDL instead, but I understand both have C++ wrappers available.  If Allegro is anything like SDL (and supposedly it is), then your project should be fairly easy to implement with it.

I still prefer a QGraphicsView over SDL though, much cleaner API and thoroughly OO.  Nicely supports SVG and PNG+Alpha channels. There are multiple compositing modes (overlay, multiply etc), plus great animation and state machine frameworks!

Tons of examples and demos available too.  You can see them if you install qt-doc and go to /usr/share/doc/qt/

And if you don't mind trying something really, really new, I'd bet you could whip up a grid of moving squares in Qt's brand-new QML faster than absolutely anything else (pygame, javascript etc included!  Maybe not flash, but meh....).


(I'm not a shill if the software's open-source, right? tongue)

Last edited by xenobrain (2010-07-09 14:20:23)

Offline

#7 2010-07-09 14:37:21

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Simple graphical program, which language/library?

I try to keep away from javascript even in my JEE apps. Server side validations unless its extremely simple to do at client side.
You don't want to use Java, but Java Swing can be a good tool to build graphical programs. Although I am not sure if you need it to be lightweight or not.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#8 2010-07-09 15:33:10

lordmetroid
Member
Registered: 2009-09-27
Posts: 75

Re: Simple graphical program, which language/library?

For something simple I would make use of the standard graphic library in Java or if I am doing something serious I would code the application using OpenGL.

Offline

#9 2010-07-10 08:07:18

simlan
Member
From: Germany
Registered: 2010-05-30
Posts: 20

Re: Simple graphical program, which language/library?

You could also think about Processing http://processing.org/(A mashup of Java to make it suitable for simple Animations) or the sytactic equivalent processing.js

Offline

#10 2010-07-10 11:17:07

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,426

Re: Simple graphical program, which language/library?

I'm sure gambas would do the trick too


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#11 2010-07-10 11:53:14

PirateJonno
Forum Fellow
From: New Zealand
Registered: 2009-04-13
Posts: 372

Re: Simple graphical program, which language/library?

Wow, what a clutter of different options!


"You can watch for your administrator to install the latest kernel with watch uname -r" - From the watch man page

Offline

#12 2010-07-16 20:40:47

valium97582
Member
Registered: 2010-06-19
Posts: 126

Re: Simple graphical program, which language/library?

Hey, there is Racket, which is an excellent option, considering you know Scheme. Racket is a dialect/language based on Scheme, but it has class suport et alia.


I'm also known as zmv on IRC.

Offline

#13 2010-07-16 21:56:14

Svenstaro
Administrator
From: Germany
Registered: 2008-11-19
Posts: 388

Re: Simple graphical program, which language/library?

Use SFML, it is the only sane choice wink

Offline

#14 2010-07-17 00:03:31

valium97582
Member
Registered: 2010-06-19
Posts: 126

Re: Simple graphical program, which language/library?

Yep, Svenstaro is right. Lisp and its dialects are for insane people. Lucky me, I am insane.


I'm also known as zmv on IRC.

Offline

#15 2010-07-18 15:57:43

jumzi
Member
Registered: 2009-02-20
Posts: 69

Re: Simple graphical program, which language/library?

Assembly... no doubt

Offline

#16 2010-07-18 18:49:11

JohnVV
Member
From: Ann Arbor, Mi. U.S.A.
Registered: 2009-09-30
Posts: 107
Website

Re: Simple graphical program, which language/library?

there are already a bunch of posts but 
Have you looked at "CImg.h "
look at " An animation featuring triangles that are rotating  (50 lines of code)."
http://cimg.sourceforge.net/screenshots.shtml
http://cimg.sourceforge.net/img/ss_triangle.jpg

Offline

Board footer

Powered by FluxBB