|
Next: Minimal graphics lib for gcc on MacOS-X
|
| Author |
Message |
External

Since: Jun 16, 2005 Posts: 8
|
(Msg. 1) Posted: Tue Jul 11, 2006 5:55 am
Post subject: Minimal graphics gcc lib for MacOS-X Archived from groups: comp>sys>mac>programmer>tools (more info?)
|
|
|
Hi,
A member of my family studies C in his classroom under Windows, and they
use a Windows IDE.
On his MacOS-X Tiger machine, he uses gcc + Emacs, but lacks the
capability of opening a simple graphics window, and drawing lines.
Is there a *small* graphics lib he can include to get his project done
without diving in the arcane of XCode and Mac programming ?
A turtle graphics library should be the ideal so far.
Thanks for him (and probably many other students)...
JG >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 17, 2006 Posts: 6
|
(Msg. 2) Posted: Fri Nov 17, 2006 11:05 am
Post subject: Re:Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
> Is there a *small* graphics lib
A few simple Carbon calls will do fine. You don't need any extra library,
just use -framework Carbon on the command line (if you are using the
Terminal). NewCWindow, SetPort, MoveTo, LineTo... Something like this:
---
#include <Carbon/Carbon.h>
Rect bounds;
WindowPtr wind;
main()
{
SetRect(&bounds, 100, 100, 356, 356);
wind =
NewCWindow(NULL,&bounds,"\pTest",1,plainDBox,(WindowPtr)-1,0,
0);
SetPortWindowPort(wind);
while (!Button())
{
LineTo(Random() & 255, Random() & 255);
QDFlushPortBuffer(GetWindowPort(wind), NULL);
}
}
---
It can't be much simpler. Of course, I'd like to suggest OpenGl for the
future.
* posted via http://MacErudite.com
* please report abuse to http://xinbox.com/mymac >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 17, 2006 Posts: 6
|
(Msg. 3) Posted: Sat Nov 18, 2006 1:54 am
Post subject: Re:Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
> I also suggest the flag '-fpascal-strings' to get rid of the warning that
> is produced.
You are quite right! The whole command line should be something like:
gcc test.c -o test -framework Carbon -fpascal-strings
Run with
../test
That's still a nice and short command line. But it would be good if the
window would pop up in the front. That would take a few more lines to fix.
* posted via http://MacErudite.com
* please report abuse to http://xinbox.com/mymac >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 18, 2006 Posts: 16
|
(Msg. 4) Posted: Sat Nov 18, 2006 4:10 am
Post subject: Re: Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ingemar wrote:
> Something like this:
That's a really neat example. At first I didn't know anything was
happening becuase all of the drawing was happening in a window behind my
terminal.
I also suggest the flag '-fpascal-strings' to get rid of the warning
that is produced.
--
The ears are too length.
--------------------------------------------------------------
tim lindner: First initial last name at macmess dot org >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 18, 2006 Posts: 1
|
(Msg. 5) Posted: Sat Nov 18, 2006 4:10 am
Post subject: Re: Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ingemar wrote:
> Something like this:
That's a really neat example. At first I didn't know anything was
happening becuase all of the drawing was happening in a window behind my
terminal.
I also suggest the flag '-fpascal-strings' to get rid of the warning
that is produced.
--
The ears are too length.
--------------------------------------------------------------
tim lindner: First initial last name at macmess dot org >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 18, 2006 Posts: 16
|
(Msg. 6) Posted: Sat Nov 18, 2006 4:10 am
Post subject: Re: Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ingemar wrote:
> Something like this:
That's a really neat example. At first I didn't know anything was
happening becuase all of the drawing was happening in a window behind my
terminal.
I also suggest the flag '-fpascal-strings' to get rid of the warning
that is produced.
--
The ears are too length.
--------------------------------------------------------------
tim lindner: First initial last name at macmess dot org >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 18, 2006 Posts: 16
|
(Msg. 7) Posted: Sat Nov 18, 2006 4:10 am
Post subject: Re: Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ingemar wrote:
> Something like this:
That's a really neat example. At first I didn't know anything was
happening becuase all of the drawing was happening in a window behind my
terminal.
I also suggest the flag '-fpascal-strings' to get rid of the warning
that is produced.
--
The ears are too length.
--------------------------------------------------------------
tim lindner: First initial last name at macmess dot org >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 18, 2006 Posts: 16
|
(Msg. 8) Posted: Sat Nov 18, 2006 4:10 am
Post subject: Re: Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ingemar wrote:
> Something like this:
That's a really neat example. At first I didn't know anything was
happening becuase all of the drawing was happening in a window behind my
terminal.
I also suggest the flag '-fpascal-strings' to get rid of the warning
that is produced.
--
The ears are too length.
--------------------------------------------------------------
tim lindner: First initial last name at macmess dot org >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 18, 2006 Posts: 16
|
(Msg. 9) Posted: Sat Nov 18, 2006 4:10 am
Post subject: Re: Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ingemar wrote:
> Something like this:
That's a really neat example. At first I didn't know anything was
happening becuase all of the drawing was happening in a window behind my
terminal.
I also suggest the flag '-fpascal-strings' to get rid of the warning
that is produced.
--
The ears are too length.
--------------------------------------------------------------
tim lindner: First initial last name at macmess dot org >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 18, 2006 Posts: 16
|
(Msg. 10) Posted: Sat Nov 18, 2006 4:10 am
Post subject: Re: Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ingemar wrote:
> Something like this:
That's a really neat example. At first I didn't know anything was
happening becuase all of the drawing was happening in a window behind my
terminal.
I also suggest the flag '-fpascal-strings' to get rid of the warning
that is produced.
--
The ears are too length.
--------------------------------------------------------------
tim lindner: First initial last name at macmess dot org >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 18, 2006 Posts: 16
|
(Msg. 11) Posted: Sat Nov 18, 2006 4:10 am
Post subject: Re: Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ingemar wrote:
> Something like this:
That's a really neat example. At first I didn't know anything was
happening becuase all of the drawing was happening in a window behind my
terminal.
I also suggest the flag '-fpascal-strings' to get rid of the warning
that is produced.
--
The ears are too length.
--------------------------------------------------------------
tim lindner: First initial last name at macmess dot org >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 18, 2006 Posts: 16
|
(Msg. 12) Posted: Sat Nov 18, 2006 4:10 am
Post subject: Re: Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ingemar wrote:
> Something like this:
That's a really neat example. At first I didn't know anything was
happening becuase all of the drawing was happening in a window behind my
terminal.
I also suggest the flag '-fpascal-strings' to get rid of the warning
that is produced.
--
The ears are too length.
--------------------------------------------------------------
tim lindner: First initial last name at macmess dot org >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 18, 2006 Posts: 16
|
(Msg. 13) Posted: Sat Nov 18, 2006 4:10 am
Post subject: Re: Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ingemar wrote:
> Something like this:
That's a really neat example. At first I didn't know anything was
happening becuase all of the drawing was happening in a window behind my
terminal.
I also suggest the flag '-fpascal-strings' to get rid of the warning
that is produced.
--
The ears are too length.
--------------------------------------------------------------
tim lindner: First initial last name at macmess dot org >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 18, 2006 Posts: 16
|
(Msg. 14) Posted: Sat Nov 18, 2006 4:10 am
Post subject: Re: Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ingemar wrote:
> Something like this:
That's a really neat example. At first I didn't know anything was
happening becuase all of the drawing was happening in a window behind my
terminal.
I also suggest the flag '-fpascal-strings' to get rid of the warning
that is produced.
--
The ears are too length.
--------------------------------------------------------------
tim lindner: First initial last name at macmess dot org >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |
External

Since: Nov 18, 2006 Posts: 16
|
(Msg. 15) Posted: Sat Nov 18, 2006 4:10 am
Post subject: Re: Minimal graphics gcc lib for MacOS-X [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Ingemar wrote:
> Something like this:
That's a really neat example. At first I didn't know anything was
happening becuase all of the drawing was happening in a window behind my
terminal.
I also suggest the flag '-fpascal-strings' to get rid of the warning
that is produced.
--
The ears are too length.
--------------------------------------------------------------
tim lindner: First initial last name at macmess dot org >> Stay informed about: Minimal graphics gcc lib for MacOS-X |
|
| Back to top |
|
 |  |