Bugzilla – Attachment 801 Details for
Bug 1361
Remove Flickering when resizing a Newt Window
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Reproducer with correct Animator
NewtTest.java (text/x-java), 2.19 KB, created by
Charles Huet
on 2019-02-01 15:30:06 CET
(
hide
)
Description:
Reproducer with correct Animator
Filename:
MIME Type:
Creator:
Charles Huet
Created:
2019-02-01 15:30:06 CET
Size:
2.19 KB
patch
obsolete
>import static com.jogamp.opengl.GL2ES3.GL_COLOR; > >import java.awt.BorderLayout; >import java.nio.FloatBuffer; > >import javax.swing.JFrame; >import javax.swing.JPanel; > >import com.jogamp.newt.awt.NewtCanvasAWT; >import com.jogamp.newt.opengl.GLWindow; >import com.jogamp.opengl.GL4; >import com.jogamp.opengl.GLAutoDrawable; >import com.jogamp.opengl.GLCapabilities; >import com.jogamp.opengl.GLEventListener; >import com.jogamp.opengl.GLProfile; >import com.jogamp.opengl.util.Animator; >import com.jogamp.opengl.util.GLBuffers; > >public class NewtTest extends NewtCanvasAWT implements GLEventListener >{ > private static final long serialVersionUID = 1667724932451812449L; > > protected GLWindow m_glWindow; > > public static void main(String[] args) > { > JFrame mainFrame = new JFrame("Newt test"); > > JPanel panel = new JPanel(new BorderLayout()); > mainFrame.add(panel); > > GLProfile profile = GLProfile.getDefault(); > > final GLCapabilities glCapabilities = new GLCapabilities(profile); > glCapabilities.setBackgroundOpaque(false); > glCapabilities.setDoubleBuffered(true); > glCapabilities.setHardwareAccelerated(true); > glCapabilities.setStereo(false); > glCapabilities.setDepthBits(24); > glCapabilities.setStencilBits(8); > glCapabilities.setSampleBuffers(false); > glCapabilities.setNumSamples(0); > glCapabilities.setAlphaBits(8); > > GLWindow m_glWindow = GLWindow.create(glCapabilities); > > panel.add(new NewtTest(m_glWindow)); > > final Animator animator = new Animator(m_glWindow); > animator.setRunAsFastAsPossible(true); > animator.start(); > > mainFrame.pack(); > mainFrame.setVisible(true); > } > > private NewtTest(GLWindow window) > { > super(window); > window.addGLEventListener(this); > } > > @Override > public void init(GLAutoDrawable drawable) > {} > > @Override > public void dispose(GLAutoDrawable drawable) > {} > > @Override > public void display(GLAutoDrawable drawable) > { > GL4 gl = drawable.getGL().getGL4(); > FloatBuffer clearColor = GLBuffers.newDirectFloatBuffer(4); > gl.glClearBufferfv(GL_COLOR, 0, clearColor.put(0, 0f).put(1, 1.0f).put(2, 0f).put(3, 1f)); > } > > @Override > public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) > {} >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1361
:
800
| 801