Summary: | GLCanvas flickers and displays its background or its scene alternately | ||
---|---|---|---|
Product: | [JogAmp] Jogl | Reporter: | Cyrille <cdefranoux> |
Component: | awt | Assignee: | Sven Gothel <sgothel> |
Status: | VERIFIED FIXED | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 2 | ||
Hardware: | pc_x86_32 | ||
OS: | windows | ||
Type: | --- | SCM Refs: |
86c164950b0a0d351fc8af3884187b10201b6237
|
Workaround: | --- | ||
Attachments: |
Runtime Version Check output, ran for all entries that appear in the test.bat script.
Update Main.java to work properly |
the JOGL version in your test log is ce3508aa66b9a40974cce2988094d0edc68b30f4 tag is v2.0-rc1 ie the signed rc. But your code would not compile with it, since it uses a GLProfile API before 774138544e1eec3330309ad682fa05154a07ab8d 2010-10-14 21:26:43 The GLProfile API has changed with that commit, well, I fixed that. +++ Thanks to your report, I have revalidated the Java2D and AWT properties, please check JOGL: 86c164950b0a0d351fc8af3884187b10201b6237, especially the added doc: http://jogamp.org/git/?p=jogl.git;a=blob;f=src/jogl/classes/javax/media/opengl/awt/GLCanvas.java;h=b230a2b6aa529aa69e8f5f5f47dcd6da2c585edb;hb=86c164950b0a0d351fc8af3884187b10201b6237#l79 Hope all of this helps, thank you. Created attachment 183 [details]
Update Main.java to work properly
> The GLProfile API has changed with that commit, well, I fixed that. You're right. I really tested the code against Jogl rc1 but I think I put the wrong code in my bug report. Sorry for the confusion. > Thanks to your report, I have revalidated the Java2D and AWT properties, > please check JOGL: 86c164950b0a0d351fc8af3884187b10201b6237, > especially the added doc: > > http://jogamp.org/git/?p=jogl.git;a=blob;f=src/jogl/classes/javax/media/opengl/awt/GLCanvas.java;h=b230a2b6aa529aa69e8f5f5f47dcd6da2c585edb;hb=86c164950b0a0d351fc8af3884187b10201b6237#l79 > > Hope all of this helps, thank you. Great, thanks for this fix. I'll have a look at it as soon as I can. At last, I could take a few minutes to test your fix. I ran the test with the autobuild of the 12/16/2010 (build 259). And... it runs perfectly! Thanks! |
Created attachment 180 [details] Runtime Version Check output, ran for all entries that appear in the test.bat script. Without animator, GLCanvas does not constantly display its OpenGL scene. It displays either its component background or the scene. To reproduce the bug, please run the test application below. When the frame is being resized by dragging its edge over, the canvas flickers between yellow and red (resp. its background and its scene). When the resize operation ends, it randomly leaves the canvas in either configuration (yellow or red). I only reproduced that bug on a Win32 platform but I did not try any other platform. I can't objectively assume it but it may be reproducable on every platform as well. Sample code to reproduce the bug: package GLSLTest; import java.awt.Color; import java.awt.Component; import java.awt.Frame; import javax.media.opengl.GL; import javax.media.opengl.GL2; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLEventListener; import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; import javax.swing.BoxLayout; public class Main { static CanvasListener listener = new CanvasListener(); public static void main(String[] args) { GLProfile.initSingleton(); GLProfile profile = GLProfile.getMaxFixedFunc(); GLCapabilities caps = new GLCapabilities(profile); GLCanvas canvas = new GLCanvas(caps); canvas.setBackground(Color.yellow); canvas.addGLEventListener(listener); Frame topLevelFrame = new Frame(); topLevelFrame.setLayout(new BoxLayout(topLevelFrame, BoxLayout.Y_AXIS)); topLevelFrame.add(canvas); topLevelFrame.setSize(400, 300); topLevelFrame.setVisible(true); // Animator animator = new Animator(canvas); // animator.start(); canvas.display(); } } class CanvasListener implements GLEventListener { @Override public void display(GLAutoDrawable arg0) { GL2 gl = arg0.getGL().getGL2(); gl.glClearColor(1.0f, 0.0f, 0.0f, 0.5f); gl.glClear(GL.GL_COLOR_BUFFER_BIT); System.out.println("display"); } @Override public void dispose(GLAutoDrawable arg0) { } @Override public void init(GLAutoDrawable arg0) { Component canvas = (Component) arg0; System.out.println(canvas.getSize().toString()); } @Override public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) { } }