Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » problem with JOGL in RCP
problem with JOGL in RCP [message #446505] Tue, 21 March 2006 12:52 Go to next message
Eclipse UserFriend
Originally posted by: vze3gfkr.verizon.net

Hi
I am trying create a view in my RCP program that can display an opengl
view. I have the tried the code snippet 209 and everything works well.
however I cannot seem to get this to work under my RCP program. within
the view class I have added the following code under the
createPartControl method.



public void createPartControl(Composite parent) {

parent.setLayout(new FillLayout());


GLData data = new GLData ();
data.doubleBuffer = true;


final GLCanvas canvas = new GLCanvas(parent.getShell(), SWT.NONE, data);
canvas.setCurrent();

final GLContext
context=GLDrawableFactory.getFactory().createExternalGLConte xt();


initialize3DWindow(context,canvas); // initialize the 3D window
create3DWindow(context,canvas); // draw the 3D object

}

The code compiles fine but i don't see anything. Is there any code
examples on how to do this with RCP or any documentation. Any help would
be greatly appreciated.

thanks
Fintan Mac Cormack
Re: problem with JOGL in RCP [message #446645 is a reply to message #446505] Wed, 22 March 2006 17:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dittmar.steiner.web.de

Hi Finatan,

although I don't have experience with JOGL, in my oppinion it could be a problem with the composite hierachy.
Please try to simply insert a Composite:
> public void createPartControl(Composite parent) {
Composite top = new Composite(parent, SWT.NONE);
top.setLayout(new FillLayout());

But I may be totally wrong. I took this code from a project where I create the content for an EditorPart.

best regards
Dittmar
Re: problem with JOGL in RCP [message #446649 is a reply to message #446505] Wed, 22 March 2006 19:39 Go to previous messageGo to next message
Stepan Rutz is currently offline Stepan RutzFriend
Messages: 52
Registered: July 2009
Member
Hi,
any errors about missing native libs in your .log ?

/Stepan
Re: problem with JOGL in RCP [message #446652 is a reply to message #446645] Wed, 22 March 2006 20:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vze3gfkr.verizon.net

Hi Dittmar
I tried what you suggested but the view still does not display the 3D
image. I am able to get the program to partially work by changing the
code to the following.

public void createPartControl(Composite parent) {

Shell shell = parent.getShell();
shell.setLayout(parent.getLayout());

GLData data = new GLData ();
data.doubleBuffer = true;


final GLCanvas canvas = new GLCanvas(shell, SWT.BORDER, data);
canvas.setCurrent();


final GLContext
context=GLDrawableFactory.getFactory().createExternalGLConte xt();

shell.open();

initialize3DWindow(context,canvas); // initialize the 3D
window
create3DWindow(context,canvas); // draw the 3D object


}

However this messes up the remainder of the gui such as menubar coolbar
etc. however i am able to see part of the 3D image. Also the code only
works when i add the line

shell.open();

regards
fintan



Dittmar Steiner wrote:
> Hi Finatan,
>
> although I don't have experience with JOGL, in my oppinion it could be a
> problem with the composite hierachy.
> Please try to simply insert a Composite:
>> public void createPartControl(Composite parent) {
> Composite top = new Composite(parent, SWT.NONE);
> top.setLayout(new FillLayout());
>
> But I may be totally wrong. I took this code from a project where I
> create the content for an EditorPart.
>
> best regards
> Dittmar
Re: problem with JOGL in RCP [message #446653 is a reply to message #446649] Wed, 22 March 2006 20:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vze3gfkr.verizon.net

Thanks
for the reply Stephen i dont see any message in the error log.

regards
fintan

Stepan Rutz wrote:
> Hi,
> any errors about missing native libs in your .log ?
>
> /Stepan
>
Re: problem with JOGL in RCP [message #446654 is a reply to message #446652] Wed, 22 March 2006 20:57 Go to previous messageGo to next message
Stepan Rutz is currently offline Stepan RutzFriend
Messages: 52
Registered: July 2009
Member
Hi,

you seem to be messing around with the Shell of Eclipse. The shell is a
the desktop-window of your eclipse rcp/ide. It's not a good idea to mess
around with it.

Have you tried to remove all these calls to the shell and just do the
following:


public void createPartControl(Composite parent) {
GLData data = new GLData ();
data.doubleBuffer = true;
final GLCanvas canvas = new GLCanvas(parent, SWT.BORDER, data);
canvas.setCurrent();
final GLContext
context=GLDrawableFactory.getFactory().createExternalGLConte xt();
initialize3DWindow(context,canvas); // initialize the 3D
create3DWindow(context,canvas); // draw the 3D object
}

Note that I pass "parent" to the GLCanvas constructor, not
parent.getShell().
parent.getShell() is something you want to leave alone.

Regards,
Stepan

fintan Mac Cormack wrote:

> Hi Dittmar
> I tried what you suggested but the view still does not display the 3D
> image. I am able to get the program to partially work by changing the
> code to the following.

> public void createPartControl(Composite parent) {

> Shell shell = parent.getShell();
> shell.setLayout(parent.getLayout());

> GLData data = new GLData ();
> data.doubleBuffer = true;


> final GLCanvas canvas = new GLCanvas(shell, SWT.BORDER, data);
> canvas.setCurrent();


> final GLContext
> context=GLDrawableFactory.getFactory().createExternalGLConte xt();

> shell.open();

> initialize3DWindow(context,canvas); // initialize the 3D
> window
> create3DWindow(context,canvas); // draw the 3D object


> }

> However this messes up the remainder of the gui such as menubar coolbar
> etc. however i am able to see part of the 3D image. Also the code only
> works when i add the line

> shell.open();

> regards
> fintan



> Dittmar Steiner wrote:
>> Hi Finatan,
>>
>> although I don't have experience with JOGL, in my oppinion it could be a
>> problem with the composite hierachy.
>> Please try to simply insert a Composite:
>>> public void createPartControl(Composite parent) {
>> Composite top = new Composite(parent, SWT.NONE);
>> top.setLayout(new FillLayout());
>>
>> But I may be totally wrong. I took this code from a project where I
>> create the content for an EditorPart.
>>
>> best regards
>> Dittmar
Re: problem with JOGL in RCP [message #446655 is a reply to message #446654] Wed, 22 March 2006 21:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vze3gfkr.verizon.net

Hi Stephen I tried your example but still no luck.

regards
fintan


Stepan Rutz wrote:
>
> Hi,
>
> you seem to be messing around with the Shell of Eclipse. The shell is a
> the desktop-window of your eclipse rcp/ide. It's not a good idea to mess
> around with it.
>
> Have you tried to remove all these calls to the shell and just do the
> following:
>
>
> public void createPartControl(Composite parent) {
> GLData data = new GLData ();
> data.doubleBuffer = true;
> final GLCanvas canvas = new GLCanvas(parent, SWT.BORDER, data);
> canvas.setCurrent();
> final GLContext
> context=GLDrawableFactory.getFactory().createExternalGLConte xt();
> initialize3DWindow(context,canvas); // initialize the 3D
> create3DWindow(context,canvas); // draw the 3D object
> }
>
> Note that I pass "parent" to the GLCanvas constructor, not
> parent.getShell(). parent.getShell() is something you want to leave alone.
>
> Regards,
> Stepan
>
> fintan Mac Cormack wrote:
>
>> Hi Dittmar
>> I tried what you suggested but the view still does not display the 3D
>> image. I am able to get the program to partially work by changing the
>> code to the following.
>
>> public void createPartControl(Composite parent) {
>
>> Shell shell = parent.getShell();
>> shell.setLayout(parent.getLayout());
>
>> GLData data = new GLData ();
>> data.doubleBuffer = true;
>
>
>> final GLCanvas canvas = new GLCanvas(shell, SWT.BORDER, data);
>> canvas.setCurrent();
>
>
>> final GLContext
>> context=GLDrawableFactory.getFactory().createExternalGLConte xt();
>
>> shell.open();
>
>> initialize3DWindow(context,canvas); // initialize the 3D
>> window
>> create3DWindow(context,canvas); // draw the 3D object
>
>
>> }
>
>> However this messes up the remainder of the gui such as menubar
>> coolbar etc. however i am able to see part of the 3D image. Also the
>> code only works when i add the line
>
>> shell.open();
>
>> regards
>> fintan
>
>
>
>> Dittmar Steiner wrote:
>>> Hi Finatan,
>>>
>>> although I don't have experience with JOGL, in my oppinion it could
>>> be a problem with the composite hierachy.
>>> Please try to simply insert a Composite:
>>>> public void createPartControl(Composite parent) {
>>> Composite top = new Composite(parent, SWT.NONE);
>>> top.setLayout(new FillLayout());
>>>
>>> But I may be totally wrong. I took this code from a project where I
>>> create the content for an EditorPart.
>>>
>>> best regards
>>> Dittmar
>
>
>
Re: problem with JOGL in RCP [message #447528 is a reply to message #446505] Sun, 09 April 2006 17:32 Go to previous messageGo to next message
Ludovico Cellentani is currently offline Ludovico CellentaniFriend
Messages: 2
Registered: July 2009
Junior Member
Hi Fintan and to everyone in the forum

I'm trying to build a RCP application that should use jogl package to open a OpenGL View.
Reading your post, I supposed that you managed to setup correctly RCP to interact with jogl, even if then you have got problems.

Please, could you report the procedure you used to setup you RCP application with jogl package?


I try this

1) I created 2 folder /lib and /native in the root application folder (at the same level of plugin.xml file)
2) then I added the jogl.jar file in the Java Build Path/Library with the Native Library Location pointed to the <application>/native folder (but I read that this doesn't work in RCP, is correct?)
3) I add the Bundle-NativeCode in the MANIFEST.MF
4) I check the /lib and /native folder in the Build/Binary Build tab (I can see the 2 folder in the jar generated)

When I build all is ok, but at runtime when I made the first call to a jogl method I got this error
java.lang.NoClassDefFoundError: javax/media/opengl/GLDrawableFactory

So it's clear that the application cannot resolve the class.

At runtime I added this test code just to see if the library is correctly added/loaded:

[this is a method of a generic view]
public void createPartControl(Composite parent)
{
GLData data = new GLData ();
data.doubleBuffer = true;
final GLCanvas canvas = new GLCanvas(parent, SWT.NONE, data);
canvas.setCurrent();
final GLContext ctx = GLDrawableFactory.getFactory().createExternalGLContext();
}

Any help is welcome
Thanks all for the attention
Cheers
Ludovico Cellentani
Re: problem with JOGL in RCP [message #447589 is a reply to message #447528] Tue, 11 April 2006 12:46 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

http://eclipsewiki.editme.com/PDEFaq - use this list to add 3rd party
libraries to a plugin.

If you find yourself using Java Build Path>Libraries tab, it won't work.

Later,
PW


Re: problem with JOGL in RCP [message #447731 is a reply to message #447589] Thu, 13 April 2006 16:55 Go to previous message
Ludovico Cellentani is currently offline Ludovico CellentaniFriend
Messages: 2
Registered: July 2009
Junior Member
Thanks for you reply

I will take a look! :)))

Ludovico Cellentani
Previous Topic:how to export an plug-in by ant build?
Next Topic:How to register action in EditorActionBarContributor
Goto Forum:
  


Current Time: Wed Dec 11 20:23:53 GMT 2024

Powered by FUDForum. Page generated in 0.04354 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top