> What does it take to draw
> simple QBASIC style graphics with C under Linux ?
>
> Would it be easier to draw graphics in a console
> or in X Windows ?
Personally I'd go for X - there's rather more code and choice of toolkits
around.
However - and the reason I thought I'd chip in, as I'm not sure it emerged
clearly from Crossfire's summary of the possibilities - you need to be prepared
to shift your programming mind around a bit. I speak as one who also made the
transition from various BASICs(*) and other PC console graphics libraries
to windowing systems - X and Windows, in my case.
The crucial difference is the switch to event-driven programming.
BASIC programs with graphics tend to go something along the lines of:
Select graphics mode
Draw screen
Wait for user to type command
Draw modified screen
Wait
Draw
Wait - user gives exit command
Exit
X programs, on the other hand, are more along the lines of
Initialise
Create main window
Call toolkit event loop
Exit
Paint event:
Draw screen
The point here is that your program, rather than being a sequential flow of
control, spends its time responding to 'events' at the behest of the windowing
system. From a programming point of view, it can feel like you're going from
being The General, Lord Of All You Survey, to Private, meekly obeying
orders issued from on high. But that's the way it has to be; the windowing
system is the one that knows when a window needs to be drawn, not you. Your
window may be iconised, off the screen, or entirely hidden by another window;
no point in drawning its contents.
I've recently been reading up on GTK and Qt, the two main Linux X toolkits, and
personally at this stage think Qt is the nicer, but it is C++. But reading an
introduction to either, or a Java tutorial, or Jamie's excellent Tcl/Tk
suggestion (though I personally don't like Tcl as a language) is the starting
point.
Jim
(*) Atom, BBC, Apple ][ & ///(**). Yep, old fart here.
(**) Not many people these days know what an Apple /// looked like, let alone
programmed one. In the case of the Apple ///, that equally true at the time as
well. :-)
--
Jim Hague - [EMAIL PROTECTED] (Work), [EMAIL PROTECTED] (Play)
Never trust a computer you can't lift or you don't control.
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug