Hi, all.
I would like to achieve the following, and don’t know if it’s possible.
I want to write a native Mac OS X Cocoa application (the problem can be generalized to any platform).
The light-weight front-end would be implemented in Cocoa, possibly using NSOpenGLView for rendering.
The back-end would be implemented in Java, featuring rendering through JOGL.
The glue would be JNI.
Now, assume that one of the methods in Java, which would be exposed as C function through JNI would be named renderFrame()
. Assume, that the C function would be called within -(void)drawRect:(NSRect)
method of NSOpenGLView (or in general on current GL thread).
The question is: will following implementation of the Java method perform rendering on current GL thread in C, and as a consequence on NSOpenGLView?
void render() {
GLContext glContext = GLContext.getCurrent();
GL gl = glContext.getGL();
/* ... perform rendering here on retrieved instance of GL ... */
}
Regards,
Michal.