Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inter process NSView sharing



This is not really an answer to your question, but here's an alternative architecture that might meet your requirements:

1) Have the C application create a pbuffer hardware-accelerated OpenGL context (see the recent thread "GL Context for Quicklook generators" some some sample code, or on ADC).
2) Send rendered frames to the Java application through some IPC mechanism
3) Blit received frames in the Java application to the Java window.

As far as the IPC part is concerned, I'd try to use a Mach port, shared memory, or perhaps a plain-old UNIX domain socket.

On May 23, 2008, at 10:16, Jonathan Cochrane wrote:

Hi


I have 2 applications, one is written in java, the other in C. For reasons I wont go into to I need to have the C application perform hardware accelerated opengl rendering to a window created by the Java application.

This is currently working on Windows. On this platform the java application sends the hwnd of the java canvas to the C application via a bridge. The C application then creates an opengl rendering context using this hwnd and all is fine.

Now, on OSX the java app gets a NSView/cocoaviewref. Is there some member of NSView similar to the HWND on windows that I can pass to my C process? The C process can then create a hardware accelerated opengl rendering context from this 'handle' and render to the java apps NSView.

I've looked at using Distributed Objects, however the C application would need quite a bit of rework to make it fit into the Cocoa application framework, so this is not an option. So, can a non cocoa application communicate with a distributed object ?

If distributed objects are not the way to go, I presume there must be another way to do it as I've seen reference to NSWindowSharingReadWrite in the apple dev docs. If I use the setSharingType approach, what does my C application need to be able to create a rendering context on the java applications shared window. Perhaps there is some way to access this window using the OSX window server API ?

many thanks

Jonathan _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden

References: 
 >inter process NSView sharing (From: "Jonathan Cochrane" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.