GLCanvas Full Screen Cannot see in Teamviewer

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

GLCanvas Full Screen Cannot see in Teamviewer

robbiezl
I use a win8 System pad(Use software Teamviewer7.0) remote control my Program(this program runs on a laptop,Intel i5 and NV GT640 ,4G memory).
Everything sees show well in the remote client on Pad.
But when the JFrame of my program set to full screen,I can not see the GLCanvas on the Pad. If I change JFrame to normal,I see the GLCanvas again.

On the laptop,either fullscreen or not,the GLCanvas is show,the program runs well.

I change GLCanvas fullscreen use the code below:

                baseFrame.dispose();

                baseFrame.setVisible(false);


       
                baseFrame.setUndecorated(true);

               
                baseFrame.getRootPane().setWindowDecorationStyle(JRootPane.NONE);

               
                baseFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);


               
                SwingUtilities.invokeLater(new Runnable(){
                        public void run() {
                                baseFrame.setVisible(true);
                        }
                });



This situation confused  me a lot.

Sorry for my poor English.I do not know if I say the problem clearly.
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

gouessej
Administrator
Hi

Disable the Direct3D Java2D pipeline which may cause some troubles under Windows. If it doesn't fix this bug, please try to reproduce it with java.awt.Canvas so that we know better its root cause (Swing, AWT or JOGL). Is your laptop under Windows 8 too? Maybe it has something to do with Teamviewer.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

robbiezl
I tried -Dsun.java2d.d3d=false and -Dsun.java2d.noddraw=true,it still looks wrong in Teamviewer7.

I have tried the java.awt.Canvas,in the BorderLayout,it looks OK when full screen in Teamviewer7.

My laptop is Win8 pro too.

I will download the new version of Teamviewer8 which support Win8 Systmen and have a try!
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

robbiezl
In reply to this post by gouessej
The GLCanvas stii cannot show when fullscreen in Teamviewer8.
I choose another PC which is Windows  XP system, it has the same problem.I do not think it has a relation with the Win8 System.

My Example code:


package app;

import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;

import javax.media.opengl.awt.GLCanvas;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JRootPane;
import javax.swing.SwingUtilities;


public class TestFrame extends JFrame{

        private JPanel jMainPanel = null;
        private JPanel jCenterPanel = null;
        private GLCanvas glCanvas = null;
        private Canvas awtCanvas=null;

        /**
         * This method initializes
         *
         */
        public TestFrame() {
                super();
                initialize();
        }

        /**
         * This method initializes this
         *
         */
        private void initialize() {
        this.setSize(new Dimension(739, 512));
        this.setContentPane(getJMainPanel());
                this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                this.setLocation(500, 500);
        }

        /**
         * This method initializes jMainPanel
         *
         * @return javax.swing.JPanel
         */
        private JPanel getJMainPanel() {
                if (jMainPanel == null) {
                        jMainPanel = new JPanel();
                        jMainPanel.setLayout(new BorderLayout());
                        jMainPanel.add(getJCenterPanel(), BorderLayout.CENTER);
                }
                return jMainPanel;
        }

        /**
         * This method initializes jCenterPanel
         *
         * @return javax.swing.JPanel
         */
        private JPanel getJCenterPanel() {
                if (jCenterPanel == null) {
                        jCenterPanel = new JPanel();
                        jCenterPanel.setLayout(new BorderLayout());
                        //jCenterPanel.add(getGLCanvas(), BorderLayout.CENTER);
                        jCenterPanel.add(getAWTCanvas(), BorderLayout.CENTER);
                       
                       
                }
                return jCenterPanel;
        }

        /**
         * This method initializes jViewPanel
         *
         * @return javax.swing.JPanel
         */
        public GLCanvas getGLCanvas() {
                if (glCanvas == null) {
                        glCanvas=new GLCanvas();
                        glCanvas.setBackground(Color.GREEN);
                }
                return glCanvas;
        }
       
        public Canvas getAWTCanvas() {
                if (awtCanvas == null) {
                        awtCanvas=new Canvas();
                        awtCanvas.setBackground(Color.RED);
                }
                return awtCanvas;
        }
       
       
        public static void main(String[] args) {
                TestFrame aa=new TestFrame();
                aa.setVisible(true);
                switchFullScreen(aa);
        }
       
        public static void switchFullScreen(final JFrame baseFrame){

                baseFrame.dispose();

                baseFrame.setVisible(false);

                baseFrame.setUndecorated(true);

                baseFrame.getRootPane().setWindowDecorationStyle(JRootPane.NONE);

                baseFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);

                SwingUtilities.invokeLater(new Runnable(){
                        public void run() {
                                baseFrame.setVisible(true);
                        }
                });
        }
       
}  //  @jve:decl-index=0:visual-constraint="10,10"
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

gouessej
Administrator
Actually, you use software simulated full screen mode, which is not guaranteed to work. Rather use exclusive full screen mode (which doesn't work fine under GNU Linux with KDE 4). If you really need a working full screen toggle everywhere, switch to NEWT.

Edit.: I had a similar problem in the past. When you dispose the container, it destroys the OpenGL context linked to GLCanvas. It can't work. I remembered it worked with a plain java.awt.Canvas but not with GLCanvas. Try to use NewtCanvasAWT or GLWindow and use GLWindow.setFullscreen(true).
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

robbiezl
The program is a swing project,so it may not be easily to use NEWT.
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

robbiezl
In reply to this post by gouessej
I found it may by Team viewer problem.When I set the Microsoft Media Center full screen,I can not see it from the Pad.
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

gouessej
Administrator
In reply to this post by robbiezl
You can mix Swing and AWT with NEWT. The situation will be better when we have at least a separate Swing implementation or a JavaFX pipeline fully based on JOGL 2.0.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

robbiezl
In my project I use the picking model from the gleem demo.It is designed for GLJPanel and GLCanvas.I tried to modify it work well with the GLWindow,but I failed.
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

gouessej
Administrator
Rather use software picking implemented in existing engines, it is more reliable.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

robbiezl
can U give me some advice of the picking implemented in existing engines
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

robbiezl
In reply to this post by gouessej
gouessej wrote
You can mix Swing and AWT with NEWT. The situation will be better when we have at least a separate Swing implementation or a JavaFX pipeline fully based on JOGL 2.0.
is there a method to translate awt.MouseEvent to com.jogamp.newt.event.MouseEvent in JOGL rc 10?



Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

gouessej
Administrator
robbiezl wrote
can U give me some advice of the picking implemented in existing engines
Ardor3D has some software picking, but you have to use only triangles (which is not a bad thing as it's faster).

robbiezl wrote
gouessej wrote
You can mix Swing and AWT with NEWT. The situation will be better when we have at least a separate Swing implementation or a JavaFX pipeline fully based on JOGL 2.0.
is there a method to translate awt.MouseEvent to com.jogamp.newt.event.MouseEvent in JOGL rc 10?
Please use the latest version of JOGL (RC 11 now). Have you looked at com.jogamp.newt.event.awt.AWTMouseAdapter?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLCanvas Full Screen Cannot see in Teamviewer

robbiezl
This post was updated on .
gouessej wrote
robbiezl wrote
can U give me some advice of the picking implemented in existing engines
Ardor3D has some software picking, but you have to use only triangles (which is not a bad thing as it's faster).

robbiezl wrote
gouessej wrote
You can mix Swing and AWT with NEWT. The situation will be better when we have at least a separate Swing implementation or a JavaFX pipeline fully based on JOGL 2.0.
is there a method to translate awt.MouseEvent to com.jogamp.newt.event.MouseEvent in JOGL rc 10?
Please use the latest version of JOGL (RC 11 now). Have you looked at com.jogamp.newt.event.awt.AWTMouseAdapter?
Thank you for your help.

Sorry,it is my fault ,I want to find a method to translate from com.jogamp.newt.event.MouseEvent to awt.MouseEvent

I have read the souce code of AWTNewtEventFactory.java ,have the method translate  awt.MouseEvent to com.jogamp.newt.event.MouseEvent,but not have the reverse method.

For example:

public void mouseWheelMoved(com.jogamp.newt.event.MouseEvent arg0) {      this.mouseWheelMoved(convertNEWTMouseEvent2AWTMouseWheelEvent(arg0,this.browserPanel.getRealCanvas()));
        }