OpenGL SWT Snippet render thread [message #450744] |
Thu, 17 February 2005 09:59  |
Eclipse User |
|
|
|
In the OpenGL SWT Snippet (Snippet174.java) a separate thread
calls render every 50ms. I thought at first that this might be an
animation thread, but the Quad that gets rendered appears to be static.
(The OpenGLExample appears to follow the same pattern.)
Is there a reason for constantly rendering in this way, even though
the window is not being damage/overlapped, as opposed to calling render
through a PaintEvent? E.g
canvas.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent e) {
render();
context.swapBuffers();
}
});
Trying this out on Windows (and commenting out the Runnable) seems
to work fine. Perhaps the Runnable is need for other platforms?
|
|
|
Re: OpenGL SWT Snippet render thread [message #450746 is a reply to message #450744] |
Thu, 17 February 2005 10:41  |
Eclipse User |
|
|
|
Asim Ullah wrote:
> In the OpenGL SWT Snippet (Snippet174.java) a separate thread
> calls render every 50ms. I thought at first that this might be an
> animation thread, but the Quad that gets rendered appears to be static.
> (The OpenGLExample appears to follow the same pattern.)
> Is there a reason for constantly rendering in this way, even though
> the window is not being damage/overlapped, as opposed to calling render
> through a PaintEvent? E.g
> canvas.addPaintListener(new PaintListener() {
> public void paintControl(PaintEvent e) {
> render();
> context.swapBuffers();
> }
> });
If I remind me correctly this doesn't for GTK, because the empty GC repaint
this area after the GLContext were rendered.
I use a very dirty and ugly hack to get the expose event to redraw the
GLContext by overriding gtk_expose_event(int, int) method. I wish there
will be a better method to repaint the GLContext.
Stephan Michels
|
|
|
Powered by
FUDForum. Page generated in 0.03134 seconds