Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Minimal graphics gcc lib for MacOS-X

 
   Macintosh computer (Home) -> Tools RSS
Next:  XCode and files on ssh - possible?  
Author Message
Jean-Guillaume Pyraksos

External


Since: Jun 16, 2005
Posts: 3



(Msg. 1) Posted: Tue Jul 11, 2006 10:52 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
Login to vote
Ingemar

External


Since: Nov 17, 2006
Posts: 4



(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
Login to vote
Ingemar

External


Since: Nov 17, 2006
Posts: 4



(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
Login to vote
tim lindner

External


Since: Nov 18, 2006
Posts: 1



(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
Login to vote
Display posts from previous:   
Related Topics:
MacOS 8.x - Hi, I'm new to programming on macOS, in fact I'm new to macOS. I would like a compiler that works for 68k macs using OS8.x, is tehre any documentation or SDK's for this OS? hopefully there is a gcc available for 68k mac cos I use gcc on PC and Amiga ..

Filemon for MacOS X - I'm looking for some kind of utility that can tell me what files/paths a program/process attempts to open/create. Something like the way Filemon works for Windows. Does anyone know of such a utility?

Ann: ActiveDeveloper IDE 2.15 released for MacOS X 10.2 - ActiveDeveloper Mailinglist ActiveDeveloper 2.15 released for MacOS X 10.2 Our Incremental Objective-C & C IDE, JIT compiler and Debugger Your companion for Cocoa, QuickTime now adds support for WebKit ActiveDeveloper v2.15 add support for the n...

#defined symbols for MacOS X - Does anyone know if there are any #defined symbols in the compiler environment using the gcc compiler if the destination machine is MacOS X? ... or if not MacOS X specifically, BSD? I need to compile differently for MacOS X and Solaris 9, and would...

help ! PEF Executable using XCODE ?? - ------------------------------------------------------------------------ A poll associated with this post was created, to vote and see the results, please visit http://www.codecomments.com/message235968.html..
   Macintosh computer (Home) -> Tools All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]