[R-SIG-Mac] rgl window problem
Simon Urbanek
simon.urbanek at r-project.org
Wed Dec 6 17:10:01 CET 2006
On Dec 6, 2006, at 9:08 AM, Duncan Murdoch wrote:
> On 12/6/2006 8:43 AM, roger koenker wrote:
>> I've recently installed rgl on a:
>>
>> R version 2.5.0 Under development (unstable) (2006-09-10 r39242)
>> powerpc-apple-darwin8.7.0
>>
>> system, from source and everything seemed to be ok, the package
>> loads without complaints, however trying to run any of the examples
>> produces the usual window, but no plotting occurs. The window
>> is blank, and moving the cursor over the window gives the dreaded
>> spinning pinwheel of cluelessness.
>>
>> Can anyone suggest a strategy for further diagnosis?
>
> This sounds as though you are running from the console rather than
> R.app, but have built rgl (or downloaded a copy built) to use AGL
> in Carbon rather than X11. That doesn't work. AGL calls only work
> from R.app.
>
> If someone knows a nice run-time test for whether Carbon will work
> I'd put it in to at least give a meaningful error message. I'd
> really prefer it to fall back to trying X11 in that case, but that
> looks much harder: for an OSX newbie like me, I think the AGL/X11
> decision needs to be done at link time, not run time. (On Windows
> I'd load the appropriate OpenGL .dll when the package loaded, and
> do all the calls indirectly. But I don't know how to do this on OSX.)
>
This works analogously - you can use dlopen as on other unix
platforms (this is what R does) for the indirect calls. I assume that
you need to load different code for each UI anyway, so you can make
that separation at any level, it doesn't have to be the GL level. You
could, for example, compile two libs for rgl and load the
corresponding one in First.Lib or friends. That IMHO the most simple
solution and it works on any platform.
> If my assumption in the first paragraph is wrong, please let me
> know. And if "Carbon" is the wrong name for the graphics system
> that supports the standard Mac GUI and AGL, I wouldn't mind hearing
> that either.
>
Carbon = compatibility library for OS9 code to work in OS X
Cocoa = OO application environment for programming for Mac OS X
Aqua = name of user interface used in Mac OS X
Quartz = graphics system in Mac OS X based of PDF drawing model (also
the name of the R graphics device that uses that system)
R.app = name of the Mac OS X GUI
Strictly speaking AGL is a part of Cocoa, but what you want to detect
is the R.app GUI. In fact this is not the entire story, because you
wouldn't mind using AGL if some Cocoa program links R, so
using .Platform$GUI for that seems reasonable enough (yes, AQUA here
actually means Cocoa).
In R we have a mess, because "Aqua" was the name of an ancient
attempt for an OS X GUI that we scraped long time ago. Unfortunately
the name "aqua" is still in R for historical reasons and it is used
in several distinct meanings (somewhere it means Mac OS X platform,
elsewhere it means Cocoa,...), none of them being actually Aqua. (I
was trying to fix it before, but there is a lot of ancient code still
wedged in) - however, I hope this mess will go away in time for 2.5.0.
Cheers,
Simon
More information about the R-SIG-Mac
mailing list