Author Topic: jPCT in Eclipse RCP View  (Read 4155 times)

Offline sabus

  • byte
  • *
  • Posts: 2
    • View Profile
jPCT in Eclipse RCP View
« on: May 25, 2009, 04:30:12 pm »
Hello,

I started a project that needs to include a 3D screen inside an Eclipse RCP application using Views. I started with the example in http://www.jpct.net/forum2/index.php?topic=343.0 and successfully got jPCT to run within an RCP application. Unfortunately, not within a View component.

The problem is, that the 3d world is rendered as an external window, and not as hoped inside the RCP view:




I guess, the reason must be the call of the FrameBuffer, wich is the one as in the example:

private void init() {
   canvas.setCurrent();
   
   try {
      GLContext.useContext(canvas);
   } catch (LWJGLException e) {
      e.printStackTrace();
   }

   buffer = new FrameBuffer(640, 480, FrameBuffer.SAMPLINGMODE_NORMAL);
   buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
   buffer.enableRenderer(IRenderer.RENDERER_OPENGL);
}



Furthermore, the render() function is called on every SWT.Paint and SWT.Resize event and is

private void render() {
   buffer.clear();
   world.renderScene(buffer);
   world.draw(buffer);
   buffer.update();
   buffer.displayGLOnly();
   canvas.swapBuffers();
}



Has anyone experience with this behaviour?

Thanks in advance.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: jPCT in Eclipse RCP View
« Reply #1 on: May 25, 2009, 05:54:50 pm »
Did you set http://www.jpct.net/doc/com/threed/jpct/Config.html#glSkipInitialization to true before enabling the GLRenderer?

Offline sabus

  • byte
  • *
  • Posts: 2
    • View Profile
Re: jPCT in Eclipse RCP View
« Reply #2 on: May 28, 2009, 05:32:32 pm »
Thanks for the tip! :) Setting

  Config.glSkipInitialization = true;

renders the 3d world into the RCP view.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: jPCT in Eclipse RCP View
« Reply #3 on: May 28, 2009, 11:51:14 pm »
Cool! What's the exact purpose of having a 3d view inside eclipse. It sounds interesting.