Bugzilla – Attachment 823 Details for
Bug 1395
Resizing GLCanvas does not redraw immediately
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Reproducer
OpenGLTest.java (text/plain), 1.82 KB, created by
morgan.mathiaut
on 2019-09-24 14:26:20 CEST
(
hide
)
Description:
Reproducer
Filename:
MIME Type:
Creator:
morgan.mathiaut
Created:
2019-09-24 14:26:20 CEST
Size:
1.82 KB
patch
obsolete
>import static com.jogamp.opengl.GL2ES3.GL_COLOR; >import static com.jogamp.opengl.GL2ES3.GL_DEPTH; > >import java.nio.FloatBuffer; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >import com.jogamp.opengl.GL4; >import com.jogamp.opengl.GLAutoDrawable; >import com.jogamp.opengl.GLEventListener; >import com.jogamp.opengl.swt.GLCanvas; >import com.jogamp.opengl.util.GLBuffers; > >public class OpenGLTest extends GLCanvas implements GLEventListener >{ > > public static void main(String[] args) > { > final Display display = new Display(); > final Shell shell = new Shell(display, SWT.RESIZE | SWT.MAX | SWT.CLOSE); > shell.setSize(700, 600); > shell.setText("Simple SWT viewer"); > shell.setLayout(new FillLayout(SWT.VERTICAL)); > > new OpenGLTest(shell, SWT.NONE); > > shell.open(); > while ( !shell.isDisposed() ) > { > if ( !display.readAndDispatch() ) > display.sleep(); > } > display.dispose(); > } > > private OpenGLTest(final Composite parent, final int style) > { > super(parent, SWT.NO_MERGE_PAINTS, null, null); > 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); > FloatBuffer clearDepth = GLBuffers.newDirectFloatBuffer(1); > > gl.glClearBufferfv(GL_COLOR, 0, clearColor.put(0, 1f).put(1, .5f).put(2, 0f).put(3, 1f)); > gl.glClearBufferfv(GL_DEPTH, 0, clearDepth.put(0, 1f)); > > // redraw(); > } > > @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 1395
: 823