[cairo] Mac OS X, getting started?

Henry (Yu) Song - SISA hsong at sisa.samsung.com
Fri Feb 1 22:47:47 PST 2013


Attached please find two sample code: one is quartz and second one is OpenGL.

Henry

________________________________
From: cairo-bounces+henry.song=samsung.com at cairographics.org [cairo-bounces+henry.song=samsung.com at cairographics.org] on behalf of The Devils Jester [thedevilsjester at gmail.com]
Sent: Friday, February 01, 2013 10:06 PM
To: undisclosed-recipients:
Cc: cairo at cairographics.org
Subject: Re: [cairo] Mac OS X, getting started?

While both of these seem to be good solutions (I am leaning more towards quartz than NSOpenGL) I cannot find any "Hello World" demonstrations that create a simple window.  Is there a generic GLUT like function that abstracts the platform specific window creation boiler plate code?   I found one example to show a manual method for xlib at http://en.literateprograms.org/Hello_World_(C,_Cairo)  but cannot seem to find a Mac OS X or Windows example.


On Fri, Feb 1, 2013 at 11:52 PM, Ryan Schmidt <cairo-2013a at ryandesign.com<mailto:cairo-2013a at ryandesign.com>> wrote:

On Feb 1, 2013, at 20:51, The Devils Jester wrote:

> I am looking into using Cairo as a graphics backend for a project of mine and am having trouble getting a Mac OS X build setup.  Using MacPorts, or Homebrew both want to pull the XQuartz version when I do not want that.

In MacPorts:

$ port variants cairo
cairo has the variants:
   opengl: Add OpenGL graphics interface
     * requires x11
   quartz: Support for native Mac OS X graphics
   universal: Build for multiple architectures
[+]x11: Enable X11 support

So you see the x11 variant is enabled by default. If you don't want X11 graphics, and would prefer Quartz (a.k.a. native OS X) graphics, select quartz and deselect x11.

$ sudo port install cairo +quartz -x11

If you have any further trouble with cairo or other ports in MacPorts, feel free to write to the macports-users mailing list.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20130202/f7b3d2dd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo-nsgl-hello.m
Type: application/octet-stream
Size: 2405 bytes
Desc: cairo-nsgl-hello.m
URL: <http://lists.cairographics.org/archives/cairo/attachments/20130202/f7b3d2dd/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo-quartz-hello.m
Type: application/octet-stream
Size: 2212 bytes
Desc: cairo-quartz-hello.m
URL: <http://lists.cairographics.org/archives/cairo/attachments/20130202/f7b3d2dd/attachment-0001.obj>


More information about the cairo mailing list