Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » OpenGL SWT Snippet render thread
OpenGL SWT Snippet render thread [message #450744] Thu, 17 February 2005 14:59 Go to next message
Asim Ullah is currently offline Asim UllahFriend
Messages: 24
Registered: July 2009
Junior Member
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 15:41 Go to previous message
Stephan Michels is currently offline Stephan MichelsFriend
Messages: 23
Registered: July 2009
Junior Member
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
Previous Topic:Slider Events
Next Topic:OpenGL plugin on Windows
Goto Forum:
  


Current Time: Sat Apr 27 01:09:36 GMT 2024

Powered by FUDForum. Page generated in 0.03028 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top