JOGL on Ubuntu 15.04

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

JOGL on Ubuntu 15.04

Felipe S. Fernandes
I have a problem most of times that run JOGL on Ubuntu 15.04 and I'd now how to solve that.

Sometimes happens one or other of these shown in the pictures. Please, Help! That doesn't happens on Windows, only Linux.

(Weird Draw and Normal draw but without black background as it should be)

[img]http://i.imgur.com/rzl8Lwl.png[/img]

[img]http://i.imgur.com/IcSEQ3i.png[/img]
Reply | Threaded
Open this post in threaded view
|

Re: JOGL on Ubuntu 15.04

gouessej
Administrator
Hi

Please show us your source code. There is probably a problem in your own code as I have used JOGL under GNU Linux since 2006 without any problem but I rarely use Ubuntu. Ubuntu != Linux.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JOGL on Ubuntu 15.04

Felipe S. Fernandes
I ran the code on my job finely, and took it to my home, just changed classes now because it requires different libraries version.

Just showing this part because there are other classes, but that's same thing, just drawing the Vertex, but on a Loop from lists. I ran other examples and this happens, sadly

Code:

@Override
        public void display(GLAutoDrawable drawable) {
               
                GL2 gl = drawable.getGL().getGL2();
               
                gl.glColor3f(1, 0, 0);
                gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
               
                for(int a = 0; a < objects.size(); a++) objects.get(a).render(drawable);
               
                canvas.repaint();
        }
Reply | Threaded
Open this post in threaded view
|

Re: JOGL on Ubuntu 15.04

Felipe S. Fernandes
that's random, sometimes works normally with what I want and black background, sometimes nothing is shown, sometimes it show the as
bugged picture...
Reply | Threaded
Open this post in threaded view
|

Re: JOGL on Ubuntu 15.04

Xerxes Rånby
In reply to this post by Felipe S. Fernandes
The bug is in your code
the line
                gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
do not actually clear anything, it only specify which color to clear with
if you want to clear you need to call
               gl.glClear(GL.GL_COLOR_BUFFER_BIT);
https://www.khronos.org/opengles/sdk/1.1/docs/man/glClearColor.xml
https://www.khronos.org/opengles/sdk/1.1/docs/man/glClear.xml


2015-08-24 21:06 GMT+02:00 Felipe S. Fernandes [via jogamp] <
ml-node+s762907n4035126h69@n3.nabble.com>:

> I ran the code on my job finely, and took it to my home, just changed
> classes now because it requires different libraries version.
>
> Just showing this part because there are other classes, but that's same
> thing, just drawing the Vertex, but on a Loop from lists. I ran other
> examples and this happens, sadly
>
> Code:
>
> @Override
>         public void display(GLAutoDrawable drawable) {
>
>                 GL2 gl = drawable.getGL().getGL2();
>
>                 gl.glColor3f(1, 0, 0);
>                 gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
>
>                 for(int a = 0; a < objects.size(); a++)
> objects.get(a).render(drawable);
>
>                 canvas.repaint();
>         }
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://forum.jogamp.org/JOGL-on-Ubuntu-15-04-tp4035124p4035126.html
> To start a new topic under jogl, email
> ml-node+s762907n782158h61@n3.nabble.com
> To unsubscribe from jogamp, click here
> <http://forum.jogamp.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=762907&code=eGVyeGVzQGd1ZGlubmEuY29tfDc2MjkwN3wtNTE5NjUwMzEw>
> .
> NAML
> <http://forum.jogamp.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
Reply | Threaded
Open this post in threaded view
|

Re: JOGL on Ubuntu 15.04

gouessej
Administrator
In reply to this post by Felipe S. Fernandes
You could have tested our most basic example before claiming that there is a bug in JOGL ;)

https://gist.github.com/gouessej/3420e2b6f632efdddf98

Next time, please provide a full example like the one above. Imagine that the bug isn't where you expect to find it.

Are you sure that you need to call canvas.repaint() in display()?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JOGL on Ubuntu 15.04

Felipe S. Fernandes
Its solved, I dont remember what I did, but I followed your tips above, so Thank You!

Working fine now!
Reply | Threaded
Open this post in threaded view
|

Re: JOGL on Ubuntu 15.04

gouessej
Administrator
You're welcome.

Reminder: Your example uses the fixed pipeline whereas it isn't future proof as it has been removed from forward compatible profiles in OpenGL, I advise you to have a look at elect's example too.
Julien Gouesse | Personal blog | Website