[eq-dev] Newbie Question: Multiple Mac OpenGL APIs

1 view
Skip to first unread message

Stephen Furlani

unread,
Dec 30, 2009, 2:28:17 PM12/30/09
to eq-...@equalizergraphics.com

Hello,

I seem to be flooding the list with questions, sorry.

I'm having a bit of difficulty resolving all these different OpenGL APIs on
the Mac OS. The program I want to edit to put on Equalizer normally renders
to an NSOpenGLView. NSOpenGLView has a NSOpenGLContext. But the program
renders everything through a CGLContext: (I'm paraphrasing the code)

CGLContextObj *cgl_ctx = [[NSOpenGLView getContext] getCGLContext];
[cgl_ctx makeCurrentContext];
glBegin(...);
glFinish(...);

If I want it to use Equalizer I should do something similar to this?

CGLContextObj *cgl_ctx = aglCreateCGLContext( someFunction(), ... );
[cgl_ctx makeCurrentContext];
glBegin(...);
glFinish(...);

where someFunction() goes out and returns a pointer to a RenderContext
(provided I setup my nodes, channels, windows, etc. correctly).

Since OpenGL is a state machine, if I set some glContext to be the
CurrentContext, it shouldn't matter what context it is. Equalizer then
handles the subsequent OpenGL calls to its RenderContext.

Do I have it right? Is there more refactoring that needs doing assuming
I've setup my Client, Server, Pipes, Nodes etc correctly?

Thanks,

-Stephen Furlani

--
View this message in context: http://n2.nabble.com/Newbie-Question-Multiple-Mac-OpenGL-APIs-tp4233648p4233648.html
Sent from the Equalizer - Parallel Rendering mailing list archive at Nabble.com.

_______________________________________________
eq-dev mailing list
eq-...@equalizergraphics.com
http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
http://www.equalizergraphics.com

Stefan Eilemann

unread,
Jan 4, 2010, 5:17:59 AM1/4/10
to eq-...@equalizergraphics.com

On 30. Dec 2009, at 20:28, Stephen Furlani [via Software] wrote:

> I seem to be flooding the list with questions, sorry.

It's the right place, no worries.

> I'm having a bit of difficulty resolving all these different OpenGL APIs on the Mac OS.  The program I want to edit to put on Equalizer normally renders to an NSOpenGLView.  NSOpenGLView has a NSOpenGLContext.  But the program renders everything through a CGLContext: (I'm paraphrasing the code)

> Since OpenGL is a state machine, if I set some glContext to be the CurrentContext, it shouldn't matter what context it is.  Equalizer then handles the subsequent OpenGL calls to its RenderContext.
>
> Do I have it right?

Yes.

>  Is there more refactoring that needs doing assuming I've setup my Client, Server, Pipes, Nodes etc correctly?

We are not yet supporting NSGL/Cocoa, but it should be fairly easy to implement. You need to implement the OSPipe and GLWindow interfaces with the correct code to keep Eq happy, mainly OSWindow::configInit, makeCurrent and swapBuffers should do the correct thing. The OSPipe has to set the pixel viewport on its eq::Pipe.


HTH,

Stefan.

View this message in context: Re: [eq-dev] Newbie Question: Multiple Mac OpenGL APIs
Reply all
Reply to author
Forward
0 new messages